|
From: <sv...@va...> - 2005-11-02 15:31:29
|
Author: tom
Date: 2005-11-02 15:31:21 +0000 (Wed, 02 Nov 2005)
New Revision: 4988
Log:
Display signal masks correctly when --trace-signals=3Dyes is used
on 64 bit platforms.
Modified:
trunk/coregrind/m_signals.c
Modified: trunk/coregrind/m_signals.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_signals.c 2005-11-02 15:17:43 UTC (rev 4987)
+++ trunk/coregrind/m_signals.c 2005-11-02 15:31:21 UTC (rev 4988)
@@ -675,6 +675,28 @@
}
}
=20
+static
+const Char *format_sigset ( const vki_sigset_t* set )
+{
+ static Char buf[128];
+ int w;
+
+ VG_(strcpy)(buf, "");
+
+ for (w =3D _VKI_NSIG_WORDS - 1; w >=3D 0; w--)
+ {
+#if _VKI_NSIG_BPW =3D=3D 32
+ VG_(sprintf)(buf + VG_(strlen)(buf), "%08lx", set ? set->sig[w] : =
0);
+#elif _VKI_NSIG_BPW =3D=3D 64
+ VG_(sprintf)(buf + VG_(strlen)(buf), "%16lx", set ? set->sig[w] : =
0);
+#else
+#error "Unsupported value for _VKI_NSIG_BPW"
+#endif
+ }
+
+ return buf;
+}
+
/*=20
This updates the thread's signal mask. There's no such thing as a
process-wide signal mask.
@@ -690,13 +712,12 @@
{
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugExtraMsg,=20
- "do_setmask: tid =3D %d how =3D %d (%s), set =3D %p %08x%08x",=20
+ "do_setmask: tid =3D %d how =3D %d (%s), set =3D %p %s",=20
tid, how,
how=3D=3DVKI_SIG_BLOCK ? "SIG_BLOCK" : (
how=3D=3DVKI_SIG_UNBLOCK ? "SIG_UNBLOCK" : (
how=3D=3DVKI_SIG_SETMASK ? "SIG_SETMASK" : "???")),
- newset, newset ? newset->sig[1] : 0, newset ? newset->sig[0] : 0
- );
+ newset, format_sigset(newset));
=20
/* Just do this thread. */
vg_assert(VG_(is_valid_tid)(tid));
@@ -705,7 +726,7 @@
if (VG_(clo_trace_signals))
VG_(message)(Vg_DebugExtraMsg,=20
"\toldset=3D%p %08x%08x",
- oldset, oldset->sig[1], oldset->sig[0]);
+ oldset, format_sigset(oldset));
}
if (newset) {
do_sigprocmask_bitops (how, &VG_(threads)[tid].sig_mask, newset );
|