View | Details | Raw Unified
Collapse All | Expand All

(-) xpcom/base/nsStackFrameUnix.cpp (-13 / +3 lines)
 Lines 75-105   void DemangleSymbol(const char * aSymbol Link Here 
        free(demangled);
        free(demangled);
    }
    }
#endif // MOZ_DEMANGLE_SYMBOLS
#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 <setjmp.h>
//
void DumpStackToFile(FILE* aStream)
void DumpStackToFile(FILE* aStream)
{
{
  jmp_buf jb;
  setjmp(jb);
  // Stack walking code courtesy Kipp's "leaky".
  // Stack walking code courtesy Kipp's "leaky".
  // Get the frame pointer out of the jmp_buf
  // Get the frame pointer
  void **bp = (void**)
  void **bp = (void**) __builtin_frame_address(0);
#if defined(__i386) 
    (jb[0].__jmpbuf[JB_BP]);
#elif defined(PPC)
    (jb[0].__jmpbuf[JB_GPR1]);
#endif
  int skip = 2;
  int skip = 2;
  for ( ; (void**)*bp > bp; bp = (void**)*bp) {
  for ( ; (void**)*bp > bp; bp = (void**)*bp) {
    void *pc = *(bp+1);
    void *pc = *(bp+1);
    if (--skip <= 0) {
    if (--skip <= 0) {
      Dl_info info;
      Dl_info info;
(-) xpcom/base/nsTraceRefcntImpl.cpp (-19 / +6 lines)
 Lines 47-71    Link Here 
#include "nsCOMPtr.h"
#include "nsCOMPtr.h"
#include "nsCRT.h"
#include "nsCRT.h"
#include <math.h>
#include <math.h>
#if defined(_WIN32)
#if defined(_WIN32)
#include <windows.h>
#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
#endif
#ifdef HAVE_LIBDL
#ifdef HAVE_LIBDL
#include <dlfcn.h>
#include <dlfcn.h>
#endif
#endif
 Lines 481-493   static PRIntn PR_CALLBACK DumpSerialNumb Link Here 
  return HT_ENUMERATE_NEXT;
  return HT_ENUMERATE_NEXT;
}
}
#endif /* NS_BUILD_REFCNT_LOGGING */
#endif /* NS_BUILD_REFCNT_LOGGING */
nsresult
NS_COM nsresult
nsTraceRefcntImpl::DumpStatistics(StatisticsType type, FILE* out)
nsTraceRefcntImpl::DumpStatistics(StatisticsType type, FILE* out)
{
{
  nsresult rv = NS_OK;
  nsresult rv = NS_OK;
#ifdef NS_BUILD_REFCNT_LOGGING
#ifdef NS_BUILD_REFCNT_LOGGING
  if (gBloatLog == nsnull || gBloatView == nsnull) {
  if (gBloatLog == nsnull || gBloatView == nsnull) {
    return NS_ERROR_FAILURE;
    return NS_ERROR_FAILURE;
 Lines 558-570   done: Link Here 
  gLogging = wasLogging;
  gLogging = wasLogging;
  UNLOCK_TRACELOG();
  UNLOCK_TRACELOG();
#endif
#endif
  return rv;
  return rv;
}
}
void
NS_COM void
nsTraceRefcntImpl::ResetStatistics()
nsTraceRefcntImpl::ResetStatistics()
{
{
#ifdef NS_BUILD_REFCNT_LOGGING
#ifdef NS_BUILD_REFCNT_LOGGING
  LOCK_TRACELOG();
  LOCK_TRACELOG();
  if (gBloatView) {
  if (gBloatView) {
    PL_HashTableDestroy(gBloatView);
    PL_HashTableDestroy(gBloatView);
 Lines 847-869   static void InitTraceLog(void) Link Here 
}
}
#endif
#endif
#if defined(_WIN32) && defined(_M_IX86) // WIN32 x86 stack walking code
#if defined(_WIN32) && defined(_M_IX86) // WIN32 x86 stack walking code
#include "nsStackFrameWin.h"
#include "nsStackFrameWin.h"
void
NS_COM void
nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
{
{
  DumpStackToFile(aStream);
  DumpStackToFile(aStream);
}
}
// WIN32 x86 stack walking code
// WIN32 x86 stack walking code
// i386 or PPC Linux stackwalking code or Solaris
// 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"
#include "nsStackFrameUnix.h"
void
NS_COM void
nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
{
{
  DumpStackToFile(aStream);
  DumpStackToFile(aStream);
}
}
#elif defined(XP_MAC)
#elif defined(XP_MAC)
 Lines 957-969   nsTraceRefcntImpl::WalkTheStack(FILE* aS Link Here 
			break;
			break;
	}
	}
}
}
#else // unsupported platform.
#else // unsupported platform.
void
NS_COM void
nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
nsTraceRefcntImpl::WalkTheStack(FILE* aStream)
{
{
	fprintf(aStream, "write me, dammit!\n");
	fprintf(aStream, "write me, dammit!\n");
}
}
#endif
#endif