From e65bcc8d4301d7dbab898c1c86b7216b12712dcd Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 22 Mar 2005 04:02:43 +0000 Subject: [PATCH] make function names more uniform git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3406 --- coregrind/vg_main.c | 4 ++-- coregrind/vg_symtab2.c | 4 ++-- coregrind/vg_symtypes.c | 2 +- helgrind/hg_main.c | 4 ++-- include/tool.h.base | 11 +++-------- memcheck/mac_needs.c | 5 +---- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c index dccdc5775..c924cbf4a 100644 --- a/coregrind/vg_main.c +++ b/coregrind/vg_main.c @@ -324,12 +324,12 @@ void VG_(unimplemented) ( Char* msg ) } /* Get the simulated stack pointer */ -Addr VG_(get_stack_pointer) ( ThreadId tid ) +Addr VG_(get_SP) ( ThreadId tid ) { return STACK_PTR( VG_(threads)[tid].arch ); } -Addr VG_(get_EIP) ( ThreadId tid ) +Addr VG_(get_IP) ( ThreadId tid ) { return INSTR_PTR( VG_(threads)[tid].arch ); } diff --git a/coregrind/vg_symtab2.c b/coregrind/vg_symtab2.c index 54e9ebdae..9cb2a123a 100644 --- a/coregrind/vg_symtab2.c +++ b/coregrind/vg_symtab2.c @@ -2046,7 +2046,7 @@ static UInt *regaddr(ThreadId tid, Int regno) if (ret == 0) { Char file[100]; Int line; - Addr eip = VG_(get_EIP)(tid); + Addr eip = VG_(get_IP)(tid); if (!VG_(get_filename_linenum)(eip, file, sizeof(file), &line)) file[0] = 0; @@ -2073,7 +2073,7 @@ Variable *VG_(get_scope_variables)(ThreadId tid) list = end = NULL; - eip = VG_(get_EIP)(tid); + eip = VG_(get_IP)(tid); search_all_scopetabs(eip, &si, &scopeidx); diff --git a/coregrind/vg_symtypes.c b/coregrind/vg_symtypes.c index 26a2e0a55..4f4b7648e 100644 --- a/coregrind/vg_symtypes.c +++ b/coregrind/vg_symtypes.c @@ -712,7 +712,7 @@ Char *VG_(describe_addr)(ThreadId tid, Addr addr) found = NULL; keeplist = NULL; - eip = VG_(get_EIP)(tid); + eip = VG_(get_IP)(tid); list = VG_(get_scope_variables)(tid); if (memaccount) { diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c index 8d87e4ff5..bf9a9d479 100644 --- a/helgrind/hg_main.c +++ b/helgrind/hg_main.c @@ -3033,7 +3033,7 @@ static void eraser_mem_read_word(Addr a, ThreadId tid) EC_IP ecip; if (clo_execontext == EC_Some) - ecip = IP(VG_(get_EIP)(tid), prevstate, tls); + ecip = IP(VG_(get_IP)(tid), prevstate, tls); else ecip = EC(VG_(get_ExeContext)(tid), prevstate, tls); setExeContext(a, ecip); @@ -3138,7 +3138,7 @@ static void eraser_mem_write_word(Addr a, ThreadId tid) EC_IP ecip; if (clo_execontext == EC_Some) - ecip = IP(VG_(get_EIP)(tid), prevstate, tls); + ecip = IP(VG_(get_IP)(tid), prevstate, tls); else ecip = EC(VG_(get_ExeContext)(tid), prevstate, tls); setExeContext(a, ecip); diff --git a/include/tool.h.base b/include/tool.h.base index ef7779fdf..2ef0f8e3e 100644 --- a/include/tool.h.base +++ b/include/tool.h.base @@ -296,8 +296,9 @@ extern ThreadId VG_(first_matching_thread_stack) ( Bool (*p) ( Addr stack_min, Addr stack_max, void* d ), void* d ); -/* Get the simulated %esp */ -extern Addr VG_(get_stack_pointer) ( ThreadId tid ); +/* Get parts of the client's state. */ +extern Addr VG_(get_SP) ( ThreadId tid ); +extern Addr VG_(get_IP) ( ThreadId tid ); /*====================================================================*/ @@ -610,12 +611,6 @@ extern ExeContext* VG_(get_ExeContext) ( ThreadId tid ); extern void VG_(apply_ExeContext)( void(*action)(UInt n, Addr ip), ExeContext* ec, UInt n_ips ); -/* Just grab the client's IP, as a much smaller and cheaper - indication of where they are. Use is basically same as for - VG_(get_ExeContext)() above. -*/ -extern Addr VG_(get_EIP)( ThreadId tid ); - /* For tools needing more control over stack traces: walks the stack to get instruction pointers from the top stack frames for thread 'tid'. Maximum of 'n_ips' addresses put into 'ips'; 0 is the top of the stack, 1 is its diff --git a/memcheck/mac_needs.c b/memcheck/mac_needs.c index d00538883..8612a72ad 100644 --- a/memcheck/mac_needs.c +++ b/memcheck/mac_needs.c @@ -441,10 +441,7 @@ void MAC_(record_address_error) ( ThreadId tid, Addr a, Int size, MAC_Error err_extra; Bool just_below_esp; - just_below_esp = is_just_below_ESP( - VG_(get_stack_pointer)(tid), - a - ); + just_below_esp = is_just_below_ESP( VG_(get_SP)(tid), a ); /* If this is caused by an access immediately below %ESP, and the user asks nicely, we just ignore it. */