PERFORCE change 153016 for review
Peter Wemm
peter at FreeBSD.org
Sat Nov 15 13:19:45 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=153016
Change 153016 by peter at peter_overcee on 2008/11/15 21:18:58
Turn on userland vs kernel siginfo detection and handling.
Affected files ...
.. //depot/projects/valgrind/coregrind/m_signals.c#10 edit
Differences ...
==== //depot/projects/valgrind/coregrind/m_signals.c#10 (text+ko) ====
@@ -1538,7 +1538,6 @@
deliver_signal(tid, &info, &uc);
}
-#ifndef VGO_freebsd
/* Make a signal pending for a thread, for later delivery.
VG_(poll_signals) will arrange for it to be delivered at the right
time.
@@ -1584,7 +1583,6 @@
restore_all_host_signals(&savedmask);
}
-#endif
/*
Returns the next queued signal for thread tid which is in "set".
@@ -1775,8 +1773,8 @@
VG_(printf)("si_uid %d\n", info->si_uid);
VG_(printf)("si_status %d\n", info->si_status);
VG_(printf)("si_addr %p\n", info->si_addr);
-VG_(printf)("si_value %d\n", info->si_value);
-VG_(printf)("si_band %d\n", info->si_band);
+VG_(printf)("si_value %p\n", info->si_value.sival_ptr);
+VG_(printf)("si_band %ld\n", info->si_band);
#endif
#ifdef VGO_linux
@@ -1791,9 +1789,13 @@
info->si_code = (Short)info->si_code;
#endif
-/* QQQ crap! fix this! 4.x is totally busted here! */
-#ifndef VGO_freebsd
+#if defined(VGO_linux) || defined(VGO_aix5)
if (info->si_code <= VKI_SI_USER) {
+#elif defined(VGO_freebsd)
+ if (info->si_code >= VKI_SI_USER) {
+#else
+# error Unknown OS
+#endif
/* If some user-process sent us one of these signals (ie,
they're not the result of a faulting instruction), then treat
it as an async signal. This is tricky because we could get
@@ -1828,7 +1830,7 @@
continue unless we get it. */
VG_(message)(Vg_UserMsg, "Signal %d (%s) appears to have lost its siginfo; I can't go on.",
sigNo, signame(sigNo));
-#ifdef VGO_linux
+#if defined(VGO_linux)
VG_(message)(Vg_UserMsg, " This may be because one of your programs has consumed your");
VG_(message)(Vg_UserMsg, " ration of siginfo structures.");
VG_(printf)(
@@ -1857,7 +1859,7 @@
/* Since every thread has these signals unblocked, we can't rely
on the kernel to route them properly, so we need to queue
them manually. */
-#ifdef VKI_SI_TKILL
+#if defined(VKI_SI_TKILL)
if (info->si_code == VKI_SI_TKILL)
queue_signal(tid, info); /* directed to us specifically */
else
@@ -1866,7 +1868,6 @@
return;
}
-#endif
if (VG_(clo_trace_signals)) {
VG_(message)(Vg_DebugMsg, "signal %d arrived ... si_code=%d, "
More information about the p4-projects
mailing list