Fix frame pointer calculation for symbol frames under libunwind, #123
This commit is contained in:
parent
b2fe396d70
commit
4884c4e99b
@ -57,9 +57,16 @@ namespace detail {
|
|||||||
if(skip) {
|
if(skip) {
|
||||||
skip--;
|
skip--;
|
||||||
} else {
|
} else {
|
||||||
// pc is the instruction after the `call`, adjust back to the previous instruction
|
// thread and signal-safe
|
||||||
// just a cast, signal safe
|
if(unw_is_signal_frame(&cursor)) {
|
||||||
buffer[i] = to_frame_ptr(pc) - 1;
|
// pc is the instruction that caused the signal
|
||||||
|
// just a cast, thread and signal safe
|
||||||
|
buffer[i] = to_frame_ptr(pc);
|
||||||
|
} else {
|
||||||
|
// pc is the instruction after the `call`, adjust back to the previous instruction
|
||||||
|
// just a cast, thread and signal safe
|
||||||
|
buffer[i] = to_frame_ptr(pc) - 1;
|
||||||
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
// thread and signal-safe as long as the cursor is in the local address space, which it is
|
// thread and signal-safe as long as the cursor is in the local address space, which it is
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user