From: Roland McGrath <roland@redhat.com>
To: Paul Mackerras <paulus@samba.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/5] powerpc: tracehook_signal_handler
Date: Sat, 26 Jul 2008 23:49:50 -0700 (PDT) [thread overview]
Message-ID: <20080727064950.F2F69154280@magilla.localdomain> (raw)
In-Reply-To: Roland McGrath's message of Saturday, 26 July 2008 23:48:59 -0700 <20080727064859.69692154280@magilla.localdomain>
This makes the powerpc signal handling code call tracehook_signal_handler()
after a handler is set up. This means that using PTRACE_SINGLESTEP to
enter a signal handler will report to ptrace on the first instruction of
the handler, instead of the second. This is consistent with what x86 and
other machines do, and what users and debuggers want.
Signed-off-by: Roland McGrath <roland@redhat.com>
---
arch/powerpc/kernel/signal.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c
index 7aada78..11a5c45 100644
--- a/arch/powerpc/kernel/signal.c
+++ b/arch/powerpc/kernel/signal.c
@@ -9,7 +9,7 @@
* this archive for more details.
*/
-#include <linux/ptrace.h>
+#include <linux/tracehook.h>
#include <linux/signal.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
@@ -177,6 +177,12 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
* its frame, and we can clear the TLF_RESTORE_SIGMASK flag.
*/
current_thread_info()->local_flags &= ~_TLF_RESTORE_SIGMASK;
+
+ /*
+ * Let tracing know that we've done the handler setup.
+ */
+ tracehook_signal_handler(signr, &info, &ka, regs,
+ test_thread_flag(TIF_SINGLESTEP));
}
return ret;
next prev parent reply other threads:[~2008-07-27 6:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-27 6:48 [PATCH 0/5] powerpc tracehook Roland McGrath
2008-07-27 6:49 ` Roland McGrath [this message]
2008-07-27 6:51 ` [PATCH 2/5] powerpc: tracehook syscall Roland McGrath
2008-07-27 6:51 ` [PATCH 3/5] powerpc: tracehook: asm/syscall.h Roland McGrath
2008-07-27 6:52 ` [PATCH 4/5] powerpc: tracehook: TIF_NOTIFY_RESUME Roland McGrath
2008-07-27 6:53 ` [PATCH 5/5] powerpc: tracehook: CONFIG_HAVE_ARCH_TRACEHOOK Roland McGrath
2008-07-27 7:52 ` [PATCH 0/5] powerpc tracehook Benjamin Herrenschmidt
2008-07-27 7:55 ` David Miller
2008-07-27 8:51 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080727064950.F2F69154280@magilla.localdomain \
--to=roland@redhat.com \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox