mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-14 05:44:20 +00:00
Enable Linux stack walking code on Mac OS X. b=336517 r+a=bsmedberg
This commit is contained in:
parent
fa4a85978d
commit
76b6bdeaea
@ -1032,7 +1032,7 @@ NS_FormatCodeAddressDetails(void *aPC, const nsCodeAddressDetails *aDetails,
|
|||||||
|
|
||||||
// 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(__GNUC__) && (defined(__i386) || defined(PPC) || defined(__x86_64__))) || (defined(__sun) && (defined(__sparc) || defined(sparc) || defined(__i386) || defined(i386)))
|
#elif (defined(linux) && defined(__GNUC__) && (defined(__i386) || defined(PPC) || defined(__x86_64__))) || (defined(__sun) && (defined(__sparc) || defined(sparc) || defined(__i386) || defined(i386))) || (defined(XP_MACOSX) && (defined(__ppc__) || defined(__i386)))
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -1049,7 +1049,7 @@ NS_FormatCodeAddressDetails(void *aPC, const nsCodeAddressDetails *aDetails,
|
|||||||
#define __USE_GNU
|
#define __USE_GNU
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LIBDL
|
#if defined(HAVE_LIBDL) || defined(XP_MACOSX)
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1081,7 +1081,7 @@ void DemangleSymbol(const char * aSymbol,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(linux) && defined(__GNUC__) && (defined(__i386) || defined(PPC) || defined(__x86_64__)) // i386 or PPC Linux stackwalking code
|
#if (defined(linux) && defined(__GNUC__) && (defined(__i386) || defined(PPC) || defined(__x86_64__))) || (defined(XP_MACOSX) && (defined(__i386) || defined(__ppc__))) // i386 or PPC Linux stackwalking code
|
||||||
|
|
||||||
|
|
||||||
EXPORT_XPCOM_API(nsresult)
|
EXPORT_XPCOM_API(nsresult)
|
||||||
@ -1105,7 +1105,11 @@ NS_StackWalk(NS_WalkStackCallback aCallback, PRUint32 aSkipFrames,
|
|||||||
|
|
||||||
int skip = aSkipFrames;
|
int skip = aSkipFrames;
|
||||||
for ( ; (void**)*bp > bp; bp = (void**)*bp) {
|
for ( ; (void**)*bp > bp; bp = (void**)*bp) {
|
||||||
|
#if defined(__ppc__) && defined(XP_MACOSX) // other PPC platforms?
|
||||||
|
void *pc = *(bp+2);
|
||||||
|
#else
|
||||||
void *pc = *(bp+1);
|
void *pc = *(bp+1);
|
||||||
|
#endif
|
||||||
if (--skip < 0) {
|
if (--skip < 0) {
|
||||||
(*aCallback)(pc, aClosure);
|
(*aCallback)(pc, aClosure);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user