Re: How to intercept exceptions in Carbon
Re: How to intercept exceptions in Carbon
- Subject: Re: How to intercept exceptions in Carbon
- From: Wincent Colaiuta <email@hidden>
- Date: Mon, 13 Aug 2007 12:19:23 +0200
El 13/8/2007, a las 11:10, Dieter Oberkofler escribió:
GG,
You are perfectly right but unfortunately "we" are human and DO
make errors and even if "we" would not, some 3rd party library will
for sure.
The point is how to deal with them and (generally speaking) I
prefer to intercept, log and report them in a way similar to how
the Apple Crash Reporter works.
It would also be fine to use the Crash Reporter but unfortunately
this tools does not have to active all the time, does not allow to
customize the information to report and most important of all to
send the information to the application vendor instead of Apple.
To be more precise, I would like to create an application based
error handler similar to the Apple Crash Reporter and intercept all
or as many as possible exception thrown by Hardware, System
Software and Applications Software.
One of the principal obstacles to doing this is that the crash
reporter daemon already takes your per-application exception handling
port and as far as I know there's no way to wrest control away from
it; you therefore have to rely on per-thread exception ports.
In today's multi-core, multi-threaded world you're unlikely to be
able to install exception handlers on all threads because there are
lots of ways in which you can indirectly trigger the creation of
separate threads and you won't have direct control over those
threads. As such, the best you can do is hope to catch some crashes
(easy enough on the main thread) but not all of them.
Consider the alternative path:
1. When shutting down cleanly record the date/time in a plist
2. On launch compare that date with the modification date on the
crash log which corresponds to your application
3. If log is more recent, display a "Application X did not shut down
cleanly" window and offer to send in a report
Cheers,
Wincent
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden