I'm working on a Cocoa app targeting Leopard and above, and I'm thinking about adding a crash reporter to it (I'd like to think my app won't crash, but let's get real here). I have some mostly conceptual questions before I really get started.
1) How does this work conceptually, knowing when there's a crash and bringing up a reporter? Do I have a daemon running looking for a crash, or do I wait until my app is launched next time to report?
2) Can this be done in Cocoa? Or would I have to dip into Carbon or IOKit or somesuch?
3) Is this even a good idea? Mac OS X already has a built in crash reporter, but as a developer I don't get to see the crash logs. I don't think my app will be crashing often, frankly, but I just don't want to be naive but this sort of thing.
What are your thoughts and opinions regarding this?
EXC_BREAKPOINT (SIGTRAP) and EXC_BAD_INSTRUCTION (SIGILL)The breakpoint exception type indicates a trace trap interrupted the process. A trace trap gives an attached debugger the chance to interrupt the process at a specific point in its execution. On ARM processors, this appears as EXC_BREAKPOINT (SIGTRAP).
I've had a lot of success with UKCrashReporter. The code is straighforward and easy to modify to match the L&F of your app.
PLCrashReporter looks interesting, though.
I'd stay away from Smart Crash Reporter just because many users (rightfully) don't appreciate your app injecting code into unexpected places and it strikes me as a fragile (perhaps dangerous to use in a released app) approach.
Others have answered the question well and pointed to some good example code.
Coding it yourself is fairly simple. The strategy generally is:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With