|
From: Nicholas N. <nj...@ca...> - 2004-09-11 15:30:40
|
CVS commit by nethercote:
Arch-abstraction:
- abstract out some inline asm
M +2 -1 vg_mylibc.c 1.89
M +10 -0 x86/core_arch.h 1.7
--- valgrind/coregrind/vg_mylibc.c #1.88:1.89
@@ -1092,5 +1092,6 @@ static inline ExeContext *get_real_execo
Addr stacktop, sigstack_low, sigstack_high;
- asm("movl %%ebp, %0; movl %%esp, %1" : "=r" (ebp), "=r" (esp));
+ ARCH_GET_REAL_STACK_PTR(esp);
+ ARCH_GET_REAL_FRAME_PTR(ebp);
stacktop = VG_(valgrind_last);
VG_(get_sigstack_bounds)( &sigstack_low, &sigstack_high );
--- valgrind/coregrind/x86/core_arch.h #1.6:1.7
@@ -60,4 +60,14 @@
#define VGOFF_FRAME_PTR VGOFF_(m_ebp)
+// Get stack pointer and frame pointer
+#define ARCH_GET_REAL_STACK_PTR(esp) do { \
+ asm("movl %%esp, %0" : "=r" (esp)); \
+} while (0)
+
+#define ARCH_GET_REAL_FRAME_PTR(ebp) do { \
+ asm("movl %%ebp, %0" : "=r" (ebp)); \
+} while (0)
+
+
/* -----------------------------------------------------
Read-write parts of baseBlock.
|