Skip to content

Commit

Permalink
Change sc_pc to __pc for loongarch64
Browse files Browse the repository at this point in the history
Signed-off-by: Leslie Zhai <[email protected]>
  • Loading branch information
xiangzhai authored and Leslie Zhai committed Jul 25, 2023
1 parent 596cc5b commit 6edb2b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/backtrace/frame_pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl super::Trace for Trace {
let frame_pointer = unsafe { (*ucontext).uc_mcontext.__gregs[libc::REG_S0] as usize };

#[cfg(all(target_arch = "loongarch64", target_os = "linux"))]
let frame_pointer = unsafe { (*ucontext).uc_mcontext.sc_regs[22] as usize };
let frame_pointer = unsafe { (*ucontext).uc_mcontext.__gregs[22] as usize };

let mut frame_pointer = frame_pointer as *mut FramePointerLayout;

Expand Down
2 changes: 1 addition & 1 deletion src/profiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ extern "C" fn perf_signal_handler(
let addr = unsafe { (*ucontext).uc_mcontext.__gregs[libc::REG_PC] as usize };

#[cfg(all(target_arch = "loongarch64", target_os = "linux"))]
let addr = unsafe { (*ucontext).uc_mcontext.sc_pc as usize };
let addr = unsafe { (*ucontext).uc_mcontext.__pc as usize };

if profiler.is_blocklisted(addr) {
return;
Expand Down

0 comments on commit 6edb2b8

Please sign in to comment.