From 035b04b87b29634c63769fc2711fde754f11ebea Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Thu, 21 Oct 1999 03:45:12 +0000 Subject: [PATCH] Change nsTraceRefcnt::WalkTheStack() to accept stream. git-svn-id: svn://10.0.0.236/trunk@51353 18797224-902f-48f8-a5cc-f745e15eee43 --- .../tests/viewer/unix/gtk/nsGtkMain.cpp | 24 ++----------------- mozilla/xpfe/bootstrap/nsAppRunner.cpp | 24 ++----------------- 2 files changed, 4 insertions(+), 44 deletions(-) diff --git a/mozilla/webshell/tests/viewer/unix/gtk/nsGtkMain.cpp b/mozilla/webshell/tests/viewer/unix/gtk/nsGtkMain.cpp index a37cf8c9918..4c8740bf5ac 100644 --- a/mozilla/webshell/tests/viewer/unix/gtk/nsGtkMain.cpp +++ b/mozilla/webshell/tests/viewer/unix/gtk/nsGtkMain.cpp @@ -124,28 +124,8 @@ ah_crap_handler(int signum) getpid(), strsignal(signum)); - char stack[4096]; - - nsTraceRefcnt::WalkTheStack(stack, sizeof(stack)); - - // Convert all spaces between symbols to newlines for readability - char * needle = "+0x"; - char * haystack = stack; - char * sp = NULL; - - while((sp = strstr(haystack,needle))) - { - char * ws = strchr(sp,' '); - - if (ws) - { - *ws = '\n'; - - haystack = ws + 1; - } - } - - printf("stack = %s\n\n",stack); + printf("stack\n",stack); + nsTraceRefcnt::WalkTheStack(stdout); printf("Sleeping for 5 minutes.\n"); printf("Type 'gdb %s %d' to attatch your debugger to this thread.\n", diff --git a/mozilla/xpfe/bootstrap/nsAppRunner.cpp b/mozilla/xpfe/bootstrap/nsAppRunner.cpp index d78cdbc8a9e..1ae34cb1409 100644 --- a/mozilla/xpfe/bootstrap/nsAppRunner.cpp +++ b/mozilla/xpfe/bootstrap/nsAppRunner.cpp @@ -648,28 +648,8 @@ ah_crap_handler(int signum) getpid(), strsignal(signum)); - char stack[4096]; - - nsTraceRefcnt::WalkTheStack(stack, sizeof(stack)); - - // Convert all spaces between symbols to newlines for readability - char * needle = "+0x"; - char * haystack = stack; - char * sp = NULL; - - while((sp = strstr(haystack,needle))) - { - char * ws = strchr(sp,' '); - - if (ws) - { - *ws = '\n'; - - haystack = ws + 1; - } - } - - printf("stack = %s\n\n",stack); + printf("stack\n",stack); + nsTraceRefcnt::WalkTheStack(stdout); printf("Sleeping for 5 minutes.\n"); printf("Type 'gdb %s %d' to attatch your debugger to this thread.\n",