mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

212 lines
5.1 KiB

  1. see https://bugzilla.mozilla.org/show_bug.cgi?id=323853
  2. --- ./xpcom/base/nsTraceRefcntImpl.cpp 2004-02-11 07:16:10.000000000 +0000
  3. +++ ./xpcom/base/nsTraceRefcntImpl.cpp 2006-03-13 05:56:48.810241000 +0000
  4. @@ -50,19 +50,6 @@
  5. #if defined(_WIN32)
  6. #include <windows.h>
  7. -#elif defined(linux) && defined(__GLIBC__) && (defined(__i386) || defined(PPC))
  8. -#include <setjmp.h>
  9. -
  10. -//
  11. -// On glibc 2.1, the Dl_info api defined in <dlfcn.h> is only exposed
  12. -// if __USE_GNU is defined. I suppose its some kind of standards
  13. -// adherence thing.
  14. -//
  15. -#if (__GLIBC_MINOR__ >= 1) && !defined(__USE_GNU)
  16. -#define __USE_GNU
  17. -#endif
  18. -
  19. -#include <dlfcn.h>
  20. #endif
  21. #ifdef HAVE_LIBDL
  22. @@ -484,7 +471,7 @@
  23. #endif /* NS_BUILD_REFCNT_LOGGING */
  24. -nsresult
  25. +NS_COM nsresult
  26. nsTraceRefcntImpl::DumpStatistics(StatisticsType type, FILE* out)
  27. {
  28. nsresult rv = NS_OK;
  29. @@ -561,7 +548,7 @@
  30. return rv;
  31. }
  32. -void
  33. +NS_COM void
  34. nsTraceRefcntImpl::ResetStatistics()
  35. {
  36. #ifdef NS_BUILD_REFCNT_LOGGING
  37. @@ -850,7 +837,7 @@
  38. #if defined(_WIN32) && defined(_M_IX86) // WIN32 x86 stack walking code
  39. #include "nsStackFrameWin.h"
  40. -void
  41. +NS_COM void
  42. nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
  43. {
  44. DumpStackToFile(aStream);
  45. @@ -858,9 +845,9 @@
  46. // WIN32 x86 stack walking code
  47. // i386 or PPC Linux stackwalking code or Solaris
  48. -#elif (defined(linux) && defined(__GLIBC__) && (defined(__i386) || defined(PPC))) || (defined(__sun) && (defined(__sparc) || defined(sparc) || defined(__i386) || defined(i386)))
  49. +#elif (defined(linux) && defined(__GNUC__) && (defined(__i386) || defined(PPC))) || (defined(__sun) && (defined(__sparc) || defined(sparc) || defined(__i386) || defined(i386)))
  50. #include "nsStackFrameUnix.h"
  51. -void
  52. +NS_COM void
  53. nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
  54. {
  55. DumpStackToFile(aStream);
  56. @@ -960,7 +947,7 @@
  57. #else // unsupported platform.
  58. -void
  59. +NS_COM void
  60. nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
  61. {
  62. fprintf(aStream, "write me, dammit!\n");
  63. --- ./xpcom/base/nsStackFrameUnix.cpp 2004-03-08 07:47:44.000000000 +0000
  64. +++ ./xpcom/base/nsStackFrameUnix.cpp 2006-03-13 05:56:48.866244500 +0000
  65. @@ -82,26 +82,16 @@
  66. #endif // MOZ_DEMANGLE_SYMBOLS
  67. }
  68. -#if defined(linux) && defined(__GLIBC__) && (defined(__i386) || defined(PPC)) // i386 or PPC Linux stackwalking code
  69. +#if defined(linux) && defined(__GNUC__) && (defined(__i386) || defined(PPC)) // i386 or PPC Linux stackwalking code
  70. -#include <setjmp.h>
  71. -//
  72. void DumpStackToFile(FILE* aStream)
  73. {
  74. - jmp_buf jb;
  75. - setjmp(jb);
  76. -
  77. // Stack walking code courtesy Kipp's "leaky".
  78. - // Get the frame pointer out of the jmp_buf
  79. - void **bp = (void**)
  80. -#if defined(__i386)
  81. - (jb[0].__jmpbuf[JB_BP]);
  82. -#elif defined(PPC)
  83. - (jb[0].__jmpbuf[JB_GPR1]);
  84. -#endif
  85. + // Get the frame pointer
  86. + void **bp = (void**) __builtin_frame_address(0);
  87. int skip = 2;
  88. for ( ; (void**)*bp > bp; bp = (void**)*bp) {
  89. --- ./gc/boehm/os_dep.c 15 Jun 2001 19:29:38 -0000 1.12
  90. +++ ./gc/boehm/os_dep.c 18 Mar 2006 17:55:07 -0000
  91. @@ -2420,42 +2420,38 @@ void GC_save_callers(struct callinfo inf
  92. }
  93. info[0].ci_pc = (word) currentTree;
  94. info[1].ci_pc = 0;
  95. }
  96. #endif
  97. #endif /* POWERPC && MACOS */
  98. #if defined(SAVE_CALL_CHAIN) && defined(LINUX)
  99. -#include <setjmp.h>
  100. -
  101. #include "call_tree.h"
  102. typedef struct stack_frame stack_frame;
  103. #if defined(__i386)
  104. struct stack_frame {
  105. stack_frame* next;
  106. void* pc;
  107. };
  108. static stack_frame* getStackFrame()
  109. {
  110. - jmp_buf jb;
  111. stack_frame* currentFrame;
  112. - setjmp(jb);
  113. - currentFrame = (stack_frame*)(jb[0].__jmpbuf[JB_BP]);
  114. + currentFrame = (stack_frame*)__builtin_frame_address(0);
  115. currentFrame = currentFrame->next;
  116. return currentFrame;
  117. }
  118. #endif /* __i386 */
  119. static call_tree* find_tree(stack_frame* frame)
  120. {
  121. /* primordial root of the call tree. */
  122. static call_tree root = { 0, 0, 0, 0, 0 };
  123. long pc = (long)frame->pc;
  124. --- ./js/src/jsutil.c 14 Sep 2005 17:30:10 -0000 3.22
  125. +++ ./js/src/jsutil.c 18 Mar 2006 17:55:22 -0000
  126. @@ -57,26 +57,25 @@
  127. #if defined(WIN32)
  128. DebugBreak();
  129. #endif
  130. #if defined(XP_OS2)
  131. asm("int $3");
  132. #endif
  133. abort();
  134. }
  135. #if defined DEBUG_notme && defined XP_UNIX
  136. #define __USE_GNU 1
  137. #include <dlfcn.h>
  138. -#include <setjmp.h>
  139. #include <string.h>
  140. #include "jshash.h"
  141. #include "jsprf.h"
  142. JSCallsite js_calltree_root = {0, NULL, NULL, 0, NULL, NULL, NULL, NULL};
  143. static JSCallsite *
  144. CallTree(uint32 *bp)
  145. {
  146. uint32 *bpup, *bpdown, pc;
  147. JSCallsite *parent, *site, **csp;
  148. Dl_info info;
  149. @@ -161,30 +160,27 @@ CallTree(uint32 *bp)
  150. upward:
  151. parent = site;
  152. bpdown = bp;
  153. bp = bpup;
  154. } while (bp);
  155. return site;
  156. }
  157. JSCallsite *
  158. JS_Backtrace(int skip)
  159. {
  160. - jmp_buf jb;
  161. uint32 *bp, *bpdown;
  162. - setjmp(jb);
  163. -
  164. /* Stack walking code adapted from Kipp's "leaky". */
  165. - bp = (uint32*) jb[0].__jmpbuf[JB_BP];
  166. + bp = (uint32*) __builtin_frame_address(0);
  167. while (--skip >= 0) {
  168. bpdown = (uint32*) *bp++;
  169. if (bpdown < bp)
  170. break;
  171. bp = bpdown;
  172. }
  173. return CallTree(bp);
  174. }
  175. #endif /* DEBUG_notme && XP_UNIX */