]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Track Vex API change in rev 1062: pass both the guest and host word
authorJulian Seward <jseward@acm.org>
Mon, 21 Mar 2005 00:55:49 +0000 (00:55 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 21 Mar 2005 00:55:49 +0000 (00:55 +0000)
sizes to the instrumentatation functions.  Make most of the tools
abort if they are not the same; we can't handle that case yet.

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

addrcheck/ac_main.c
cachegrind/cg_main.c
corecheck/cc_main.c
coregrind/toolfuncs.def
lackey/lk_main.c
massif/ms_main.c
memcheck/mc_translate.c
none/nl_main.c

index e93981aad8e0fbeaa6648a2923fdf5781eeef5d1..bcb937a594439cd69f4eac63f10e87c0266b2bd5 100644 (file)
@@ -986,7 +986,8 @@ void ac_fpu_ACCESS_check_SLOWLY ( Addr addr, SizeT size, Bool isWrite )
 /*--- Our instrumenter                                     ---*/
 /*------------------------------------------------------------*/
 
-IRBB* TL_(instrument)(IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy )
+IRBB* TL_(instrument)(IRBB* bb_in, VexGuestLayout* layout, 
+                      IRType gWordTy, IRType hWordTy )
 {
    Int         i, hsz;
    IRStmt*     st;
@@ -995,9 +996,15 @@ IRBB* TL_(instrument)(IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy )
    IRExpr*     guard;
    IRDirty*    di;
    Bool        isLoad;
+   IRBB*       bb;
+
+   if (gWordTy != hWordTy) {
+      /* We don't currently support this case. */
+      VG_(tool_panic)("host/guest word size mismatch");
+   }
 
    /* Set up BB */
-   IRBB* bb     = emptyIRBB();
+   bb           = emptyIRBB();
    bb->tyenv    = dopyIRTypeEnv(bb_in->tyenv);
    bb->next     = dopyIRExpr(bb_in->next);
    bb->jumpkind = bb_in->jumpkind;
index d6e18ee2e44f657380a45a62144c9ef08acd57d5..40fd86c3c523ba00ee4bf4d0217397d0a77d3d68 100644 (file)
@@ -559,7 +559,8 @@ void endOfInstr(IRBB* bbOut, instr_info* i_node, Bool bbSeenBefore,
    addStmtToIRBB( bbOut, IRStmt_Dirty(di) );
 }
 
-IRBB* TL_(instrument) ( IRBB* bbIn, VexGuestLayout* layout, IRType hWordTy )
+IRBB* TL_(instrument) ( IRBB* bbIn, VexGuestLayout* layout, 
+                        IRType gWordTy, IRType hWordTy )
 {
    Int      i, dataSize = 0, bbInfo_i;
    IRBB*    bbOut;
@@ -570,6 +571,11 @@ IRBB* TL_(instrument) ( IRBB* bbIn, VexGuestLayout* layout, IRType hWordTy )
    UInt     instrLen;
    IRExpr  *loadAddrExpr, *storeAddrExpr;
 
+   if (gWordTy != hWordTy) {
+      /* We don't currently support this case. */
+      VG_(tool_panic)("host/guest word size mismatch");
+   }
+
    /* Set up BB */
    bbOut           = emptyIRBB();
    bbOut->tyenv    = dopyIRTypeEnv(bbIn->tyenv);
index 26015708740515b22955ed89d6406067c5eaaa17..0d815120ba02246fa8bb03b5419bfd5d8034e46d 100644 (file)
@@ -51,7 +51,8 @@ void TL_(post_clo_init)(void)
 {
 }
 
-IRBB* TL_(instrument)(IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy )
+IRBB* TL_(instrument)(IRBB* bb_in, VexGuestLayout* layout, 
+                      IRType gWordTy, IRType hWordTy )
 {
     return bb_in;
 }
index 1806c3bcb5da82f0c99867bf14810ff14b74f422..4fa66dec56da0089af307508b82f43d3236f6563 100644 (file)
@@ -26,7 +26,7 @@ void,         post_clo_init
 ## Instrument a basic block.  Must be a true function, ie. the same input
 ## always results in the same output, because basic blocks can be
 ## retranslated.  Unless you're doing something really strange...
-IRBB*,  instrument,  IRBB* bb,  VexGuestLayout* layout,  IRType hWordTy
+IRBB*, instrument, IRBB* bb, VexGuestLayout* layout, IRType gWordTy, IRType hWordTy
 
 ## Finish up, print out any results, etc.  `exitcode' is program's exit
 ## code.  The shadow can be found with VG_(get_exit_status_shadow)().
index ef05d90c6ca8f2b52531a72bef36351d916c42a8..55fdc7e1c944d99cd5dbfa639e9f69513598ccb2 100644 (file)
@@ -129,13 +129,20 @@ void TL_(post_clo_init)(void)
    Which gives us the right answer.  And just to avoid two C calls, we fold
    the basic-block-beginning call in with add_one_BB().  Phew.
 */ 
-IRBB* TL_(instrument)(IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy )
+IRBB* TL_(instrument)(IRBB* bb_in, VexGuestLayout* layout, 
+                      IRType gWordTy, IRType hWordTy )
 {
    IRDirty* di;
    Int      i;
+   IRBB*    bb;
+
+   if (gWordTy != hWordTy) {
+      /* We don't currently support this case. */
+      VG_(tool_panic)("host/guest word size mismatch");
+   }
 
    /* Set up BB */
-   IRBB* bb     = emptyIRBB();
+   bb           = emptyIRBB();
    bb->tyenv    = dopyIRTypeEnv(bb_in->tyenv);
    bb->next     = dopyIRExpr(bb_in->next);
    bb->jumpkind = bb_in->jumpkind;
index 9ce0407df64511de1ce34ca6ba8994fc4881637f..1576b5fe6e1fb2d4539807bcb31a75aa75c3aa3d 100644 (file)
@@ -1210,8 +1210,10 @@ void TL_(post_clo_init)(void)
 /*--- Instrumentation                                      ---*/
 /*------------------------------------------------------------*/
 
-IRBB* TL_(instrument) ( IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy )
+IRBB* TL_(instrument) ( IRBB* bb_in, VexGuestLayout* layout, 
+                        IRType gWordTy, IRType hWordTy )
 {
+   /* XXX Will Massif work when gWordTy != hWordTy ? */
    return bb_in;
 }
 
index 5dc79be613dcc2e88789473a7839fc5318dc53da..f6f984b03173cf9a2068086d3f30e0b516e45443 100644 (file)
@@ -2383,16 +2383,23 @@ static Bool checkForBogusLiterals ( /*FLAT*/ IRStmt* st )
 }
 
 
-IRBB* TL_(instrument) ( IRBB* bb_in, VexGuestLayout* layout, IRType hWordTy )
+IRBB* TL_(instrument) ( IRBB* bb_in, VexGuestLayout* layout, 
+                        IRType gWordTy, IRType hWordTy )
 {
    Bool verboze = False; //True; 
 
    Int     i, j, first_stmt;
    IRStmt* st;
    MCEnv   mce;
+   IRBB*   bb;
+
+   if (gWordTy != hWordTy) {
+      /* We don't currently support this case. */
+      VG_(tool_panic)("host/guest word size mismatch");
+   }
 
    /* Set up BB */
-   IRBB* bb     = emptyIRBB();
+   bb           = emptyIRBB();
    bb->tyenv    = dopyIRTypeEnv(bb_in->tyenv);
    bb->next     = dopyIRExpr(bb_in->next);
    bb->jumpkind = bb_in->jumpkind;
index c2fcb584f867264715471170c04a0380ebd6f0e5..2f136c2c6c7ff6bf7dfc5b565b9a10011e9f27be 100644 (file)
@@ -46,7 +46,8 @@ void TL_(post_clo_init)(void)
 {
 }
 
-IRBB* TL_(instrument)(IRBB* bb, VexGuestLayout* layout, IRType hWordTy)
+IRBB* TL_(instrument)(IRBB* bb, VexGuestLayout* layout, 
+                      IRType gWordTy, IRType hWordTy)
 {
     return bb;
 }