libc
libc copied to clipboard
The offset of mcontext_t inside the libc::ucontext_t struct is incorrect
Cpp code:
DEBUG("off: 0x%x\n", (size_t)(&((ucontext_t *) data)->uc_mcontext) - (size_t)data);
output:
off: 0xB0
Rust code:
let ucontext = data as *const libc::ucontext_t;
let start = ucontext as usize;
let uc_mcontext_ref = &(*ucontext).uc_mcontext;
let uc_mcontext_ptr = uc_mcontext_ref as *const _;
let end = uc_mcontext_ptr as usize;
log::info!("off:0x{:x}",end -star);
output:
off:0x30
build for target aarch64-linux-android
would you be able to produce a PR ?