Skip to content

Commit b81d20d

Browse files
jameysharpsunfishcode
authored andcommitted
wasmtime: Collect stack pointer during traps
Nothing uses this yet but I want to get collection of this register right on our many supported platforms before introducing the changes that need it.
1 parent f138aaa commit b81d20d

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

crates/wasmtime/src/runtime/vm/sys/unix/signals.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ unsafe fn get_trap_registers(cx: *mut libc::c_void, _signum: libc::c_int) -> Tra
270270
TrapRegisters {
271271
pc: cx.uc_mcontext.gregs[libc::REG_RIP as usize] as usize,
272272
fp: cx.uc_mcontext.gregs[libc::REG_RBP as usize] as usize,
273+
sp: cx.uc_mcontext.gregs[libc::REG_RSP as usize] as usize,
273274
}
274275
} else if #[cfg(all(target_os = "linux", target_arch = "x86"))] {
275276
let cx = &*(cx as *const libc::ucontext_t);

crates/wasmtime/src/runtime/vm/traphandlers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub use traphandlers::SignalHandler;
3434
pub(crate) struct TrapRegisters {
3535
pub pc: usize,
3636
pub fp: usize,
37+
pub sp: usize,
3738
}
3839

3940
/// Return value from `test_if_trap`.

0 commit comments

Comments
 (0)