|
|

楼主 |
发表于 2006-3-14 14:49:41
|
显示全部楼层
整了半天,mozilla的两个类似补丁打不上。有没有人可以写个overlay出来呢?
下面附上补丁:
- --- xpcom/base/nsTraceRefcntImpl.cpp 2004-02-11 07:16:10.000000000 +0000
- +++ xpcom/base/nsTraceRefcntImpl.cpp 2006-03-13 05:56:48.810241000 +0000
- @@ -50,19 +50,6 @@
-
- #if defined(_WIN32)
- #include <windows.h>
- -#elif defined(linux) && defined(__GLIBC__) && (defined(__i386) || defined(PPC))
- -#include <setjmp.h>
- -
- -//
- -// On glibc 2.1, the Dl_info api defined in <dlfcn.h> 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 <dlfcn.h>
- #endif
-
- #ifdef HAVE_LIBDL
- @@ -484,7 +471,7 @@
-
- #endif /* NS_BUILD_REFCNT_LOGGING */
-
- -nsresult
- +NS_COM nsresult
- nsTraceRefcntImpl::DumpStatistics(StatisticsType type, FILE* out)
- {
- nsresult rv = NS_OK;
- @@ -561,7 +548,7 @@
- return rv;
- }
-
- -void
- +NS_COM void
- nsTraceRefcntImpl::ResetStatistics()
- {
- #ifdef NS_BUILD_REFCNT_LOGGING
- @@ -850,7 +837,7 @@
-
- #if defined(_WIN32) && defined(_M_IX86) // WIN32 x86 stack walking code
- #include "nsStackFrameWin.h"
- -void
- +NS_COM void
- nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
- {
- DumpStackToFile(aStream);
- @@ -858,9 +845,9 @@
-
- // 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);
- @@ -960,7 +947,7 @@
-
- #else // unsupported platform.
-
- -void
- +NS_COM void
- nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
- {
- fprintf(aStream, "write me, dammit!\n");
复制代码- ---xpcom/base/nsStackFrameUnix.cpp 2004-03-08 07:47:44.000000000 +0000
- +++ xpcom/base/nsStackFrameUnix.cpp 2006-03-13 05:56:48.866244500 +0000
- @@ -78,25 +78,15 @@
- }
-
-
- -#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 <setjmp.h>
- -//
-
- 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) {
复制代码 |
|