|
From: <sv...@va...> - 2005-10-18 12:01:57
|
Author: sewardj
Date: 2005-10-18 13:01:48 +0100 (Tue, 18 Oct 2005)
New Revision: 1420
Log:
API change: pass both the VexGuestExtents and the original
pre-redirection guest address to instrumentation functions.
Modified:
trunk/priv/main/vex_main.c
trunk/pub/libvex.h
trunk/test_main.c
Modified: trunk/priv/main/vex_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/main/vex_main.c 2005-10-12 11:34:33 UTC (rev 1419)
+++ trunk/priv/main/vex_main.c 2005-10-18 12:01:48 UTC (rev 1420)
@@ -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*,=20
+ Addr64, VexGuestExtents*,=20
IRType gWordTy, IRType hWordTy ),
IRBB* (*instrument2) ( IRBB*, VexGuestLayout*,=20
+ 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 =3D (*instrument1)(irbb, guest_layout,=20
- guest_word_type, host_word_type);
+ guest_bytes_addr_noredir, guest_extents,
+ guest_word_type, host_word_type);
if (instrument2)
irbb =3D (*instrument2)(irbb, guest_layout,
- guest_word_type, host_word_type);
+ guest_bytes_addr_noredir, guest_extents,
+ guest_word_type, host_word_type);
=20
if (vex_traceflags & VEX_TRACE_INST) {
vex_printf("\n------------------------"=20
Modified: trunk/pub/libvex.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/pub/libvex.h 2005-10-12 11:34:33 UTC (rev 1419)
+++ trunk/pub/libvex.h 2005-10-18 12:01:48 UTC (rev 1420)
@@ -275,14 +275,20 @@
=20
extern=20
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*,=20
+ Addr64, VexGuestExtents*,
IRType gWordTy, IRType hWordTy ),
IRBB* (*instrument2) ( IRBB*, VexGuestLayout*,=20
+ Addr64, VexGuestExtents*,
IRType gWordTy, IRType hWordTy ),
Bool cleanup_after_instrumentation,
/* IN: should this translation be self-checking? */
Modified: trunk/test_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/test_main.c 2005-10-12 11:34:33 UTC (rev 1419)
+++ trunk/test_main.c 2005-10-18 12:01:48 UTC (rev 1420)
@@ -148,7 +148,8 @@
VexArchX86, &vai_x86,=20
VexArchX86, &vai_x86,=20
#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 */
|