From 729ba418335916cfd866c95d60be5e60f292fb63 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 20 Jun 2019 13:14:25 -0300 Subject: [PATCH] Fix test for x86 --- test/sys/test_ptrace.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/sys/test_ptrace.rs b/test/sys/test_ptrace.rs index e86c75cb54..ece1f6027a 100644 --- a/test/sys/test_ptrace.rs +++ b/test/sys/test_ptrace.rs @@ -138,8 +138,12 @@ fn test_ptrace_syscall() { // set this option to recognize syscall-stops ptrace::setoptions(child, ptrace::Options::PTRACE_O_TRACESYSGOOD).unwrap(); + #[cfg(target_arch = "x86_64")] let get_syscall_id = || ptrace::getregs(child).unwrap().orig_rax as i64; + #[cfg(target_arch = "x86")] + let get_syscall_id = || ptrace::getregs(child).unwrap().orig_eax as i32; + // kill entry ptrace::syscall(child, None).unwrap(); assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceSyscall(child)));