From: Florian Krohm Date: Fri, 2 Jan 2015 11:44:12 +0000 (+0000) Subject: Make VexTranslateArgs::guest_bytes_addr an Addr value. Fix ripple. X-Git-Tag: svn/VALGRIND_3_11_0^2~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09c8fcb972d6c200390fd59d464905b3722d8d4a;p=thirdparty%2Fvalgrind.git Make VexTranslateArgs::guest_bytes_addr an Addr value. Fix ripple. git-svn-id: svn://svn.valgrind.org/vex/trunk@3052 --- diff --git a/VEX/priv/guest_amd64_defs.h b/VEX/priv/guest_amd64_defs.h index 494f366e05..a2956484fa 100644 --- a/VEX/priv/guest_amd64_defs.h +++ b/VEX/priv/guest_amd64_defs.h @@ -56,7 +56,7 @@ DisResult disInstr_AMD64 ( IRSB* irbb, void* callback_opaque, const UChar* guest_code, Long delta, - Addr64 guest_IP, + Addr guest_IP, VexArch guest_arch, const VexArchInfo* archinfo, const VexAbiInfo* abiinfo, diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c index 135ab18c3b..ba5190a41b 100644 --- a/VEX/priv/guest_amd64_toIR.c +++ b/VEX/priv/guest_amd64_toIR.c @@ -31784,7 +31784,7 @@ DisResult disInstr_AMD64 ( IRSB* irsb_IN, void* callback_opaque, const UChar* guest_code_IN, Long delta, - Addr64 guest_IP, + Addr guest_IP, VexArch guest_arch, const VexArchInfo* archinfo, const VexAbiInfo* abiinfo, diff --git a/VEX/priv/guest_arm64_defs.h b/VEX/priv/guest_arm64_defs.h index 1b52aa787d..8910cad829 100644 --- a/VEX/priv/guest_arm64_defs.h +++ b/VEX/priv/guest_arm64_defs.h @@ -46,7 +46,7 @@ DisResult disInstr_ARM64 ( IRSB* irbb, void* callback_opaque, const UChar* guest_code, Long delta, - Addr64 guest_IP, + Addr guest_IP, VexArch guest_arch, const VexArchInfo* archinfo, const VexAbiInfo* abiinfo, diff --git a/VEX/priv/guest_arm64_toIR.c b/VEX/priv/guest_arm64_toIR.c index 6cc84726b6..f5a903a9ae 100644 --- a/VEX/priv/guest_arm64_toIR.c +++ b/VEX/priv/guest_arm64_toIR.c @@ -12971,7 +12971,7 @@ DisResult disInstr_ARM64 ( IRSB* irsb_IN, void* callback_opaque, const UChar* guest_code_IN, Long delta_IN, - Addr64 guest_IP, + Addr guest_IP, VexArch guest_arch, const VexArchInfo* archinfo, const VexAbiInfo* abiinfo, diff --git a/VEX/priv/guest_arm_defs.h b/VEX/priv/guest_arm_defs.h index c03f2611ab..abefb64167 100644 --- a/VEX/priv/guest_arm_defs.h +++ b/VEX/priv/guest_arm_defs.h @@ -48,7 +48,7 @@ DisResult disInstr_ARM ( IRSB* irbb, void* callback_opaque, const UChar* guest_code, Long delta, - Addr64 guest_IP, + Addr guest_IP, VexArch guest_arch, const VexArchInfo* archinfo, const VexAbiInfo* abiinfo, diff --git a/VEX/priv/guest_arm_toIR.c b/VEX/priv/guest_arm_toIR.c index 1da4dddeba..ea91ec2530 100644 --- a/VEX/priv/guest_arm_toIR.c +++ b/VEX/priv/guest_arm_toIR.c @@ -22019,7 +22019,7 @@ DisResult disInstr_ARM ( IRSB* irsb_IN, void* callback_opaque, const UChar* guest_code_IN, Long delta_ENCODED, - Addr64 guest_IP_ENCODED, + Addr guest_IP_ENCODED, VexArch guest_arch, const VexArchInfo* archinfo, const VexAbiInfo* abiinfo, diff --git a/VEX/priv/guest_generic_bb_to_IR.c b/VEX/priv/guest_generic_bb_to_IR.c index cd17fda913..4667cf1309 100644 --- a/VEX/priv/guest_generic_bb_to_IR.c +++ b/VEX/priv/guest_generic_bb_to_IR.c @@ -184,7 +184,7 @@ IRSB* bb_to_IR ( /*IN*/ void* callback_opaque, /*IN*/ DisOneInstrFn dis_instr_fn, /*IN*/ const UChar* guest_code, - /*IN*/ Addr64 guest_IP_bbstart, + /*IN*/ Addr guest_IP_bbstart, /*IN*/ Bool (*chase_into_ok)(void*,Addr), /*IN*/ VexEndness host_endness, /*IN*/ Bool sigill_diag, @@ -210,7 +210,7 @@ IRSB* bb_to_IR ( Int d_resteers = 0; Int selfcheck_idx = 0; IRSB* irsb; - Addr64 guest_IP_curr_instr; + Addr guest_IP_curr_instr; IRConst* guest_IP_bbstart_IRConst = NULL; Int n_cond_resteers_allowed = 2; @@ -329,10 +329,10 @@ IRSB* bb_to_IR ( was originally Thumb or ARM. For more details of this convention, see comments on definition of guest_R15T in libvex_guest_arm.h. */ - if (arch_guest == VexArchARM && (guest_IP_curr_instr & (Addr64)1)) { + if (arch_guest == VexArchARM && (guest_IP_curr_instr & 1)) { /* Thumb insn => mask out the T bit, but put it in delta */ addStmtToIRSB( irsb, - IRStmt_IMark(guest_IP_curr_instr & ~(Addr64)1, + IRStmt_IMark(guest_IP_curr_instr & ~(Addr)1, 0, /* len */ 1 /* delta */ ) diff --git a/VEX/priv/guest_generic_bb_to_IR.h b/VEX/priv/guest_generic_bb_to_IR.h index 7bf65cf2af..e01ba6321d 100644 --- a/VEX/priv/guest_generic_bb_to_IR.h +++ b/VEX/priv/guest_generic_bb_to_IR.h @@ -143,7 +143,7 @@ typedef /*IN*/ Long delta, /* What is the guest IP of the insn? */ - /*IN*/ Addr64 guest_IP, + /*IN*/ Addr guest_IP, /* Info about the guest architecture */ /*IN*/ VexArch guest_arch, @@ -174,7 +174,7 @@ IRSB* bb_to_IR ( /*IN*/ void* callback_opaque, /*IN*/ DisOneInstrFn dis_instr_fn, /*IN*/ const UChar* guest_code, - /*IN*/ Addr64 guest_IP_bbstart, + /*IN*/ Addr guest_IP_bbstart, /*IN*/ Bool (*chase_into_ok)(void*,Addr), /*IN*/ VexEndness host_endness, /*IN*/ Bool sigill_diag, diff --git a/VEX/priv/guest_mips_defs.h b/VEX/priv/guest_mips_defs.h index 7cc2f885c9..757211d8e7 100644 --- a/VEX/priv/guest_mips_defs.h +++ b/VEX/priv/guest_mips_defs.h @@ -47,7 +47,7 @@ extern DisResult disInstr_MIPS ( IRSB* irbb, void* callback_opaque, const UChar* guest_code, Long delta, - Addr64 guest_IP, + Addr guest_IP, VexArch guest_arch, const VexArchInfo* archinfo, const VexAbiInfo* abiinfo, diff --git a/VEX/priv/guest_mips_toIR.c b/VEX/priv/guest_mips_toIR.c index 92c64af205..bfc9124c74 100644 --- a/VEX/priv/guest_mips_toIR.c +++ b/VEX/priv/guest_mips_toIR.c @@ -17287,7 +17287,7 @@ DisResult disInstr_MIPS( IRSB* irsb_IN, void* callback_opaque, const UChar* guest_code_IN, Long delta, - Addr64 guest_IP, + Addr guest_IP, VexArch guest_arch, const VexArchInfo* archinfo, const VexAbiInfo* abiinfo, diff --git a/VEX/priv/guest_ppc_defs.h b/VEX/priv/guest_ppc_defs.h index 19cdcbe2ea..55bb656095 100644 --- a/VEX/priv/guest_ppc_defs.h +++ b/VEX/priv/guest_ppc_defs.h @@ -57,7 +57,7 @@ DisResult disInstr_PPC ( IRSB* irbb, void* callback_opaque, const UChar* guest_code, Long delta, - Addr64 guest_IP, + Addr guest_IP, VexArch guest_arch, const VexArchInfo* archinfo, const VexAbiInfo* abiinfo, diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c index e603b6e10e..3f01e0b32e 100644 --- a/VEX/priv/guest_ppc_toIR.c +++ b/VEX/priv/guest_ppc_toIR.c @@ -20187,7 +20187,7 @@ DisResult disInstr_PPC ( IRSB* irsb_IN, void* callback_opaque, const UChar* guest_code_IN, Long delta, - Addr64 guest_IP, + Addr guest_IP, VexArch guest_arch, const VexArchInfo* archinfo, const VexAbiInfo* abiinfo, diff --git a/VEX/priv/guest_s390_defs.h b/VEX/priv/guest_s390_defs.h index de2cb6e6e7..2e482f59a3 100644 --- a/VEX/priv/guest_s390_defs.h +++ b/VEX/priv/guest_s390_defs.h @@ -46,7 +46,7 @@ DisResult disInstr_S390 ( IRSB* irbb, void* callback_opaque, const UChar* guest_code, Long delta, - Addr64 guest_IP, + Addr guest_IP, VexArch guest_arch, const VexArchInfo* archinfo, const VexAbiInfo* abiinfo, diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index 98d78052ee..e066d10a38 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -16663,7 +16663,7 @@ disInstr_S390(IRSB *irsb_IN, void *callback_opaque, const UChar *guest_code, Long delta, - Addr64 guest_IP, + Addr guest_IP, VexArch guest_arch, const VexArchInfo *archinfo, const VexAbiInfo *abiinfo, diff --git a/VEX/priv/guest_x86_defs.h b/VEX/priv/guest_x86_defs.h index 802b767b65..47ce896c57 100644 --- a/VEX/priv/guest_x86_defs.h +++ b/VEX/priv/guest_x86_defs.h @@ -56,7 +56,7 @@ DisResult disInstr_X86 ( IRSB* irbb, void* callback_opaque, const UChar* guest_code, Long delta, - Addr64 guest_IP, + Addr guest_IP, VexArch guest_arch, const VexArchInfo* archinfo, const VexAbiInfo* abiinfo, diff --git a/VEX/priv/guest_x86_toIR.c b/VEX/priv/guest_x86_toIR.c index 893fcac719..f46707b1cd 100644 --- a/VEX/priv/guest_x86_toIR.c +++ b/VEX/priv/guest_x86_toIR.c @@ -15413,7 +15413,7 @@ DisResult disInstr_X86 ( IRSB* irsb_IN, void* callback_opaque, const UChar* guest_code_IN, Long delta, - Addr64 guest_IP, + Addr guest_IP, VexArch guest_arch, const VexArchInfo* archinfo, const VexAbiInfo* abiinfo, diff --git a/VEX/priv/ir_opt.c b/VEX/priv/ir_opt.c index 0779e6135b..d2ba8fd7c8 100644 --- a/VEX/priv/ir_opt.c +++ b/VEX/priv/ir_opt.c @@ -4650,7 +4650,7 @@ static Int calc_unroll_factor( IRSB* bb ) } -static IRSB* maybe_loop_unroll_BB ( IRSB* bb0, Addr64 my_addr ) +static IRSB* maybe_loop_unroll_BB ( IRSB* bb0, Addr my_addr ) { Int i, j, jmax, n_vars; Bool xxx_known; @@ -4810,7 +4810,7 @@ static IRSB* maybe_loop_unroll_BB ( IRSB* bb0, Addr64 my_addr ) } if (DEBUG_IROPT) { - vex_printf("\nUNROLLED (%llx)\n", my_addr); + vex_printf("\nUNROLLED (%lx)\n", my_addr); ppIRSB(bb1); vex_printf("\n"); } @@ -6039,7 +6039,7 @@ IRSB* do_iropt_BB( IRSB* bb0, IRExpr* (*specHelper) (const HChar*, IRExpr**, IRStmt**, Int), Bool (*preciseMemExnsFn)(Int,Int), - Addr64 guest_addr, + Addr guest_addr, VexArch guest_arch ) { diff --git a/VEX/priv/ir_opt.h b/VEX/priv/ir_opt.h index 0af7225078..c797b7140d 100644 --- a/VEX/priv/ir_opt.h +++ b/VEX/priv/ir_opt.h @@ -47,7 +47,7 @@ IRSB* do_iropt_BB( IRSB* bb, IRExpr* (*specHelper) (const HChar*, IRExpr**, IRStmt**, Int), Bool (*preciseMemExnsFn)(Int,Int), - Addr64 guest_addr, + Addr guest_addr, VexArch guest_arch ); diff --git a/VEX/priv/main_main.c b/VEX/priv/main_main.c index 12f641d6b9..08ee31eab4 100644 --- a/VEX/priv/main_main.c +++ b/VEX/priv/main_main.c @@ -728,8 +728,8 @@ VexTranslateResult LibVEX_Translate ( VexTranslateArgs* vta ) const UChar* p = vta->guest_bytes; UInt sum = 0; UInt guest_bytes_read = (UInt)vta->guest_extents->len[0]; - vex_printf("GuestBytes %llx %u ", vta->guest_bytes_addr, - guest_bytes_read ); + vex_printf("GuestBytes %lx %u ", vta->guest_bytes_addr, + guest_bytes_read ); for (i = 0; i < guest_bytes_read; i++) { UInt b = (UInt)p[i]; vex_printf(" %02x", b ); diff --git a/VEX/pub/libvex.h b/VEX/pub/libvex.h index 3a5220c372..bde9656821 100644 --- a/VEX/pub/libvex.h +++ b/VEX/pub/libvex.h @@ -605,7 +605,7 @@ typedef This is the post-redirection guest address. Not that Vex understands anything about redirection; that is all done on the Valgrind side. */ - Addr64 guest_bytes_addr; + Addr guest_bytes_addr; /* Is it OK to chase into this guest address? May not be NULL. */ diff --git a/VEX/switchback/switchback.c b/VEX/switchback/switchback.c index 48f3d1fa1d..deecc54045 100644 --- a/VEX/switchback/switchback.c +++ b/VEX/switchback/switchback.c @@ -585,7 +585,7 @@ void make_translation ( Addr64 guest_addr, Bool verbose ) vta.arch_host = VexArch; vta.archinfo_host = vex_archinfo; vta.guest_bytes = (UChar*)ULong_to_Ptr(guest_addr); - vta.guest_bytes_addr = (Addr64)guest_addr; + vta.guest_bytes_addr = guest_addr; vta.chase_into_ok = chase_into_ok; // vta.guest_extents = &vge; vta.guest_extents = &trans_table[trans_table_used]; diff --git a/VEX/useful/test_main.c b/VEX/useful/test_main.c index 802827cde0..a19ad306d5 100644 --- a/VEX/useful/test_main.c +++ b/VEX/useful/test_main.c @@ -189,7 +189,7 @@ int main ( int argc, char** argv ) vta.abiinfo_both = vbi; vta.guest_bytes = &origbuf[18]; - vta.guest_bytes_addr = (Addr64)orig_addr; + vta.guest_bytes_addr = orig_addr; vta.callback_opaque = NULL; vta.chase_into_ok = chase_into_not_ok; vta.guest_extents = &vge; @@ -223,7 +223,7 @@ int main ( int argc, char** argv ) /* ARM/Thumb only hacks, that are needed to keep the ITstate analyser in the front end happy. */ vta.guest_bytes = &origbuf[18 +1]; - vta.guest_bytes_addr = (Addr64)(&origbuf[18 +1]); + vta.guest_bytes_addr = &origbuf[18 +1]; #endif #if 1 /* no instrumentation */