Is there any library does minidump on Mac? - debugging

MiniDump is a great feature for debugging crashes on Windows, especially because it is small, so it can be sent via crash reports. (Window Error Reporting).
But it seems Mac OS X and other BSD system only supports full core dump.
Is there any mini-dump implementation on Mac or BSD system? Or how does Mac software developer analyze customer's crash reports?
Thanks!
-Jonny

Yes, you can use Google breakpad, which works on Windows, Mac, and Linux. As an added bonus, the file format it creates is the same as the windows minidump format, no matter what platform it's using - so you can apply your current analysis tools to dumps from windows clients.

Related

If cocoa app crashes where is stacktrace /crash log stored?

I am new to mac and cocoa development. When a cocoa app crashes there is a windows that asks the user to report crash log to apple. I want to write a customized reporting component. So I want to know if crash reports /log are automatically stored somewhere are these simple text files or core dumps ?
I am looking to support 10.5 to 10.8
Crash logs can be found in a number of places.
In MacOS 10.8 (and I believe also 10.7) crash logs would be "~/Library/Logs/DiagnosticReports" or "/Library/Logs/DiagnosticReports" (the first is for crashes for user apps and the second is for system-wide apps).
Now instead of "reinventing the wheel", you may want to consider third party alternatives that can generate and return crash reports to you. Wikipedia lists these:
Unsanity developed an Input Manager called Smart Crash Reports, that
patches Apple software to include a "submit to developer" button
within Crash Reporter. Smart Crash Reports only works with Mac OS
X 10.4 and 10.5.
Uli Kusterer wrote UKCrashReporter, which can send the output of Apple's Crash Reporter to a developer the next time the
application is started.
CMCrashReporter is a small opensource framework, which can send the crashlog to the developer (via HTTP POST) and let the user
enter optional details.
ILCrashReporter-NG, a fork of Infinite Loop's ILCrashReporter (which was for Mac OS X 10.2-10.5); current OS support unknown
plcrashreporter Plausible CrashReporter provides an in-process crash reporting
framework for use on both the iPhone and Mac OS X
Google Breakpad, an open-source multi-platform crash reporting system

How to symbolicate PLCrashReports for OS X Apps

I've added PLCrashReporter to my OS X application and am successfully saving the crash dumps to a server. However, plcrashutil does not appear to symbolicate even with the .app and .dSYM in the same directory as both plcrashutil and the crash file.
I also tried following the instructions in TN 2123 for using gdb to get the address and it fails to give a source line for the symbols reported in the crash file.
plcrashutil does not symbolicate, it just creates a crash file in the standard format. You'll need to use symbolicatecrash.pl from Xcode to symbolicate the report.
There is a patched version of symbolicatecrash.pl, which fixes a few bugs, available here: https://github.com/TheRealKerni/QuincyKit/tree/develop/server/local
Please note, that PLCrashReporter currently does not work correctly on Intel 64Bit architecture!
But a new version with support for 64Bit is being worked on from the PLCrashReporter developers in cooperation with HockeyApp. See http://www.mikeash.com/pyblog/friday-qa-2012-04-27-plcrashreporter-and-unwinding-the-stack-with-dwarf.html and http://www.hockeyapp.net/blog/2012/4/27/mac-os-x-sandbox-support-is-coming.html

Where is Mac OS X Debugging Interface

I am new to UNIX and Mac OS X systems and wondering how debugging on Max OS X works. I am from Windows world and I am familiar with debugging system in Windows like attaching to a process with DebugActiveProcess, reading/writing memory with Read/WriteProcessMemory and so on...
I don't know if Mac OS X's debugging also woriking like Windows but
I want to know how a debugger in Max OS X communicates with a target process. Can anyone give me some hits of a start point or documents where I should read first?
The debugging interface on OS X and most Unixes is called ptrace.
Type man ptrace at a command prompt for information on how ptrace communicates between processes, and also have a look at the header at /usr/include/sys/ptrace.h
The typical debuggers are gbd and (recently) lldb. Many IDEs on OS X also use these. So.. "man gdb" is a good starting point.
As user1118321 mentioned, installing the Xcode toolset would be a good idea, if you've not done so already. It includes compilers, an IDE, debuggers, profilers, and graphical programs for these tools.
You didn't state which language, or tools you're using, so for the purposes of this answer I'll assume you're using Objective-C with either gcc or clang to compile your code and link it into an executable. If you're using some other language, such as java or ruby, the equivalent from windows probably exists for OS X as well.
In general, unix uses GDB for debugging, and OS X is no different. You won't always attach it to a running process, I find that's more common to start a process in the debugger, although there do exist tools (such as Instruments) that will profile a running process.
If you're using XCode, there's a whole suite of debugging tools built in that use gdb under the hood. I suggest you start reading some of the developer documentation here http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/130-Debugging_Applications/debugging_applications.html and then ask around if there's something in particular you want to know about.
If you've installed Xcode, look at all of the applications installed in /Developer/Applications, at a minimum you should find
Xcode - write and debug, design interfaces here
Instruments - profile your application, look for memory leaks
Icon Composer - create slick icons for your applications
Graphics Tools - used to help work with OpenGL and Quartz mainly

How to generate a core file for a crashed app in XCode + gdb?

Having reproduced an elusive bug that crashes my app (running inside the iOS simulator, to be precise), I want to generate a core file for inspection later. On Linux I would run generate-core-file from within gdb, but that command isn't available in the Mac OS X version of gdb.
So, how can I generate a core file from within gdb? There are ways to ask the OS for a core dump of a crashed app, but I fear the app will change some of its state by then. What's the best way to do this?
Thanks!
Unfortunate there is no gcore command in mac osx gdb, but there is a good article about how to generate core dump on osx
Link
In this article there is a downloadable source code to generate core dump, which I have used many times.

PRC-Tools For MS-DOS

I'm emulating MS-DOS 6.22 with PocketDOS, but I want to develop for Palm OS on it, then I want to know if I can run prc-tools or any other compiler for Palm OS on it.
I never saw a port of prc-tools to run in a strict DOS environment. The Windows versions of them were built on top of the cygwin framework. It's possible that you could build it using DJGPP, but I suspect that much of the code, libraries, and utilities rely on having more than 8.3 characters in filenames.
The other key tools were all Windows, Mac, or Linux based. By the time Palm OS development really started, DOS just wasn't an environment professional programmers were using for programming.
You could try running Mini vMac from http://jpdefault.altervista.org/?p=software&id=minivmac and then using an old version of CodeWarrior for Palm OS. Version 6 still had support for 68K hosts, IIRC.

Resources