From 087255f973757a8ea81d93b62c3fd9e956940334 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Sun, 3 May 2009 22:53:19 +0000 Subject: [PATCH] Merge part of r9709 (m_signals.c clean-ups) from the DARWIN branch. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9737 --- coregrind/m_signals.c | 18 +++++++++--------- none/tests/Makefile.am | 3 ++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/coregrind/m_signals.c b/coregrind/m_signals.c index e4896e22b..ee6fe69f0 100644 --- a/coregrind/m_signals.c +++ b/coregrind/m_signals.c @@ -1757,12 +1757,12 @@ void VG_(set_fault_catcher)(void (*catcher)(Int, Addr)) } static -void sync_signalhandler_from_outside ( ThreadId tid, +void sync_signalhandler_from_user ( ThreadId tid, Int sigNo, vki_siginfo_t *info, struct vki_ucontext *uc ) { ThreadId qtid; - /* If some user-process sent us a sync signal (ie, they're not the result + /* If some user-process sent us a sync signal (ie. it's not the result of a faulting instruction), then how we treat it depends on when it arrives... */ @@ -1890,7 +1890,7 @@ static Bool extend_stack_if_appropriate(ThreadId tid, vki_siginfo_t* info) } static -void sync_signalhandler_from_inside ( ThreadId tid, +void sync_signalhandler_from_kernel ( ThreadId tid, Int sigNo, vki_siginfo_t *info, struct vki_ucontext *uc ) { /* Check to see if some part of Valgrind itself is interested in faults. @@ -1963,7 +1963,7 @@ void sync_signalhandler ( Int sigNo, vki_siginfo_t *info, struct vki_ucontext *uc ) { ThreadId tid = VG_(lwpid_to_vgtid)(VG_(gettid)()); - Bool from_outside; + Bool from_user; if (0) VG_(printf)("sync_sighandler(%d, %p, %p)\n", sigNo, info, uc); @@ -1978,14 +1978,14 @@ void sync_signalhandler ( Int sigNo, info->si_code = sanitize_si_code(info->si_code); - from_outside = !is_signal_from_kernel(info->si_code); + from_user = !is_signal_from_kernel(info->si_code); if (VG_(clo_trace_signals)) { VG_DMSG("sync signal handler: " "signal=%d, si_code=%d, EIP=%#lx, eip=%#lx, from %s", sigNo, info->si_code, VG_(get_IP)(tid), VG_UCONTEXT_INSTR_PTR(uc), - ( from_outside ? "outside" : "inside" )); + ( from_user ? "user" : "kernel" )); } vg_assert(sigNo >= 1 && sigNo <= VG_(max_signal)); @@ -2005,10 +2005,10 @@ void sync_signalhandler ( Int sigNo, (Why do we care?) If the signal is from the user rather than the kernel, then treat it more like an async signal than a sync signal -- that is, merely queue it for later delivery. */ - if (from_outside) { - sync_signalhandler_from_outside(tid, sigNo, info, uc); + if (from_user) { + sync_signalhandler_from_user(tid, sigNo, info, uc); } else { - sync_signalhandler_from_inside( tid, sigNo, info, uc); + sync_signalhandler_from_kernel( tid, sigNo, info, uc); } } diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index f1bbff6ca..1fbcd0d92 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -130,7 +130,8 @@ EXTRA_DIST = $(noinst_SCRIPTS) \ check_PROGRAMS = \ ansi args \ - async-sigs bitfield1 \ + async-sigs \ + bitfield1 \ bug129866 \ closeall coolo_strlen \ discard exec-sigmask execve faultstatus fcntl_setown \