From cc3168bbf27c9d6df0e4d330ea920ab109c423e7 Mon Sep 17 00:00:00 2001 From: Dave Grijalva Date: Tue, 13 Apr 2021 17:28:27 -0700 Subject: [PATCH] add 'android' specific trap handlers. no idea if this works --- lib/vm/src/trap/traphandlers.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/vm/src/trap/traphandlers.rs b/lib/vm/src/trap/traphandlers.rs index 143829905e4..a34d32e65ac 100644 --- a/lib/vm/src/trap/traphandlers.rs +++ b/lib/vm/src/trap/traphandlers.rs @@ -210,9 +210,15 @@ cfg_if::cfg_if! { } else if #[cfg(all(target_os = "linux", target_arch = "x86"))] { let cx = &*(cx as *const libc::ucontext_t); cx.uc_mcontext.gregs[libc::REG_EIP as usize] as *const u8 + } else if #[cfg(all(target_os = "android", target_arch = "x86"))] { + let cx = &*(cx as *const libc::ucontext_t); + cx.uc_mcontext.gregs[libc::REG_EIP as usize] as *const u8 } else if #[cfg(all(target_os = "linux", target_arch = "aarch64"))] { let cx = &*(cx as *const libc::ucontext_t); cx.uc_mcontext.pc as *const u8 + } else if #[cfg(all(target_os = "android", target_arch = "aarch64"))] { + let cx = &*(cx as *const libc::ucontext_t); + cx.uc_mcontext.pc as *const u8 } else if #[cfg(all(target_os = "macos", target_arch = "x86_64"))] { let cx = &*(cx as *const libc::ucontext_t); (*cx.uc_mcontext).__ss.__rip as *const u8