]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Ripple from constifying parameters of instrumentation functions and
authorFlorian Krohm <florian@eich-krohm.de>
Wed, 24 Sep 2014 12:06:55 +0000 (12:06 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Wed, 24 Sep 2014 12:06:55 +0000 (12:06 +0000)
callbacks from VexTranslateArgs. See VEX r2958.

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

22 files changed:
cachegrind/cg_main.c
callgrind/main.c
coregrind/m_gdbserver/m_gdbserver.c
coregrind/m_tooliface.c
coregrind/m_translate.c
coregrind/pub_core_gdbserver.h
coregrind/pub_core_tooliface.h
drd/drd_load_store.c
drd/drd_load_store.h
exp-bbv/bbv_main.c
exp-dhat/dh_main.c
exp-sgcheck/h_main.c
exp-sgcheck/h_main.h
exp-sgcheck/sg_main.c
exp-sgcheck/sg_main.h
helgrind/hg_main.c
include/pub_tool_tooliface.h
lackey/lk_main.c
massif/ms_main.c
memcheck/mc_include.h
memcheck/mc_translate.c
none/nl_main.c

index 4bb465e9e0ba3afb75edd81d14aa490c0e1d78a5..9746b75806b3a3899d09d98ac51f27d585d2e109 100644 (file)
@@ -1048,9 +1048,9 @@ void addEvent_Bi ( CgState* cgs, InstrInfo* inode, IRAtom* whereTo )
 static
 IRSB* cg_instrument ( VgCallbackClosure* closure,
                       IRSB* sbIn, 
-                      VexGuestLayout* layout, 
-                      VexGuestExtents* vge,
-                      VexArchInfo* archinfo_host,
+                      const VexGuestLayout* layout, 
+                      const VexGuestExtents* vge,
+                      const VexArchInfo* archinfo_host,
                       IRType gWordTy, IRType hWordTy )
 {
    Int        i, isize;
index 5562c9edfb5cf33e98f678aa8d263203e3c337c8..86a93385dddf97f6a979daf1751ea09001b2ba3c 100644 (file)
@@ -950,10 +950,10 @@ void addBBSetupCall(ClgState* clgs)
 
 static
 IRSB* CLG_(instrument)( VgCallbackClosure* closure,
-                       IRSB* sbIn,
-                       VexGuestLayout* layout,
-                       VexGuestExtents* vge,
-                        VexArchInfo* archinfo_host,
+                        IRSB* sbIn,
+                       const VexGuestLayout* layout,
+                       const VexGuestExtents* vge,
+                        const VexArchInfo* archinfo_host,
                        IRType gWordTy, IRType hWordTy )
 {
    Int        i;
index 46bfbed19d5adfcf9b8cf3a690783a78f5e56804..3ce18606aaa011e77d6ea86c97a1eee5dcd551ff 100644 (file)
@@ -483,7 +483,7 @@ Bool VG_(is_watched)(PointKind kind, Addr addr, Int szB)
 }
 
 /* Returns the reason for which gdbserver instrumentation is needed */
-static VgVgdb VG_(gdbserver_instrumentation_needed) (VexGuestExtents* vge)
+static VgVgdb VG_(gdbserver_instrumentation_needed) (const VexGuestExtents* vge)
 {
    GS_Address* g;
    int e;
@@ -1088,8 +1088,8 @@ void VG_(helperc_invalidate_if_not_gdbserved) ( Addr addr )
 
 static void VG_(add_stmt_call_invalidate_if_not_gdbserved)
      ( IRSB* sb_in,
-       VexGuestLayout* layout, 
-       VexGuestExtents* vge,
+       const VexGuestLayout* layout, 
+       const VexGuestExtents* vge,
        IRTemp jmp, 
        IRSB* irsb)
 {
@@ -1126,8 +1126,8 @@ static void VG_(add_stmt_call_invalidate_if_not_gdbserved)
    debugger statement will be inserted for all instructions of a block. */
 static void VG_(add_stmt_call_gdbserver) 
      (IRSB* sb_in,                /* block being translated */
-      VexGuestLayout* layout, 
-      VexGuestExtents* vge,
+      const VexGuestLayout* layout, 
+      const VexGuestExtents* vge,
       IRType gWordTy, IRType hWordTy,
       Addr  iaddr,                /* Addr of instruction being instrumented */
       UChar delta,                /* delta to add to iaddr to obtain IP */
@@ -1201,8 +1201,8 @@ static void VG_(add_stmt_call_gdbserver)
    or VG_(add_stmt_call_invalidate_if_not_gdbserved).  */
 static void VG_(add_stmt_call_invalidate_exit_target_if_not_gdbserved)
    (IRSB* sb_in,
-    VexGuestLayout* layout,
-    VexGuestExtents* vge,
+    const VexGuestLayout* layout,
+    const VexGuestExtents* vge,
     IRType gWordTy,
     IRSB* irsb)
 {
@@ -1220,8 +1220,8 @@ static void VG_(add_stmt_call_invalidate_exit_target_if_not_gdbserved)
 
 IRSB* VG_(instrument_for_gdbserver_if_needed)
      (IRSB* sb_in,
-      VexGuestLayout* layout,
-      VexGuestExtents* vge,
+      const VexGuestLayout* layout,
+      const VexGuestExtents* vge,
       IRType gWordTy, IRType hWordTy)
 {
    IRSB* sb_out;
index d95462de7eb8fbada393c9cb7ad28e56f99e2da5..4b1c96eb29f5f8d443b805051afd80c6d59ae819 100644 (file)
@@ -41,8 +41,8 @@ VgToolInterface VG_(tdict);
 void VG_(basic_tool_funcs)(
    void(*post_clo_init)(void),
    IRSB*(*instrument)(VgCallbackClosure*, IRSB*, 
-                      VexGuestLayout*, VexGuestExtents*, VexArchInfo*,
-                      IRType, IRType),
+                      const VexGuestLayout*, const VexGuestExtents*,
+                      const VexArchInfo*, IRType, IRType),
    void(*fini)(Int)
 )
 {
index 322c31096f2c4a611d5aa721e3cbc07ac260dc67..72311bc787cf25228192713ed6d200f3e01d7797 100644 (file)
@@ -59,7 +59,7 @@
 
 #include "pub_core_execontext.h"  // VG_(make_depth_1_ExeContext_from_Addr)
 
-#include "pub_core_gdbserver.h"   // VG_(tool_instrument_then_gdbserver_if_needed)
+#include "pub_core_gdbserver.h"   // VG_(instrument_for_gdbserver_if_needed)
 
 #include "libvex_emnote.h"        // For PPC, EmWarn_PPC64_redir_underflow
 
@@ -219,10 +219,10 @@ static IRExpr* mk_ecu_Expr ( Addr64 guest_IP )
 */
 static
 IRSB* tool_instrument_then_gdbserver_if_needed ( VgCallbackClosure* closureV,
-                                                 IRSB*              sb_in, 
-                                                 VexGuestLayout*    layout, 
-                                                 VexGuestExtents*   vge,
-                                                 VexArchInfo*       vai,
+                                                 IRSB*              sb_in,
+                                                 const VexGuestLayout*  layout,
+                                                 const VexGuestExtents* vge,
+                                                 const VexArchInfo*     vai,
                                                  IRType             gWordTy, 
                                                  IRType             hWordTy )
 {
@@ -261,9 +261,9 @@ IRSB* tool_instrument_then_gdbserver_if_needed ( VgCallbackClosure* closureV,
 static
 IRSB* vg_SP_update_pass ( void*             closureV,
                           IRSB*             sb_in, 
-                          VexGuestLayout*   layout, 
-                          VexGuestExtents*  vge,
-                          VexArchInfo*      vai,
+                          const VexGuestLayout*   layout, 
+                          const VexGuestExtents*  vge,
+                          const VexArchInfo*      vai,
                           IRType            gWordTy, 
                           IRType            hWordTy )
 {
@@ -776,7 +776,7 @@ static Bool translations_allowable_from_seg ( NSegment const* seg, Addr addr )
    return convention. */
 
 static UInt needs_self_check ( void* closureV,
-                               VexGuestExtents* vge )
+                               const VexGuestExtents* vge )
 {
    VgCallbackClosure* closure = (VgCallbackClosure*)closureV;
    UInt i, bitset;
@@ -1622,16 +1622,16 @@ Bool VG_(translate) ( ThreadId tid,
         They are entirely legal but longwinded so as to maximise the
         chance of the C typechecker picking up any type snafus. */
      IRSB*(*f)(VgCallbackClosure*,
-               IRSB*,VexGuestLayout*,VexGuestExtents*, VexArchInfo*,
-               IRType,IRType)
+               IRSB*,const VexGuestLayout*,const VexGuestExtents*,
+               const VexArchInfo*,IRType,IRType)
         = VG_(clo_vgdb) != Vg_VgdbNo
              ? tool_instrument_then_gdbserver_if_needed
              : VG_(tdict).tool_instrument;
      IRSB*(*g)(void*,
-               IRSB*,VexGuestLayout*,VexGuestExtents*,VexArchInfo*,
-               IRType,IRType)
-       = (IRSB*(*)(void*,IRSB*,VexGuestLayout*,VexGuestExtents*,
-                   VexArchInfo*,IRType,IRType))f;
+               IRSB*,const VexGuestLayout*,const VexGuestExtents*,
+               const VexArchInfo*,IRType,IRType)
+       = (IRSB*(*)(void*,IRSB*,const VexGuestLayout*,
+                   const VexGuestExtents*, const VexArchInfo*,IRType,IRType))f;
      vta.instrument1     = g;
    }
    /* No need for type kludgery here. */
index de5b5dae730be80fd8c6a410a036c520546c38ac..5dd2d843805c0d5f9ecbc5e24bd32c1b3b88660f 100644 (file)
@@ -150,8 +150,8 @@ extern Bool VG_(client_monitor_command) (HChar* cmd);
    gdbserver. */
 extern IRSB* VG_(instrument_for_gdbserver_if_needed)
      (IRSB* sb_in,                   /* block to be instrumented */
-      VexGuestLayout* layout,
-      VexGuestExtents* vge,
+      const VexGuestLayout* layout,
+      const VexGuestExtents* vge,
       IRType gWordTy, IRType hWordTy);
 
 /* reason for which gdbserver connection must be finished */
index e9d3631164ee1ebea70a0113aad2b516a6b99536..65311d8468a6788d75c6065460b18d050ec164bd 100644 (file)
@@ -110,8 +110,8 @@ typedef struct {
    void  (*tool_post_clo_init)(void);
    IRSB* (*tool_instrument)   (VgCallbackClosure*,
                                IRSB*, 
-                               VexGuestLayout*, VexGuestExtents*, 
-                               VexArchInfo*, IRType, IRType);
+                               const VexGuestLayout*, const VexGuestExtents*, 
+                               const VexArchInfo*, IRType, IRType);
    void  (*tool_fini)         (Int);
 
    // VG_(needs).core_errors
index afb88e16fd20e3de68bdf5dcc1df92053fd5cc94..a7928d5571e76b67bf98b2e988f732da93327015 100644 (file)
@@ -590,9 +590,9 @@ static void instrument_store(IRSB* const bb, IRExpr* addr_expr,
 
 IRSB* DRD_(instrument)(VgCallbackClosure* const closure,
                        IRSB* const bb_in,
-                       VexGuestLayout* const layout,
-                       VexGuestExtents* const vge,
-                       VexArchInfo* archinfo_host,
+                       const VexGuestLayout* const layout,
+                       const VexGuestExtents* const vge,
+                       const VexArchInfo* archinfo_host,
                        IRType const gWordTy,
                        IRType const hWordTy)
 {
index 532a38cc5dbdbd41db326adf076b1ba0b04c6e21..ec8b4a5d1df25ea1b061bb113f0b6282b81cf6b0 100644 (file)
@@ -41,9 +41,9 @@ Bool DRD_(get_first_race_only)(void);
 void DRD_(set_first_race_only)(const Bool fro);
 IRSB* DRD_(instrument)(VgCallbackClosure* const closure,
                        IRSB* const bb_in,
-                       VexGuestLayout* const layout,
-                       VexGuestExtents* const vge,
-                       VexArchInfo* const archinfo_host,
+                       const VexGuestLayout* const layout,
+                       const VexGuestExtents* const vge,
+                       const VexArchInfo* const archinfo_host,
                        IRType const gWordTy,
                        IRType const hWordTy);
 void DRD_(trace_mem_access)(const Addr addr, const SizeT size,
index b133efa955f54bc4bd6bb44caeed9c9cd07fe56b..8926af46b4520d5db4939f30406d5914c47a6b3c 100644 (file)
@@ -345,10 +345,10 @@ static Int get_inst_type(Int len, Addr addr)
    /*    gWordTy = size of guest word    */
    /*    hWordTy = size of host word     */
 static IRSB* bbv_instrument ( VgCallbackClosure* closure,
-                             IRSB* sbIn, VexGuestLayout* layout,
-                             VexGuestExtents* vge,
-                             VexArchInfo* archinfo_host,
-                             IRType gWordTy, IRType hWordTy )
+                              IRSB* sbIn, const VexGuestLayout* layout,
+                              const VexGuestExtents* vge,
+                              const VexArchInfo* archinfo_host,
+                              IRType gWordTy, IRType hWordTy )
 {
    Int      i,n_instrs=1;
    IRSB     *sbOut;
index e18b395f48459116020148390a069c9057b3d6c0..78465ee0cda6b8166291b66d05f7a775e558a59c 100644 (file)
@@ -872,9 +872,9 @@ void addMemEvent(IRSB* sbOut, Bool isWrite, Int szB, IRExpr* addr,
 static
 IRSB* dh_instrument ( VgCallbackClosure* closure,
                       IRSB* sbIn,
-                      VexGuestLayout* layout,
-                      VexGuestExtents* vge,
-                      VexArchInfo* archinfo_host,
+                      const VexGuestLayout* layout,
+                      const VexGuestExtents* vge,
+                      const VexArchInfo* archinfo_host,
                       IRType gWordTy, IRType hWordTy )
 {
    Int   i, n = 0;
index ea0fed88cc2c3f5f332ab9da0bbddf38a883e4ab..ed1ac1dccafdb49555d27f44f5dc4a48eef28d85 100644 (file)
@@ -607,9 +607,9 @@ static IRTemp for_sg__newIRTemp_cb ( IRType ty, void* opaque )
 
 IRSB* h_instrument ( VgCallbackClosure* closure,
                      IRSB* sbIn,
-                     VexGuestLayout* layout,
-                     VexGuestExtents* vge,
-                     VexArchInfo* archinfo_host,
+                     const VexGuestLayout* layout,
+                     const VexGuestExtents* vge,
+                     const VexArchInfo* archinfo_host,
                      IRType gWordTy, IRType hWordTy )
 {
    Bool  verboze = 0||False;
index e41cc2edc172bf7552dda8247576c405f0c02423..b52af8c70f980a43295940ef0b306addd3642c2c 100644 (file)
@@ -70,9 +70,9 @@ SizeT h_replace_malloc_usable_size ( ThreadId tid, void* p );
 /* Note that this also does the sg_ instrumentation. */
 IRSB* h_instrument ( VgCallbackClosure* closure,
                      IRSB* sbIn,
-                     VexGuestLayout* layout,
-                     VexGuestExtents* vge,
-                     VexArchInfo* archinfo_host,
+                     const VexGuestLayout* layout,
+                     const VexGuestExtents* vge,
+                     const VexArchInfo* archinfo_host,
                      IRType gWordTy, IRType hWordTy );
 
 #endif
index c9037b046262bb91bf3708e09178382a2638c992..30743e6dca9d0dca89c645151d830f56ab628eb1 100644 (file)
@@ -2079,7 +2079,7 @@ struct _SGEnv {
 
 static IRTemp gen_Get_SP ( struct _SGEnv*  sge,
                            IRSB*           bbOut,
-                           VexGuestLayout* layout,
+                           const VexGuestLayout* layout,
                            Int             hWordTy_szB )
 {
    IRExpr* sp_expr;
@@ -2097,7 +2097,7 @@ static IRTemp gen_Get_SP ( struct _SGEnv*  sge,
 
 static IRTemp gen_Get_FP ( struct _SGEnv*  sge,
                            IRSB*           bbOut,
-                           VexGuestLayout* layout,
+                           const VexGuestLayout* layout,
                            Int             hWordTy_szB )
 {
    IRExpr* fp_expr;
@@ -2120,7 +2120,7 @@ static void instrument_mem_access ( struct _SGEnv* sge,
                                     Bool    isStore,
                                     Int     hWordTy_szB,
                                     Addr    curr_IP,
-                                    VexGuestLayout* layout )
+                                    const VexGuestLayout* layout )
 {
    IRType  tyAddr      = Ity_INVALID;
    XArray* frameBlocks = NULL;
@@ -2198,7 +2198,7 @@ void sg_instrument_fini ( struct _SGEnv * env )
 void sg_instrument_IRStmt ( /*MOD*/struct _SGEnv * env, 
                             /*MOD*/IRSB* sbOut,
                             IRStmt* st,
-                            VexGuestLayout* layout,
+                            const VexGuestLayout* layout,
                             IRType gWordTy, IRType hWordTy )
 {
    if (!sg_clo_enable_sg_checks)
@@ -2333,7 +2333,7 @@ void sg_instrument_final_jump ( /*MOD*/struct _SGEnv * env,
                                 /*MOD*/IRSB* sbOut,
                                 IRExpr* next,
                                 IRJumpKind jumpkind,
-                                VexGuestLayout* layout,
+                                const VexGuestLayout* layout,
                                 IRType gWordTy, IRType hWordTy )
 {
    if (!sg_clo_enable_sg_checks)
index 36034de055a28a70aeee2ab499144b83518c78c6..007c63b649645184d11808d5608016d07ecb713b 100644 (file)
@@ -62,14 +62,14 @@ void sg_instrument_fini ( struct _SGEnv * env );
 void sg_instrument_IRStmt ( /*MOD*/struct _SGEnv * env, 
                             /*MOD*/IRSB* sbOut,
                             IRStmt* st,
-                            VexGuestLayout* layout,
+                            const VexGuestLayout* layout,
                             IRType gWordTy, IRType hWordTy );
 
 void sg_instrument_final_jump ( /*MOD*/struct _SGEnv * env, 
                                 /*MOD*/IRSB* sbOut,
                                 IRExpr* next,
                                 IRJumpKind jumpkind,
-                                VexGuestLayout* layout,
+                                const VexGuestLayout* layout,
                                 IRType gWordTy, IRType hWordTy );
 #endif
 
index 673e41380d2a122cba58c4e09c9f9dd010331b85..d346fb9f53607ed1cbc9bcecff213c4cd678200d 100644 (file)
@@ -4478,9 +4478,9 @@ static Bool is_in_dynamic_linker_shared_object( Addr64 ga )
 static
 IRSB* hg_instrument ( VgCallbackClosure* closure,
                       IRSB* bbIn,
-                      VexGuestLayout* layout,
-                      VexGuestExtents* vge,
-                      VexArchInfo* archinfo_host,
+                      const VexGuestLayout* layout,
+                      const VexGuestExtents* vge,
+                      const VexArchInfo* archinfo_host,
                       IRType gWordTy, IRType hWordTy )
 {
    Int     i;
index 434f5e27ce9bf7e12ea12f3eb84780bbbf11a274..4349c1bb7a31814958eb8b767133451789f286d6 100644 (file)
@@ -218,9 +218,9 @@ extern void VG_(basic_tool_funcs)(
    */
    IRSB*(*instrument)(VgCallbackClosure* closure, 
                       IRSB*              sb_in, 
-                      VexGuestLayout*    layout, 
-                      VexGuestExtents*   vge, 
-                      VexArchInfo*       archinfo_host,
+                      const VexGuestLayout*  layout, 
+                      const VexGuestExtents* vge, 
+                      const VexArchInfo*     archinfo_host,
                       IRType             gWordTy, 
                       IRType             hWordTy),
 
index bfa2fd8db8ab8ba95a41088edf8a976871ed36d6..f76998f8e959d5f0d988162f7e98b975ef794afb 100644 (file)
@@ -652,9 +652,9 @@ static void lk_post_clo_init(void)
 static
 IRSB* lk_instrument ( VgCallbackClosure* closure,
                       IRSB* sbIn, 
-                      VexGuestLayout* layout, 
-                      VexGuestExtents* vge,
-                      VexArchInfo* archinfo_host,
+                      const VexGuestLayout* layout, 
+                      const VexGuestExtents* vge,
+                      const VexArchInfo* archinfo_host,
                       IRType gWordTy, IRType hWordTy )
 {
    IRDirty*   di;
index 9f33546c4e858588f8ea0711d2125138c63d9c83..7d78b5f092087f13d606b50d830e0f8408177422 100644 (file)
@@ -2087,9 +2087,9 @@ static IRSB* ms_instrument2( IRSB* sbIn )
 static
 IRSB* ms_instrument ( VgCallbackClosure* closure,
                       IRSB* sbIn,
-                      VexGuestLayout* layout,
-                      VexGuestExtents* vge,
-                      VexArchInfo* archinfo_host,
+                      const VexGuestLayout* layout,
+                      const VexGuestExtents* vge,
+                      const VexArchInfo* archinfo_host,
                       IRType gWordTy, IRType hWordTy )
 {
    if (! have_started_executing_code) {
index 258d3c6665630d782c97badd82af08c13ff9241f..39e03824a07f8e68a3f4e9077a8aa9e1484eb31f 100644 (file)
@@ -657,9 +657,9 @@ VG_REGPARM(1) UWord MC_(helperc_b_load32)( Addr a );
 /* Functions defined in mc_translate.c */
 IRSB* MC_(instrument) ( VgCallbackClosure* closure,
                         IRSB* bb_in, 
-                        VexGuestLayout* layout, 
-                        VexGuestExtents* vge,
-                        VexArchInfo* archinfo_host,
+                        const VexGuestLayout* layout, 
+                        const VexGuestExtents* vge,
+                        const VexArchInfo* archinfo_host,
                         IRType gWordTy, IRType hWordTy );
 
 IRSB* MC_(final_tidy) ( IRSB* );
index 5efa5ade1328f4afc9057b61c8ec907c33e92883..1f7402dd6c22e158022c2fdc8ad8ef68b25c3fa0 100644 (file)
@@ -210,7 +210,7 @@ typedef
 
       /* READONLY: the guest layout.  This indicates which parts of
          the guest state should be regarded as 'always defined'. */
-      VexGuestLayout* layout;
+      const VexGuestLayout* layout;
 
       /* READONLY: the host word type.  Needed for constructing
          arguments of type 'HWord' to be passed to helper functions.
@@ -6197,9 +6197,9 @@ static Bool checkForBogusLiterals ( /*FLAT*/ IRStmt* st )
 
 IRSB* MC_(instrument) ( VgCallbackClosure* closure,
                         IRSB* sb_in, 
-                        VexGuestLayout* layout, 
-                        VexGuestExtents* vge,
-                        VexArchInfo* archinfo_host,
+                        const VexGuestLayout* layout, 
+                        const VexGuestExtents* vge,
+                        const VexArchInfo* archinfo_host,
                         IRType gWordTy, IRType hWordTy )
 {
    Bool    verboze = 0||False;
index c56b9b32f3632919aca731d3b883455e7721e730..574486a0e1a7ef67f497b1924d4e2af269379648 100644 (file)
@@ -38,9 +38,9 @@ static void nl_post_clo_init(void)
 static
 IRSB* nl_instrument ( VgCallbackClosure* closure,
                       IRSB* bb,
-                      VexGuestLayout* layout, 
-                      VexGuestExtents* vge,
-                      VexArchInfo* archinfo_host,
+                      const VexGuestLayout* layout, 
+                      const VexGuestExtents* vge,
+                      const VexArchInfo* archinfo_host,
                       IRType gWordTy, IRType hWordTy )
 {
     return bb;