linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC,PATCH 04/14] ptrace: implement user_single_step_siginfo()
@ 2009-11-24 20:01 Oleg Nesterov
  0 siblings, 0 replies; only message in thread
From: Oleg Nesterov @ 2009-11-24 20:01 UTC (permalink / raw)
  To: Alexey Dobriyan, Ananth Mavinakayanahalli, Christoph Hellwig,
	Frank Ch. Eigler, Ingo Molnar, Peter Zijlstra, Roland McGrath
  Cc: linux-kernel, utrace-devel

(already in mm: ptrace-powerpc-implement-user_single_step_siginfo.patch)

Suggested by Roland.

Implement user_single_step_siginfo() for powerpc.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Roland McGrath <roland@redhat.com>
---

 arch/powerpc/include/asm/ptrace.h |    2 ++
 arch/powerpc/kernel/traps.c       |    9 +++++++++
 2 files changed, 11 insertions(+)

--- V1/arch/powerpc/include/asm/ptrace.h~4_PPC_HELPER	2009-11-24 19:46:49.000000000 +0100
+++ V1/arch/powerpc/include/asm/ptrace.h	2009-11-24 19:51:41.000000000 +0100
@@ -140,6 +140,8 @@ extern void user_enable_single_step(stru
 extern void user_enable_block_step(struct task_struct *);
 extern void user_disable_single_step(struct task_struct *);
 
+#define ARCH_HAS_USER_SINGLE_STEP_INFO
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */
--- V1/arch/powerpc/kernel/traps.c~4_PPC_HELPER	2009-11-24 19:46:49.000000000 +0100
+++ V1/arch/powerpc/kernel/traps.c	2009-11-24 19:51:41.000000000 +0100
@@ -174,6 +174,15 @@ int die(const char *str, struct pt_regs 
 	return 0;
 }
 
+void user_single_step_siginfo(struct task_struct *tsk,
+				struct pt_regs *regs, siginfo_t *info)
+{
+	memset(info, 0, sizeof(*info));
+	info->si_signo = SIGTRAP;
+	info->si_code = TRAP_TRACE;
+	info->si_addr = (void __user *)regs->nip;
+}
+
 void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
 {
 	siginfo_t info;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-24 20:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-24 20:01 [RFC,PATCH 04/14] ptrace: implement user_single_step_siginfo() Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).