From: Nicholas Nethercote Date: Wed, 24 Nov 2004 16:57:16 +0000 (+0000) Subject: Removed shadow_regs 'need', because it was being used only trivially in X-Git-Tag: svn/VALGRIND_3_0_0~1222 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=efed8e4671cbe205fd1e12ddeb7a5d9a8b5126ef;p=thirdparty%2Fvalgrind.git Removed shadow_regs 'need', because it was being used only trivially in a couple of places, and is no longer needed. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3096 --- diff --git a/addrcheck/ac_main.c b/addrcheck/ac_main.c index 22d8169abe..739f183377 100644 --- a/addrcheck/ac_main.c +++ b/addrcheck/ac_main.c @@ -1318,7 +1318,7 @@ void TL_(pre_clo_init)(void) VG_(init_pre_mem_read) ( & ac_check_is_readable ); VG_(init_pre_mem_read_asciiz) ( & ac_check_is_readable_asciiz ); VG_(init_pre_mem_write) ( & ac_check_is_writable ); - VG_(init_post_mem_write) ( & ac_make_accessible ); + VG_(init_post_mem_write) ( & ac_post_mem_write ); VGP_(register_profile_event) ( VgpSetMem, "set-mem-perms" ); VGP_(register_profile_event) ( VgpCheckMem, "check-mem-perms" ); diff --git a/coregrind/core.h b/coregrind/core.h index 68095e67d0..84454620e0 100644 --- a/coregrind/core.h +++ b/coregrind/core.h @@ -388,7 +388,7 @@ typedef Bool core_errors; Bool tool_errors; Bool basic_block_discards; - Bool shadow_regs; + Bool no_longer_used_1; // for backwards compatibility Bool command_line_options; Bool client_requests; Bool no_longer_used_0; // for backwards compatibility diff --git a/coregrind/toolfuncs.def b/coregrind/toolfuncs.def index cf60f1c7c0..e30987cd56 100644 --- a/coregrind/toolfuncs.def +++ b/coregrind/toolfuncs.def @@ -26,8 +26,7 @@ void, post_clo_init IRBB*, instrument, IRBB* bb, VexGuestLayout* layout, IRType hWordTy ## 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_exit_status_shadow)(). +## code. The shadow can be found with VG_(get_exit_status_shadow)(). void, fini, Int exitcode @@ -93,12 +92,6 @@ void, print_extra_suppression_info, Error* err void, discard_basic_block_info, Addr a, SizeT size -## ------------------------------------------------------------------ -## VG_(needs).shadow_regs - -## No functions must be defined, but the post_reg[s]_write_* events should -## be tracked. - ## ------------------------------------------------------------------ ## VG_(needs).command_line_options @@ -210,9 +203,8 @@ void, pre_mem_write, CorePart part, ThreadId tid, Char* s, Addr a, SizeT siz void, post_mem_write, CorePart part, ThreadId tid, Addr a, SizeT size -## Register events -- if `shadow_regs' need is set, these should probably be -## used. Use VG_(set_shadow_state_area)() to set the shadow regs for these -## events. +## Register events. Use VG_(set_shadow_state_area)() to set the shadow regs +## for these events. void, pre_reg_read, CorePart part, ThreadId tid, Char* s, OffT guest_state_offset, SizeT size void, post_reg_write, CorePart part, ThreadId tid, OffT guest_state_offset, SizeT size diff --git a/coregrind/vg_needs.c b/coregrind/vg_needs.c index c62c5b573e..d0a6bb095b 100644 --- a/coregrind/vg_needs.c +++ b/coregrind/vg_needs.c @@ -51,7 +51,7 @@ VgNeeds VG_(needs) = { .tool_errors = False, .libc_freeres = False, .basic_block_discards = False, - .shadow_regs = False, + .no_longer_used_1 = False, .command_line_options = False, .client_requests = False, .no_longer_used_0 = False, @@ -102,15 +102,6 @@ void VG_(sanity_check_needs) ( void) VG_(tool_panic)("`die_mem_stack' should be defined\n"); } - if ( (VG_(defined_post_reg_write)() || - VG_(defined_post_reg_write_clientcall_return)()) && - ! VG_(needs).shadow_regs) - { - VG_(printf)("\nTool error: one of the `post_reg_write'\n" - "events tracked, but `shadow_regs' need not set.\n"); - VG_(tool_panic)("`shadow_regs' should be set\n"); - } - if (VG_(needs).shadow_memory != (VG_(get_shadow_size)() != 0)) { if (VG_(get_shadow_size)() != 0) VG_(printf)("\nTool error: tool allocated shadow memory, but apparently doesn't " @@ -155,7 +146,6 @@ NEEDS(libc_freeres) NEEDS(core_errors) NEEDS(tool_errors) NEEDS(basic_block_discards) -NEEDS(shadow_regs) NEEDS(command_line_options) NEEDS(client_requests) NEEDS(syscall_wrapper) diff --git a/coregrind/x86/signal.c b/coregrind/x86/signal.c index 3eed1c195b..6c49969114 100644 --- a/coregrind/x86/signal.c +++ b/coregrind/x86/signal.c @@ -223,9 +223,8 @@ void VGA_(push_signal_frame)(ThreadId tid, Addr esp_top_of_frame, frame->magicPI = 0x31415927; - frame->vex = tst->arch.vex; - if (VG_(needs).shadow_regs) - frame->vex_shadow = tst->arch.vex_shadow; + frame->vex = tst->arch.vex; + frame->vex_shadow = tst->arch.vex_shadow; frame->mask = tst->sig_mask; @@ -281,9 +280,8 @@ Int VGA_(pop_signal_frame)(ThreadId tid) VG_TRACK( die_mem_stack_signal, (Addr)frame, sizeof(VgSigFrame) ); /* restore machine state */ - tst->arch.vex = frame->vex; - if (VG_(needs).shadow_regs) - tst->arch.vex_shadow = frame->vex_shadow; + tst->arch.vex = frame->vex; + tst->arch.vex_shadow = frame->vex_shadow; /* And restore the thread's status to what it was before the signal was delivered. */ diff --git a/coregrind/x86/state.c b/coregrind/x86/state.c index 8cd8b0d6aa..1525dda3b7 100644 --- a/coregrind/x86/state.c +++ b/coregrind/x86/state.c @@ -78,10 +78,8 @@ void VGA_(init_thread1state) ( Addr client_eip, to the start of the .vex field. */ VGOFF_(m_eip) = offsetof(VexGuestX86State,guest_EIP)/4; - if (VG_(needs).shadow_regs) { - VG_TRACK( post_reg_write, Vg_CoreStartup, /*tid*/1, /*offset*/0, - sizeof(VexGuestArchState)); - } + VG_TRACK( post_reg_write, Vg_CoreStartup, /*tid*/1, /*offset*/0, + sizeof(VexGuestArchState)); /* I assume that if we have SSE2 we also have SSE */ VG_(have_ssestate) = False; diff --git a/include/tool.h.base b/include/tool.h.base index b59eb7e3c2..90500290d9 100644 --- a/include/tool.h.base +++ b/include/tool.h.base @@ -562,18 +562,6 @@ extern void VG_(cpuid) ( UInt eax, UInt *eax_ret, UInt *ebx_ret, UInt *ecx_ret, UInt *edx_ret ); - -/* ------------------------------------------------------------------ */ -/* Accessing archregs and their shadows */ - -// For get/set, 'area' is where the asked-for shadow state will be copied -// into/from. - -extern void VG_(get_shadow_regs_area) ( ThreadId tid, OffT guest_state_offset, - SizeT size, UChar* area ); -extern void VG_(set_shadow_regs_area) ( ThreadId tid, OffT guest_state_offset, - SizeT size, const UChar* area ); - /*====================================================================*/ /*=== Execution contexts ===*/ /*====================================================================*/ @@ -932,11 +920,17 @@ extern void VG_(SkipNode_Free) (const SkipList *l, void *p); extern void *VG_(SkipNode_First) (const SkipList *l); extern void *VG_(SkipNode_Next) (const SkipList *l, void *data); + /*====================================================================*/ /*=== Functions for shadow registers ===*/ /*====================================================================*/ -/* Nb: make sure the shadow_regs 'need' is set before using these! */ +// For get/set, 'area' is where the asked-for shadow state will be copied +// into/from. +extern void VG_(get_shadow_regs_area) ( ThreadId tid, OffT guest_state_offset, + SizeT size, UChar* area ); +extern void VG_(set_shadow_regs_area) ( ThreadId tid, OffT guest_state_offset, + SizeT size, const UChar* area ); /* This one lets you override the shadow of the return value register for a syscall. Call it from TL_(post_syscall)() (not TL_(pre_syscall)()!) to @@ -1055,9 +1049,6 @@ extern void VG_(needs_tool_errors) ( void ); to be used for more than one instruction in one program run... */ extern void VG_(needs_basic_block_discards) ( void ); -/* Tool maintains information about each register? */ -extern void VG_(needs_shadow_regs) ( void ); - /* Tool defines its own command line options? */ extern void VG_(needs_command_line_options) ( void ); diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index ea33950614..8c774a96ef 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -1815,7 +1815,6 @@ void TL_(pre_clo_init)(void) VG_(needs_core_errors) (); VG_(needs_tool_errors) (); VG_(needs_libc_freeres) (); - VG_(needs_shadow_regs) (); VG_(needs_command_line_options)(); VG_(needs_client_requests) (); VG_(needs_sanity_checks) ();