break;
}
+ case VEX_TRC_JMP_TRAP:
+ VG_(synth_sigtrap)(tid);
+ break;
+
case VEX_TRC_JMP_NODECODE:
#define M(a) VG_(message)(Vg_UserMsg, a);
M("Your program just tried to execute an instruction that Valgrind" );
deliver_signal(tid, &info);
}
+// Synthesise a SIGTRAP.
+void VG_(synth_sigtrap)(ThreadId tid)
+{
+ vki_siginfo_t info;
+
+ vg_assert(VG_(threads)[tid].status == VgTs_Runnable);
+
+ info.si_signo = VKI_SIGTRAP;
+ info.si_code = VKI_TRAP_TRACE; /* jrs: no idea what this should be */
+
+ resume_scheduler(tid);
+ deliver_signal(tid, &info);
+}
+
/* Make a signal pending for a thread, for later delivery.
VG_(poll_signals) will arrange for it to be delivered at the right
time.
extern void VG_(synth_fault_mapping)(ThreadId tid, Addr addr);
extern void VG_(synth_fault_perms) (ThreadId tid, Addr addr);
extern void VG_(synth_sigill) (ThreadId tid, Addr addr);
+extern void VG_(synth_sigtrap) (ThreadId tid);
/* Extend the stack to cover addr, if possible */
extern Bool VG_(extend_stack)(Addr addr, UInt maxsize);
#define VKI_BUS_ADRERR (__VKI_SI_FAULT|2) /* non-existant physical address */
#define VKI_BUS_OBJERR (__VKI_SI_FAULT|3) /* object specific hardware error */
+/*
+ * SIGTRAP si_codes
+ */
+#define VKI_TRAP_BRKPT (__VKI_SI_FAULT|1) /* process breakpoint */
+#define VKI_TRAP_TRACE (__VKI_SI_FAULT|2) /* process trace trap */
+
/*
* This works because the alignment is ok on all current architectures
* but we leave open this being overridden in the future