Index: xpcom/base/nsStackFrameUnix.cpp =================================================================== RCS file: /cvsroot/mozilla/xpcom/base/nsStackFrameUnix.cpp,v retrieving revision 1.11 diff -d -u -p -6 -r1.11 nsStackFrameUnix.cpp --- xpcom/base/nsStackFrameUnix.cpp 8 Mar 2004 07:47:44 -0000 1.11 +++ xpcom/base/nsStackFrameUnix.cpp 12 Feb 2006 16:11:45 -0000 @@ -75,31 +75,21 @@ void DemangleSymbol(const char * aSymbol free(demangled); } #endif // MOZ_DEMANGLE_SYMBOLS } -#if defined(linux) && defined(__GLIBC__) && (defined(__i386) || defined(PPC)) // i386 or PPC Linux stackwalking code +#if defined(linux) && defined(__GNUC__) && (defined(__i386) || defined(PPC)) // i386 or PPC Linux stackwalking code -#include -// void DumpStackToFile(FILE* aStream) { - jmp_buf jb; - setjmp(jb); - // Stack walking code courtesy Kipp's "leaky". - // Get the frame pointer out of the jmp_buf - void **bp = (void**) -#if defined(__i386) - (jb[0].__jmpbuf[JB_BP]); -#elif defined(PPC) - (jb[0].__jmpbuf[JB_GPR1]); -#endif + // Get the frame pointer + void **bp = (void**) __builtin_frame_address(0); int skip = 2; for ( ; (void**)*bp > bp; bp = (void**)*bp) { void *pc = *(bp+1); if (--skip <= 0) { Dl_info info; Index: xpcom/base/nsTraceRefcntImpl.cpp =================================================================== RCS file: /cvsroot/mozilla/xpcom/base/nsTraceRefcntImpl.cpp,v retrieving revision 1.93 diff -d -u -p -6 -r1.93 nsTraceRefcntImpl.cpp --- xpcom/base/nsTraceRefcntImpl.cpp 11 Feb 2004 07:16:10 -0000 1.93 +++ xpcom/base/nsTraceRefcntImpl.cpp 12 Feb 2006 16:11:45 -0000 @@ -47,25 +47,12 @@ #include "nsCOMPtr.h" #include "nsCRT.h" #include #if defined(_WIN32) #include -#elif defined(linux) && defined(__GLIBC__) && (defined(__i386) || defined(PPC)) -#include - -// -// On glibc 2.1, the Dl_info api defined in is only exposed -// if __USE_GNU is defined. I suppose its some kind of standards -// adherence thing. -// -#if (__GLIBC_MINOR__ >= 1) && !defined(__USE_GNU) -#define __USE_GNU -#endif - -#include #endif #ifdef HAVE_LIBDL #include #endif @@ -481,13 +468,13 @@ static PRIntn PR_CALLBACK DumpSerialNumb return HT_ENUMERATE_NEXT; } #endif /* NS_BUILD_REFCNT_LOGGING */ -nsresult +NS_COM nsresult nsTraceRefcntImpl::DumpStatistics(StatisticsType type, FILE* out) { nsresult rv = NS_OK; #ifdef NS_BUILD_REFCNT_LOGGING if (gBloatLog == nsnull || gBloatView == nsnull) { return NS_ERROR_FAILURE; @@ -558,13 +545,13 @@ done: gLogging = wasLogging; UNLOCK_TRACELOG(); #endif return rv; } -void +NS_COM void nsTraceRefcntImpl::ResetStatistics() { #ifdef NS_BUILD_REFCNT_LOGGING LOCK_TRACELOG(); if (gBloatView) { PL_HashTableDestroy(gBloatView); @@ -847,23 +834,23 @@ static void InitTraceLog(void) } #endif #if defined(_WIN32) && defined(_M_IX86) // WIN32 x86 stack walking code #include "nsStackFrameWin.h" -void +NS_COM void nsTraceRefcntImpl::WalkTheStack(FILE* aStream) { DumpStackToFile(aStream); } // WIN32 x86 stack walking code // i386 or PPC Linux stackwalking code or Solaris -#elif (defined(linux) && defined(__GLIBC__) && (defined(__i386) || defined(PPC))) || (defined(__sun) && (defined(__sparc) || defined(sparc) || defined(__i386) || defined(i386))) +#elif (defined(linux) && defined(__GNUC__) && (defined(__i386) || defined(PPC))) || (defined(__sun) && (defined(__sparc) || defined(sparc) || defined(__i386) || defined(i386))) #include "nsStackFrameUnix.h" -void +NS_COM void nsTraceRefcntImpl::WalkTheStack(FILE* aStream) { DumpStackToFile(aStream); } #elif defined(XP_MAC) @@ -957,13 +944,13 @@ nsTraceRefcntImpl::WalkTheStack(FILE* aS break; } } #else // unsupported platform. -void +NS_COM void nsTraceRefcntImpl::WalkTheStack(FILE* aStream) { fprintf(aStream, "write me, dammit!\n"); } #endif