|
From: <sv...@va...> - 2009-04-28 07:53:20
|
Author: njn
Date: 2009-04-28 08:53:14 +0100 (Tue, 28 Apr 2009)
New Revision: 9661
Log:
Get rid of some magic numbers in m_signals.c.
Modified:
branches/DARWIN/coregrind/m_signals.c
Modified: branches/DARWIN/coregrind/m_signals.c
===================================================================
--- branches/DARWIN/coregrind/m_signals.c 2009-04-28 07:34:51 UTC (rev 9660)
+++ branches/DARWIN/coregrind/m_signals.c 2009-04-28 07:53:14 UTC (rev 9661)
@@ -1280,6 +1280,11 @@
#endif
}
+// This is an arbitrary si_code that we only use internally. It corresponds
+// to the value SI_KERNEL on Linux, but that's not really of any significance
+// as far as I can determine.
+#define VKI_SEGV_MADE_UP_GPF 0x80
+
/*
Perform the default action of a signal. If the signal is fatal, it
marks all threads as needing to exit, but it doesn't actually kill
@@ -1375,7 +1380,7 @@
switch(info->si_code) {
case VKI_SEGV_MAPERR: event = "Access not within mapped region"; break;
case VKI_SEGV_ACCERR: event = "Bad permissions for mapped region"; break;
- case 128:
+ case VKI_SEGV_MADE_UP_GPF:
/* General Protection Fault: The CPU/kernel
isn't telling us anything useful, but this
is commonly the result of exceeding a
@@ -1608,19 +1613,19 @@
// permissions are bad.
void VG_(synth_fault_perms)(ThreadId tid, Addr addr)
{
- synth_fault_common(tid, addr, 2);
+ synth_fault_common(tid, addr, VKI_SEGV_ACCERR);
}
// Synthesize a fault where the address there's nothing mapped at the address.
void VG_(synth_fault_mapping)(ThreadId tid, Addr addr)
{
- synth_fault_common(tid, addr, 1);
+ synth_fault_common(tid, addr, VKI_SEGV_MAPERR);
}
// Synthesize a misc memory fault.
void VG_(synth_fault)(ThreadId tid)
{
- synth_fault_common(tid, 0, 0x80);
+ synth_fault_common(tid, 0, VKI_SEGV_MADE_UP_GPF);
}
// Synthesise a SIGILL.
|