]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Arch-abstraction:
authorNicholas Nethercote <n.nethercote@gmail.com>
Sat, 11 Sep 2004 15:11:47 +0000 (15:11 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Sat, 11 Sep 2004 15:11:47 +0000 (15:11 +0000)
- abstract out some direct naming of registers

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2694

coregrind/toolfuncs.def
coregrind/vg_memory.c
coregrind/vg_scheduler.c

index 8d49f37ce495b4e31a3c62ab5427b7417284209d..d2f4cfbcd199f51f8e8c6f45a78845ab707d8a8f 100644 (file)
@@ -28,8 +28,7 @@ UCodeBlock*,  instrument,     UCodeBlock* cb, Addr orig_addr
 
 ## Finish up, print out any results, etc.  `exitcode' is program's exit
 ## code.  The shadow (if the `shadow_regs' need is set) can be found with
-## VG_(get_shadow_archreg)(R_EBX), since %ebx holds the argument to the
-## exit() syscall.
+## VG_(get_exit_status_shadow)().
 void,  fini,   Int exitcode
 
 
index 995a697e2dd885ea5a3a9c69d0e1d8e6c0381ccf..0e1cd84be05c67067372dfc0ca7026483bcdb0dc 100644 (file)
@@ -677,10 +677,10 @@ Segment *VG_(next_segment)(Segment *s)
    tracked by the tool, and one of the specialised cases (eg. new_mem_stack_4)
    isn't used in preference */
 REGPARM(1)
-void VG_(unknown_esp_update)(Addr new_ESP)
+void VG_(unknown_esp_update)(Addr new_SP)
 {
-   Addr old_ESP = VG_(get_archreg)(R_ESP);
-   Int  delta   = (Int)new_ESP - (Int)old_ESP;
+   Addr old_SP = VG_(get_archreg)(R_STACK_PTR);
+   Int  delta  = (Int)new_SP - (Int)old_SP;
 
    if (delta < -(VG_HUGE_DELTA) || VG_HUGE_DELTA < delta) {
       /* %esp has changed by more than HUGE_DELTA.  We take this to mean
@@ -694,12 +694,12 @@ void VG_(unknown_esp_update)(Addr new_ESP)
          happening. */
       if (VG_(clo_verbosity) > 1)
            VG_(message)(Vg_UserMsg, "Warning: client switching stacks?  "
-                                    "%%esp: %p --> %p", old_ESP, new_ESP);
+                                    "%%esp: %p --> %p", old_SP, new_SP);
    } else if (delta < 0) {
-      VG_TRACK( new_mem_stack, new_ESP, -delta );
+      VG_TRACK( new_mem_stack, new_SP, -delta );
 
    } else if (delta > 0) {
-      VG_TRACK( die_mem_stack, old_ESP,  delta );
+      VG_TRACK( die_mem_stack, old_SP,  delta );
    }
 }
 
index cf4050c7b9340176400cad2a653cc0f1192bf60a..ab122eb040cf9561014279acdaa4ceb1f6ad82b6 100644 (file)
@@ -2799,12 +2799,12 @@ void do__get_stack_info ( ThreadId tid, ThreadId which, StackInfo* si )
 
 void VG_(set_return_from_syscall_shadow) ( ThreadId tid, UInt ret_shadow )
 {
-   VG_(set_thread_shadow_archreg)(tid, R_EAX, ret_shadow);
+   VG_(set_thread_shadow_archreg)(tid, R_SYSCALL_RET, ret_shadow);
 }
 
 UInt VG_(get_exit_status_shadow) ( void )
 {
-   return VG_(get_shadow_archreg)(R_EBX);
+   return VG_(get_shadow_archreg)(R_SYSCALL_ARG1);
 }
 
 void VG_(intercept_libc_freeres_wrapper)(Addr addr)