Skip to content

Commit

Permalink
async-profiler#1041: Adjust SP of a caller frame obtained with __buil…
Browse files Browse the repository at this point in the history
…tin_frame_address
  • Loading branch information
apangin committed Nov 7, 2024
1 parent 0cd9726 commit 36168a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stackWalker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int StackWalker::walkFP(void* ucontext, const void** callchain, int max_depth, S
if (ucontext == NULL) {
pc = __builtin_return_address(0);
fp = (uintptr_t)__builtin_frame_address(1);
sp = (uintptr_t)__builtin_frame_address(0);
sp = (uintptr_t)__builtin_frame_address(0) + LINKED_FRAME_SIZE;
} else {
pc = (const void*)frame.pc();
fp = frame.fp();
Expand Down Expand Up @@ -112,7 +112,7 @@ int StackWalker::walkDwarf(void* ucontext, const void** callchain, int max_depth
if (ucontext == NULL) {
pc = __builtin_return_address(0);
fp = (uintptr_t)__builtin_frame_address(1);
sp = (uintptr_t)__builtin_frame_address(0);
sp = (uintptr_t)__builtin_frame_address(0) + LINKED_FRAME_SIZE;
} else {
pc = (const void*)frame.pc();
fp = frame.fp();
Expand Down Expand Up @@ -203,7 +203,7 @@ int StackWalker::walkVM(void* ucontext, ASGCT_CallFrame* frames, int max_depth)
if (ucontext == NULL) {
pc = __builtin_return_address(0);
fp = (uintptr_t)__builtin_frame_address(1);
sp = (uintptr_t)__builtin_frame_address(0);
sp = (uintptr_t)__builtin_frame_address(0) + LINKED_FRAME_SIZE;
} else {
pc = (const void*)frame.pc();
fp = frame.fp();
Expand Down

0 comments on commit 36168a1

Please sign in to comment.