]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Handle emulation-warnings emitted by Vex-generated code.
authorJulian Seward <jseward@acm.org>
Mon, 29 Nov 2004 19:47:54 +0000 (19:47 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 29 Nov 2004 19:47:54 +0000 (19:47 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3152

coregrind/core_asm.h
coregrind/vg_scheduler.c

index ae11313970bc71e968b1539f1afc204271fe7489..24b9f31ca811b975462adabaa5c080b5bf5194f2 100644 (file)
 /* 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)
index dfc2913cf5883d1952076cef696c7edb822d1185..092543b8b52303fde251cada100985a1851a3ee2 100644 (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