Re: How to enable crash log generation in 10.5?
Re: How to enable crash log generation in 10.5?
- Subject: Re: How to enable crash log generation in 10.5?
- From: "parag vibhute" <email@hidden>
- Date: Thu, 5 Jun 2008 19:11:05 +0530
This only works if exception occurs in main thread. I have created a thread
using pthread APIs, but if exception occurs in that thread then it does not
get caught. So what to do?
Parag
On Thu, Jun 5, 2008 at 1:14 PM, Vijay Malhan <email@hidden> wrote:
>
>
> On Thu, Jun 5, 2008 at 12:51 PM, parag vibhute <email@hidden>
> wrote:
>
>> Hi all,
>>
>> I have implemented Cocoa application where I am handling exceptions
>> through
>> signal handling.
>>
>> I went through the Apple TechNote TN2123 (
>> http://developer.apple.com/technotes/tn2004/tn2123.html). It states
>> following statement:
>>
>> *Prior to Mac OS X 10.5, if you wrote a program that cause an exception
>> but
>> handled that exception via a signal handler <x-man-page://3/signal>,
>> CrashReporter would erroneously generate a crash log for your program (r.
>> 2941263) <rdar://problem/2941263>.
>>
>>
>> *Now my requirement is that OS should generate crash log for my
>> application
>> in Mac OS 10.5 also (which will not happen by default as per above
>> statement). So how to achieve this?
>>
>
> If you need a StackTrace on some exception, you can do that by registering
> for delegate calls to NSExceptionHandler.
>
> // Tells you for what kind of Exception you want to register for..
>
> [[NSExceptionHandler defaultExceptionHandler] setExceptionHandlingMask:
>
> exceptionHandlingMask];
>
> [[NSExceptionHandler defaultExceptionHandler] setDelegate: self];
>
> // Delegate method to implement. Gets call when there is an exception.
> - (BOOL)exceptionHandler:(NSExceptionHandler *)sender
> shouldHandleException:(NSException *)exception mask:(unsigned int)aMask
>
> {
>
> // Log the stack here...
>
> [exception printStackTrace];
>
> return YES;
>
> }
>
>
>
> - Vijay
>
>>
>>
>> Thanks,
>> Palav
>>
>>
>> --
>>
>> There are many things in your life that will catch your eye but only a few
>> will catch your heart....pursue those'.
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>>
>
>
--
There are many things in your life that will catch your eye but only a few
will catch your heart....pursue those'.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden