[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Triggering core dump creation
From: |
Sašo Kiselkov |
Subject: |
Re: Triggering core dump creation |
Date: |
Fri, 15 Jun 2012 13:15:35 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 |
On 06/15/2012 12:36 PM, Andreas Höschler wrote:
> Hi all,
>
> I am trying to track down a problem that occurs only every 6 weeks or so
> (impossible to reproduce at will). I am raising an exception
>
> [NSException raise:NSInternalInconsistencyException format:@"%@",
> message];
>
> when the problem occurs. This exception is catched and the message presented
> in a panel.
>
> Is there any way to programmatically cause a core dump instead of raising the
> exception? I need a back trace to find the cause of the problem.
A common trick I use if I want to dump core when an exception is
triggered is to simply override -raise as follows:
@implementation NSException (CoreDumps)
- (void) raise
{
abort ();
}
@end
Afterwards, simply enable core dumping if you're on Linux and run your
program:
$ ulimit -c unlimited
$ ./myprog
--
Saso