Handle emulation-warnings emitted by Vex-generated code.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3152
This commit is contained in:
Julian Seward 2004-11-29 19:47:54 +00:00
parent 62024ae795
commit e62fd9ba79
2 changed files with 22 additions and 4 deletions

View File

@ -37,19 +37,23 @@
/* This file is included in all Valgrind source files, including
assembly ones. */
/* Magic values that the guest state might be set to when returning to the
dispatcher. The only other legitimate value is to point to the
start of the thread's VEX guest state. These also are return values from
VG_(run_innerloop) to the scheduler.
*/
/* Defines values for JMP_SYSCALL, JMP_CLIENTREQ and JMP_YIELD */
/* Defines values for JMP_EMWARN, JMP_SYSCALL, JMP_CLIENTREQ and
JMP_YIELD */
#include "libvex_trc_values.h"
/* and some more of our own ... */
/* And some more of our own. These must not have the same values as
those from libvex_trc_values.h. */
#define VG_TRC_INNER_FASTMISS 31 /* TRC only; means fast-cache miss. */
#define VG_TRC_INNER_COUNTERZERO 29 /* TRC only; means bb ctr == 0 */
#define VG_TRC_UNRESUMABLE_SIGNAL 37 /* TRC only; got sigsegv/sigbus */
/* Constants for the fast translation lookup cache. */
#define VG_TT_FAST_BITS 15
#define VG_TT_FAST_SIZE (1 << VG_TT_FAST_BITS)

View File

@ -900,6 +900,20 @@ VgSchedReturnCode do_scheduler ( Int* exitcode, ThreadId* last_run_tid )
continue; /* with this thread */
}
if (trc == VEX_TRC_JMP_EMWARN) {
VexEmWarn ew
= (VexEmWarn)VG_(threads)[tid].arch.vex.guest_EMWARN;
HChar* what
= (ew < 0 || ew >= EmWarn_NUMBER)
? "unknown (?!)"
: LibVEX_EmWarn_string(ew);
VG_(message)( Vg_UserMsg,
"Emulation warning: unsupported action:");
VG_(message)( Vg_UserMsg, " %s", what);
VG_(pp_ExeContext) ( VG_(get_ExeContext) ( tid ) );
continue; /* with this thread */
}
if (trc == VEX_TRC_JMP_CLIENTREQ) {
UWord* args = (UWord*)(CLREQ_ARGS(VG_(threads)[tid].arch));
UWord reqno = args[0];
@ -908,7 +922,7 @@ VgSchedReturnCode do_scheduler ( Int* exitcode, ThreadId* last_run_tid )
/* Are we really absolutely totally quitting? */
if (reqno == VG_USERREQ__LIBC_FREERES_DONE) {
if (0 || VG_(clo_trace_syscalls) || VG_(clo_trace_sched)) {
VG_(message)(Vg_DebugMsg,
VG_(message)(Vg_DebugMsg,
"__libc_freeres() done; really quitting!");
}
return VgSrc_ExitSyscall;
@ -923,7 +937,7 @@ VgSchedReturnCode do_scheduler ( Int* exitcode, ThreadId* last_run_tid )
continue; /* with this thread */
else
goto stage1;
}
}
if (trc == VEX_TRC_JMP_SYSCALL) {
/* Do a syscall for the vthread tid. This could cause it