Re: How to intercept exceptions in Carbon
Re: How to intercept exceptions in Carbon
- Subject: Re: How to intercept exceptions in Carbon
- From: Steve Checkoway <email@hidden>
- Date: Mon, 13 Aug 2007 14:58:48 -0700
On Aug 13, 2007, at 6:47 AM, Dieter Oberkofler wrote:
I fully agree and especially the fact that Crash Reporter can be
disabled is a major drawback.
Would you be willing to share your implementation with us or point
me to some some good information?
The majority of the code is in <http://stepmania.cvs.sourceforge.net/
stepmania/stepmania/src/archutils/Unix/> in CrashHandler*,
Backtrace*, and SignalHandler.*. This is the combined linux and OS X
handler.
On Aug 13, 2007, at 8:44 AM, Wincent Colaiuta wrote:
El 13/8/2007, a las 13:18, Steve Checkoway escribió:
On Aug 13, 2007, at 3:19 AM, Wincent Colaiuta wrote:
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.
Are you sure about this? I was told to consider using mach for
this when I asked on the darwin-dev list (which is probably a
better place for this thread than xcode-users).
The last time I looked at this (within the last year) that's what
Apple DTS told me.
Okay. I didn't talk to DTS, only people on the list.
Furthermore, using signals, I have been able to catch and generate
backtraces (for powerpc at least, I have no i386 so I haven't
written that code yet) for almost every crash.
That didn't work for me... I found that the crash reporter still
launched even though I was catching the signals and the program
continued executing.
Yes, I remember that used to be the case for me as well but it's been
quite a while since it's popped up for my program but it does come up
for others so I'm pretty sure it isn't disabled. I just checked the
CrashReporterPrefs, it's set to Developer and running the program:
int main()
{
return *(char *)0 = 0;
}
pops up the "The application a.out quit unexpectedly" dialog. I'm
pretty sure I didn't use the advice in <http://lists.apple.com/
archives/Unix-porting/2007/Mar/msg00009.html> but I just tested the
code, throwing a *(char *)0 = 0; into a random place in my main()
after crash handling had been set up and I got no dialog.
Are you sure that the crash reporter will log it even if it's
disabled?
No, not sure but I believe it to be the case.
For the server setting it does still log it. Is that the most
disabled it can be?
It seems better to catch it, fork a new process, write(2) some
data to the new process and have that handle it.
If you use the Apple-generated crash reports then you get a bunch
of other stuff for free, like address-to-symbol conversion, binary
image lists, process info and the like.
The code I linked above does address-to-symbol conversion and also
dumps other data that is more useful (to me), than binary image
descriptions or register states. I do not think that would be all
that hard to include if I wanted it anyway.
--
Steve Checkoway
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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