]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ia64: make strace of ia32 processes work again
authorArun Sharma <arun.sharma@intel.com>
Mon, 20 Oct 2003 09:20:38 +0000 (02:20 -0700)
committerDavid Mosberger <davidm@tiger.hpl.hp.com>
Mon, 20 Oct 2003 09:20:38 +0000 (02:20 -0700)
Newer versions of strace manipulate the syscall arguments and to make this
work for ia32 processes, we need to reload the syscall args after
doing the syscall-trace callback.

arch/ia64/ia32/ia32_entry.S

index f0aa315d87986c06b6e13a833aef6744f69d272b..ff4976ebcdf71ba0e6f4ceee9e6ba3fc02e761c8 100644 (file)
@@ -142,6 +142,19 @@ GLOBAL_ENTRY(ia32_trace_syscall)
        ;;
        st8 [r2]=r3                             // initialize return code to -ENOSYS
        br.call.sptk.few rp=invoke_syscall_trace // give parent a chance to catch syscall args
+       // Need to reload arguments (they may be changed by the tracing process)
+       adds r2=IA64_PT_REGS_R9_OFFSET+16,sp    // r2 = &pt_regs.r9
+       adds r3=IA64_PT_REGS_R13_OFFSET+16,sp   // r3 = &pt_regs.r13
+       ;;
+       ld4 r33=[r2],8                          // r9 == ecx
+       ld4 r37=[r3],16                         // r13 == ebp
+       ;;
+       ld4 r34=[r2],8                          // r10 == edx
+       ld4 r36=[r3],8                          // r15 == edi
+       ;;
+       ld4 r32=[r2],8                          // r11 == ebx
+       ld4 r35=[r3],8                          // r14 == esi
+       ;;
 .ret2: br.call.sptk.few rp=b6                  // do the syscall
 .ia32_strace_check_retval:
        cmp.lt p6,p0=r8,r0                      // syscall failed?