mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-22 05:02:00 +00:00
honour GNUSTEP_STACK_TRACE environment variable
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25685 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c4fa37544f
commit
e44197721f
1 changed files with 9 additions and 6 deletions
|
@ -699,16 +699,18 @@ static void _terminate()
|
|||
static void
|
||||
_NSFoundationUncaughtExceptionHandler (NSException *exception)
|
||||
{
|
||||
NSString *stack;
|
||||
|
||||
fprintf(stderr, "%s: Uncaught exception %s, reason: %s\n",
|
||||
GSPrivateArgZero(),
|
||||
[[exception name] lossyCString], [[exception reason] lossyCString]);
|
||||
fflush(stderr); /* NEEDED UNDER MINGW */
|
||||
stack = [[[exception userInfo] objectForKey: @"GSStackTraceKey"] description];
|
||||
if (stack != nil)
|
||||
if (GSPrivateEnvironmentFlag("GNUSTEP_STACK_TRACE", NO) == YES)
|
||||
{
|
||||
fprintf(stderr, "Stack\n%s\n", [stack lossyCString]);
|
||||
id o = [exception callStackReturnAddresses];
|
||||
|
||||
#if defined(STACKSYMBOLS)
|
||||
o = AUTORELEASE([[GSStackTrace alloc] initWithAddresses: o]);
|
||||
#endif
|
||||
fprintf(stderr, "Stack\n%s\n", [o lossyCString]);
|
||||
}
|
||||
fflush(stderr); /* NEEDED UNDER MINGW */
|
||||
|
||||
|
@ -949,7 +951,8 @@ _NSFoundationUncaughtExceptionHandler (NSException *exception)
|
|||
{
|
||||
if (_reserved != 0)
|
||||
{
|
||||
if (_e_stack != nil)
|
||||
if (_e_stack != nil
|
||||
&& GSPrivateEnvironmentFlag("GNUSTEP_STACK_TRACE", NO) == YES)
|
||||
{
|
||||
id o = _e_stack;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue