]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Removed shadow_regs 'need', because it was being used only trivially in
authorNicholas Nethercote <njn@valgrind.org>
Wed, 24 Nov 2004 16:57:16 +0000 (16:57 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Wed, 24 Nov 2004 16:57:16 +0000 (16:57 +0000)
a couple of places, and is no longer needed.

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

addrcheck/ac_main.c
coregrind/core.h
coregrind/toolfuncs.def
coregrind/vg_needs.c
coregrind/x86/signal.c
coregrind/x86/state.c
include/tool.h.base
memcheck/mc_main.c

index 22d8169abea32ef2d664bb04366632e325749397..739f183377b6f2daa5b0445e06f6e76f42022a18 100644 (file)
@@ -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" );
index 68095e67d018d899fba5c0216522851b5b0acb43..84454620e0e6ac9fc1336204b4e587c2cc5a6183 100644 (file)
@@ -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
index cf60f1c7c07449aee20a48e99170dc5d6ecb7e77..e30987cd5681ed9da8ce5d5b8e30be3182ecd5b5 100644 (file)
@@ -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
index c62c5b573e7e44c31e8cfcb76e70d18993063a11..d0a6bb095b98c865103ae82dc13cdeeecf131a9d 100644 (file)
@@ -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)
index 3eed1c195b59b5850cf90618fa4277f12aa27328..6c499691142888d4bfcdc528dcec8dfaf0a7f75a 100644 (file)
@@ -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. */
index 8cd8b0d6aa45d805951426088235811df7451536..1525dda3b783eb10798db2e0e7e5153a2eef30f2 100644 (file)
@@ -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;
index b59eb7e3c2d8cbe6e7142beb56519d63b56699f3..90500290d98b57b5cca0d5864904a937c1d397d0 100644 (file)
@@ -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 );
 
index ea339506144fabd9525535016bca1b3e1ed844c9..8c774a96efac2ab5789bf49f3ad67b175c32b744 100644 (file)
@@ -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)       ();