mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 11:58:55 +00:00
Bug 1658424 - add support for grabbing fp on arm64 macOS in DMD; r=mccr8
This code just cribs from the profiler's code and has not been tested. Differential Revision: https://phabricator.services.mozilla.com/D86647
This commit is contained in:
parent
eca436fc65
commit
92a3a92555
@ -653,10 +653,16 @@ static uint32_t gGCStackTraceTableWhenSizeExceeds = 4 * 1024;
|
||||
// FramePointerStackWalk() on Mac: Registers::SyncPopulate() for the frame
|
||||
// pointer, and GetStackTop() for the stack end.
|
||||
void** fp;
|
||||
# if defined(__x86_64__)
|
||||
asm(
|
||||
// Dereference %rbp to get previous %rbp
|
||||
"movq (%%rbp), %0\n\t"
|
||||
: "=r"(fp));
|
||||
# else
|
||||
asm(
|
||||
"ldr %0, [x29]\n\t"
|
||||
: "=r"(fp));
|
||||
# endif
|
||||
void* stackEnd = pthread_get_stackaddr_np(pthread_self());
|
||||
FramePointerStackWalk(StackWalkCallback, /* skipFrames = */ 0, MaxFrames,
|
||||
&tmp, fp, stackEnd);
|
||||
|
Loading…
x
Reference in New Issue
Block a user