API change: pass both the VexGuestExtents and the original
pre-redirection guest address to instrumentation functions.
git-svn-id: svn://svn.valgrind.org/vex/trunk@1420 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/priv/main/vex_main.c b/priv/main/vex_main.c
index f1589c3..7c97e76 100644
--- a/priv/main/vex_main.c
+++ b/priv/main/vex_main.c
@@ -179,8 +179,13 @@
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 @@
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 @@
/* 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------------------------"
diff --git a/pub/libvex.h b/pub/libvex.h
index 8bf068e..e482737 100644
--- a/pub/libvex.h
+++ b/pub/libvex.h
@@ -275,14 +275,20 @@
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 @@
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? */
diff --git a/test_main.c b/test_main.c
index 1fa937d..0a9c067 100644
--- a/test_main.c
+++ b/test_main.c
@@ -148,7 +148,8 @@
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 */