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:
Richard Frith-MacDonald 2007-12-06 09:29:22 +00:00
parent c4fa37544f
commit e44197721f

View file

@ -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;