From: Nicholas Nethercote Date: Sat, 26 Mar 2005 00:32:29 +0000 (+0000) Subject: Use "VGA_" prefix more consistently. X-Git-Tag: svn/VALGRIND_3_0_0~884 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=66b2b7d5ad4c615305bf3c175cabc56531d47f73;p=thirdparty%2Fvalgrind.git Use "VGA_" prefix more consistently. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3434 --- diff --git a/coregrind/amd64/core_arch.h b/coregrind/amd64/core_arch.h index 681539012c..41816308b1 100644 --- a/coregrind/amd64/core_arch.h +++ b/coregrind/amd64/core_arch.h @@ -60,26 +60,26 @@ #define VGA_PTHREQ_RET guest_RDX // Register numbers, for vg_symtab2.c -#define R_STACK_PTR 4 -#define R_FRAME_PTR 5 +#define VGA_R_STACK_PTR 4 +#define VGA_R_FRAME_PTR 5 // Stack frame layout and linkage -#define FIRST_STACK_FRAME(rbp) (rbp) -#define STACK_FRAME_RET(rbp) (((UWord*)rbp)[1]) -#define STACK_FRAME_NEXT(rbp) (((UWord*)rbp)[0]) +#define VGA_FIRST_STACK_FRAME(rbp) (rbp) +#define VGA_STACK_FRAME_RET(rbp) (((UWord*)rbp)[1]) +#define VGA_STACK_FRAME_NEXT(rbp) (((UWord*)rbp)[0]) // Get stack pointer and frame pointer -#define ARCH_GET_REAL_STACK_PTR(lval) do { \ +#define VGA_GET_REAL_STACK_PTR(lval) do { \ asm("movq %%rsp, %0" : "=r" (lval)); \ } while (0) -#define ARCH_GET_REAL_FRAME_PTR(lval) do { \ +#define VGA_GET_REAL_FRAME_PTR(lval) do { \ asm("movq %%rbp, %0" : "=r" (lval)); \ } while (0) // On AMD64, it's ok to access up to 128 bytes below %rsp. // The signal handler needs to know this. -#define ARCH_STACK_REDZONE_SIZE 128 +#define VGA_STACK_REDZONE_SIZE 128 /* --------------------------------------------------------------------- Architecture-specific part of a ThreadState diff --git a/coregrind/arm/core_arch.h b/coregrind/arm/core_arch.h index 00d5dcfed6..dcddc98cfc 100644 --- a/coregrind/arm/core_arch.h +++ b/coregrind/arm/core_arch.h @@ -66,21 +66,21 @@ #define VGA_PTHREQ_RET guest_R0 // Register numbers, for vg_symtab2.c -#define R_STACK_PTR 13 -#define R_FRAME_PTR 11 +#define VGA_R_STACK_PTR 13 +#define VGA_R_FRAME_PTR 11 // Stack frame layout and linkage // XXX ToDo: ??? -#define FIRST_STACK_FRAME(ebp) (ebp) -#define STACK_FRAME_RET(ebp) (((UInt*)ebp)[1]) -#define STACK_FRAME_NEXT(ebp) (((UInt*)ebp)[0]) +#define VGA_FIRST_STACK_FRAME(ebp) (ebp) +#define VGA_STACK_FRAME_RET(ebp) (((UInt*)ebp)[1]) +#define VGA_STACK_FRAME_NEXT(ebp) (((UInt*)ebp)[0]) // Get stack pointer and frame pointer -#define ARCH_GET_REAL_STACK_PTR(esp) do { \ +#define VGA_GET_REAL_STACK_PTR(esp) do { \ I_die_here; \ } while (0) -#define ARCH_GET_REAL_FRAME_PTR(ebp) do { \ +#define VGA_GET_REAL_FRAME_PTR(ebp) do { \ I_die_here; \ } while (0) diff --git a/coregrind/arm/signals.c b/coregrind/arm/signals.c index 717a3845c0..206bbc3541 100644 --- a/coregrind/arm/signals.c +++ b/coregrind/arm/signals.c @@ -152,7 +152,7 @@ static void synth_ucontext(ThreadId tid, const vki_siginfo_t *si, #if 0 #define SET_SIGNAL_ESP(zztid, zzval) \ - SET_THREAD_REG(zztid, zzval, VGA_STACK_PTR, R_STACK_PTR, \ + SET_THREAD_REG(zztid, zzval, VGA_STACK_PTR, VGA_R_STACK_PTR, \ post_reg_write_deliver_signal) #endif diff --git a/coregrind/stacktrace.c b/coregrind/stacktrace.c index fb6c8dc5d9..c3784efd89 100644 --- a/coregrind/stacktrace.c +++ b/coregrind/stacktrace.c @@ -80,7 +80,7 @@ UInt VG_(get_StackTrace2) ( Addr* ips, UInt n_ips, Addr ip, Addr fp, } else { /* Get whatever we safely can ... */ ips[0] = ip; - fp = FIRST_STACK_FRAME(fp); + fp = VGA_FIRST_STACK_FRAME(fp); for (i = 1; i < n_ips; i++) { if (!(fp_min <= fp && fp <= fp_max)) { if (debug) @@ -92,8 +92,8 @@ UInt VG_(get_StackTrace2) ( Addr* ips, UInt n_ips, Addr ip, Addr fp, // VG_(printf)("nonmonotonic\n"); // break; /* fp gone nonmonotonic */ // } - ips[i] = STACK_FRAME_RET(fp); /* ret addr */ - fp = STACK_FRAME_NEXT(fp); /* old fp */ + ips[i] = VGA_STACK_FRAME_RET(fp); /* ret addr */ + fp = VGA_STACK_FRAME_NEXT(fp); /* old fp */ if (debug) VG_(printf)(" ips[%d]=%08p\n", i, ips[i]); } diff --git a/coregrind/vg_mylibc.c b/coregrind/vg_mylibc.c index 3f261fd81c..03fe1e6438 100644 --- a/coregrind/vg_mylibc.c +++ b/coregrind/vg_mylibc.c @@ -1137,8 +1137,8 @@ static inline void get_and_pp_real_StackTrace(Addr ret) ThreadId tid = VG_(get_lwp_tid)(VG_(gettid)()); ThreadState *tst = VG_(get_ThreadState)(tid); - ARCH_GET_REAL_STACK_PTR(sp); - ARCH_GET_REAL_FRAME_PTR(fp); + VGA_GET_REAL_STACK_PTR(sp); + VGA_GET_REAL_FRAME_PTR(fp); stacktop = (Addr)(tst->os_state.stack + tst->os_state.stacksize); diff --git a/coregrind/vg_redir.c b/coregrind/vg_redir.c index 79d1d55a59..5461202d22 100644 --- a/coregrind/vg_redir.c +++ b/coregrind/vg_redir.c @@ -533,14 +533,14 @@ void VG_(setup_code_redirect_table) ( void ) //:: /* Called from generated code via helper */ //:: void VG_(wrap_before)(ThreadState *tst, const FuncWrapper *wrapper) //:: { -//:: Addr retaddr = ARCH_RETADDR(tst->arch); -//:: Addr argp = (Addr)&ARCH_FUNC_ARG(tst->arch, 0); +//:: Addr retaddr = VGA_RETADDR(tst->arch); +//:: Addr argp = (Addr)&VGA_FUNC_ARG(tst->arch, 0); //:: void *nonce = NULL; //:: Bool mf = VG_(my_fault); //:: VG_(my_fault) = True; //:: //:: if (wrapper->before) { -//:: va_list args = ARCH_VA_LIST(tst->arch); +//:: va_list args = VGA_VA_LIST(tst->arch); //:: nonce = (*wrapper->before)(args); //:: } //:: diff --git a/coregrind/vg_signals.c b/coregrind/vg_signals.c index 3d1021072c..431c2b744e 100644 --- a/coregrind/vg_signals.c +++ b/coregrind/vg_signals.c @@ -1834,14 +1834,14 @@ void vg_sync_signalhandler ( Int sigNo, vki_siginfo_t *info, struct vki_ucontext VG_(shadow_base), VG_(shadow_end)); } if (info->si_code == 1 /* SEGV_MAPERR */ - && fault >= (esp - ARCH_STACK_REDZONE_SIZE) + && fault >= (esp - VGA_STACK_REDZONE_SIZE) && fault < VG_(client_end)) { /* If the fault address is above esp but below the current known stack segment base, and it was a fault because there was nothing mapped there (as opposed to a permissions fault), then extend the stack segment. */ - Addr base = PGROUNDDN(esp - ARCH_STACK_REDZONE_SIZE); + Addr base = PGROUNDDN(esp - VGA_STACK_REDZONE_SIZE); if (VG_(extend_stack)(base, VG_(threads)[tid].stack_size)) { if (VG_(clo_trace_signals)) VG_(message)(Vg_DebugMsg, diff --git a/coregrind/vg_symtab2.c b/coregrind/vg_symtab2.c index 179c582fda..e252ca311f 100644 --- a/coregrind/vg_symtab2.c +++ b/coregrind/vg_symtab2.c @@ -2139,7 +2139,7 @@ Variable *VG_(get_scope_variables)(ThreadId tid) case SyEBPrel: case SyESPrel: reg = *regaddr(tid, sym->kind == SyESPrel ? - R_STACK_PTR : R_FRAME_PTR); + VGA_R_STACK_PTR : VGA_R_FRAME_PTR); if (debug) VG_(printf)("reg=%p+%d=%p\n", reg, sym->u.offset, reg+sym->u.offset); v->valuep = (Addr)(reg + sym->u.offset); diff --git a/coregrind/x86/core_arch.h b/coregrind/x86/core_arch.h index 63a2f546f9..683c01ab2f 100644 --- a/coregrind/x86/core_arch.h +++ b/coregrind/x86/core_arch.h @@ -61,26 +61,26 @@ // Register numbers, for vg_symtab2.c -#define R_STACK_PTR 4 -#define R_FRAME_PTR 5 +#define VGA_R_STACK_PTR 4 +#define VGA_R_FRAME_PTR 5 // Stack frame layout and linkage -#define FIRST_STACK_FRAME(ebp) (ebp) -#define STACK_FRAME_RET(ebp) (((UInt*)ebp)[1]) -#define STACK_FRAME_NEXT(ebp) (((UInt*)ebp)[0]) +#define VGA_FIRST_STACK_FRAME(ebp) (ebp) +#define VGA_STACK_FRAME_RET(ebp) (((UInt*)ebp)[1]) +#define VGA_STACK_FRAME_NEXT(ebp) (((UInt*)ebp)[0]) // Get stack pointer and frame pointer -#define ARCH_GET_REAL_STACK_PTR(esp) do { \ +#define VGA_GET_REAL_STACK_PTR(esp) do { \ asm("movl %%esp, %0" : "=r" (esp)); \ } while (0) -#define ARCH_GET_REAL_FRAME_PTR(ebp) do { \ +#define VGA_GET_REAL_FRAME_PTR(ebp) do { \ asm("movl %%ebp, %0" : "=r" (ebp)); \ } while (0) // On X86, any access below %esp is illegal. // The signal handler needs to know this. -#define ARCH_STACK_REDZONE_SIZE 0 +#define VGA_STACK_REDZONE_SIZE 0 //extern const Char VG_(helper_wrapper_before)[]; /* in dispatch.S */ //extern const Char VG_(helper_wrapper_return)[]; /* in dispatch.S */ diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c index 3013aeb172..c9c0547934 100644 --- a/helgrind/hg_main.c +++ b/helgrind/hg_main.c @@ -2080,8 +2080,8 @@ UCodeBlock* TL_(instrument) ( UCodeBlock* cb_in, Addr not_used ) tl_assert(u_in->val2 < ntemps); stackref[u_in->val2] = (u_in->size == 4 && - (u_in->val1 == R_STACK_PTR || - u_in->val1 == R_FRAME_PTR)); + (u_in->val1 == VGA_R_STACK_PTR || + u_in->val1 == VGA_R_FRAME_PTR)); VG_(copy_UInstr)(cb, u_in); break;