]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
API change: pass both the VexGuestExtents and the original
authorJulian Seward <jseward@acm.org>
Tue, 18 Oct 2005 12:01:48 +0000 (12:01 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 18 Oct 2005 12:01:48 +0000 (12:01 +0000)
pre-redirection guest address to instrumentation functions.

git-svn-id: svn://svn.valgrind.org/vex/trunk@1420

VEX/priv/main/vex_main.c
VEX/pub/libvex.h
VEX/test_main.c

index f1589c39e91d431c24c32dd207ea23f292dd2cc7..7c97e76227525a76957da48e22d57b66483edd78 100644 (file)
@@ -179,8 +179,13 @@ VexTranslateResult LibVEX_Translate (
    VexArch      arch_host,
    VexArchInfo* archinfo_host,
    /* IN: the block to translate, and its guest address. */
+   /* where are the actual bytes in the host's address space? */
    UChar*  guest_bytes,
+   /* where do the bytes came from in the guest's aspace? */
    Addr64  guest_bytes_addr,
+   /* what guest entry point address do they correspond to? */
+   Addr64  guest_bytes_addr_noredir,
+   /* Is it OK to chase into this guest address? */
    Bool    (*chase_into_ok) ( Addr64 ),
    /* OUT: which bits of guest code actually got translated */
    VexGuestExtents* guest_extents,
@@ -191,8 +196,10 @@ VexTranslateResult LibVEX_Translate (
    Int*    host_bytes_used,
    /* IN: optionally, two instrumentation functions. */
    IRBB*   (*instrument1) ( IRBB*, VexGuestLayout*, 
+                            Addr64, VexGuestExtents*, 
                             IRType gWordTy, IRType hWordTy ),
    IRBB*   (*instrument2) ( IRBB*, VexGuestLayout*, 
+                            Addr64, VexGuestExtents*,
                             IRType gWordTy, IRType hWordTy ),
    Bool    cleanup_after_instrumentation,
    /* IN: should this translation be self-checking? */
@@ -463,10 +470,12 @@ VexTranslateResult LibVEX_Translate (
    /* Get the thing instrumented. */
    if (instrument1)
       irbb = (*instrument1)(irbb, guest_layout, 
-                                  guest_word_type, host_word_type);
+                            guest_bytes_addr_noredir, guest_extents,
+                            guest_word_type, host_word_type);
    if (instrument2)
       irbb = (*instrument2)(irbb, guest_layout,
-                                  guest_word_type, host_word_type);
+                            guest_bytes_addr_noredir, guest_extents,
+                            guest_word_type, host_word_type);
       
    if (vex_traceflags & VEX_TRACE_INST) {
       vex_printf("\n------------------------" 
index 8bf068e5aea06312ce2d20ddab92ceab009347d0..e482737becab161be7672f0405e424c886a90397 100644 (file)
@@ -275,14 +275,20 @@ typedef
 
 extern 
 VexTranslateResult LibVEX_Translate (
+
    /* The instruction sets we are translating from and to. */
    VexArch      arch_guest,
    VexArchInfo* archinfo_guest,
    VexArch      arch_host,
    VexArchInfo* archinfo_host,
    /* IN: the block to translate, and its guest address. */
+   /* where are the actual bytes in the host's address space? */
    UChar*  guest_bytes,
+   /* where do the bytes came from in the guest's aspace? */
    Addr64  guest_bytes_addr,
+   /* what guest entry point address do they correspond to? */
+   Addr64  guest_bytes_addr_noredir,
+   /* Is it OK to chase into this guest address? */
    Bool    (*chase_into_ok) ( Addr64 ),
    /* OUT: which bits of guest code actually got translated */
    VexGuestExtents* guest_extents,
@@ -293,8 +299,10 @@ VexTranslateResult LibVEX_Translate (
    Int*    host_bytes_used,
    /* IN: optionally, two instrumentation functions. */
    IRBB*   (*instrument1) ( IRBB*, VexGuestLayout*, 
+                            Addr64, VexGuestExtents*,
                             IRType gWordTy, IRType hWordTy ),
    IRBB*   (*instrument2) ( IRBB*, VexGuestLayout*, 
+                            Addr64, VexGuestExtents*,
                             IRType gWordTy, IRType hWordTy ),
    Bool    cleanup_after_instrumentation,
    /* IN: should this translation be self-checking? */
index 1fa937da11a8f6cbb2395f54d88ae076154b7f29..0a9c067386ce695671726d541743fae70d741d51 100644 (file)
@@ -148,7 +148,8 @@ int main ( int argc, char** argv )
                  VexArchX86, &vai_x86, 
                  VexArchX86, &vai_x86, 
 #endif
-                 origbuf, (Addr64)orig_addr, chase_into_not_ok,
+                 origbuf, (Addr64)orig_addr, (Addr64)orig_addr,
+                 chase_into_not_ok,
                  &vge,
                  transbuf, N_TRANSBUF, &trans_used,
 #if 1 /* no instrumentation */