Int nextTemp;
};
-extern void VG_(translate) ( ThreadId tid, Addr orig_addr, Bool debugging );
+extern Bool VG_(translate) ( ThreadId tid, Addr orig_addr, Bool debugging );
extern void VG_(sanity_check_UInstr) ( UInt n, UInstr* u );
thread. */
if (trc == VG_TRC_INNER_FASTMISS) {
+ Addr ip = VG_(threads)[tid].m_eip;
+
vg_assert(VG_(dispatch_ctr) > 0);
/* Trivial event. Miss in the fast-cache. Do a full
lookup for it. */
- trans_addr = VG_(search_transtab) ( VG_(threads)[tid].m_eip );
+ trans_addr = VG_(search_transtab) ( ip );
if (trans_addr == (Addr)0) {
/* Not found; we need to request a translation. */
- VG_(translate)( tid, VG_(threads)[tid].m_eip, /*debug*/False );
- trans_addr = VG_(search_transtab) ( VG_(threads)[tid].m_eip );
- if (trans_addr == (Addr)0)
- VG_(core_panic)("VG_TRC_INNER_FASTMISS: missing tt_fast entry");
+ if (VG_(translate)( tid, ip, /*debug*/False )) {
+ trans_addr = VG_(search_transtab)( ip );
+ if (trans_addr == (Addr)0)
+ VG_(core_panic)("VG_TRC_INNER_FASTMISS: missing tt_fast entry");
+ } else {
+ // If VG_(translate)() fails, it's because it had to throw
+ // a signal because the client jumped to a bad address.
+ // This means VG_(deliver_signal)() will have been called
+ // by now, and the program counter will now be pointing to
+ // the start of the signal handler (if there is no
+ // handler, things would have been aborted by now), so do
+ // nothing, and things will work out next time around the
+ // scheduler loop.
+ }
}
continue; /* with this thread */
}
'tid' is the identity of the thread needing this block.
*/
-void VG_(translate) ( ThreadId tid, Addr orig_addr,
+Bool VG_(translate) ( ThreadId tid, Addr orig_addr,
Bool debugging_translation )
{
Addr trans_addr, redir, orig_addr0 = orig_addr;
} else
VG_(synth_fault_mapping)(tid, orig_addr);
- return;
+ return False;
} else
seg->flags |= SF_CODE; /* contains cached code */
VG_(arena_free)( VG_AR_JITTER, (void*)trans_addr );
VGP_POPCC(VgpTranslate);
+
+ return True;
}
badaddrvalue
badfree
badjump
+badjump2
badloop
buflen_check
clientperm
badfree-2trace.stderr.exp badfree-2trace.vgtest \
badfree.stderr.exp badfree.vgtest \
badjump.stderr.exp badjump.vgtest \
+ badjump2.stderr.exp badjump2.vgtest \
badloop.stderr.exp badloop.vgtest \
badrw.stderr.exp badrw.vgtest \
brk.stderr.exp brk.vgtest \
zeropage.stderr.exp zeropage.vgtest
check_PROGRAMS = \
- badaddrvalue badfree badjump badloop badrw brk brk2 buflen_check \
+ badaddrvalue badfree badjump badjump2 \
+ badloop badrw brk brk2 buflen_check \
clientperm custom_alloc \
doublefree error_counts errs1 exitprog execve execve2 \
fpeflags fprw fwrite inits inline \
badaddrvalue_SOURCES = badaddrvalue.c
badfree_SOURCES = badfree.c
badjump_SOURCES = badjump.c
+badjump2_SOURCES = badjump2.c
badloop_SOURCES = badloop.c
badrw_SOURCES = badrw.c
brk_SOURCES = brk.c