public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* can't single-step on gdb
@ 2008-08-12  1:04 Hideo Saito
  2008-08-12  2:22 ` Paul Mundt
  2008-08-12  2:48 ` Paul Mundt
  0 siblings, 2 replies; 3+ messages in thread
From: Hideo Saito @ 2008-08-12  1:04 UTC (permalink / raw)
  To: linux-sh

Hi Paul,

I have a problem as to tracing a program using gdb on my platform(SH7780). I can single-step a program on gdb usually, however, in some conditions, I can not single-step the program because gdb does not change the PC without any failed assertions.

It seems that do_syscall_trace() sets SIGTRAP in exit_code in the task structure before the traced program executes the instruction. I think that do_syscall_trace should ignore single-step because the schedule of the traced process might be delayed.

--- ./arch/sh/kernel/ptrace_32.c.org	2008-04-17 11:49:44.000000000 +0900
+++ ./arch/sh/kernel/ptrace_32.c	2008-08-12 08:53:44.000000000 +0900
@@ -252,18 +252,17 @@ long arch_ptrace(struct task_struct *chi
 asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit)
 {
 	struct task_struct *tsk = current;
 
 	if (unlikely(current->audit_context) && entryexit)
 		audit_syscall_exit(AUDITSC_RESULT(regs->regs[0]),
 				   regs->regs[0]);
 
-	if (!test_thread_flag(TIF_SYSCALL_TRACE) &&
-	    !test_thread_flag(TIF_SINGLESTEP))
+	if (!test_thread_flag(TIF_SYSCALL_TRACE))
 		goto out;
 	if (!(tsk->ptrace & PT_PTRACED))
 		goto out;
 
 	/* the 0x80 provides a way for the tracing parent to distinguish
 	   between a syscall stop and SIGTRAP delivery */
 	ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) &&
 				 !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0));

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-12  2:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-12  1:04 can't single-step on gdb Hideo Saito
2008-08-12  2:22 ` Paul Mundt
2008-08-12  2:48 ` Paul Mundt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox