Re: [RFC PATCH] x86 single-step (TF) vs system calls & traps

From: Davide Libenzi
Date: Thu Jul 01 2004 - 16:49:02 EST


On Thu, 1 Jul 2004, Roland McGrath wrote:

> > Here I meant that if you set SINGLESTEP|SYSGOOD, the patch will give you
> > SIGTRAP|0x80, while if you set only SINGLESTEP the patch will give you
> > SIGTRAP. Enforcing the SINGLESTEP|SYSGOOD is invalid or only gives SIGTRAP
> > should be no more that three lines of code out of the fast path.
>
> There is no "set SINGLESTEP|SYSGOOD". PTRACE_SINGLESTEP is a one-time
> operation. PTRACE_O_TRACESYSGOOD is a persistent flag you set when you
> intend to at some point use the PTRACE_SYSCALL operation.

Allrighty ...

Andrew, per Roland suggestion, can you please add the patch below to the
bits you already have in -mm?


Signed-off-by: Davide Libenzi <davidel@xxxxxxxxxxxxxxx>



- Davide



--- a/arch/i386/kernel/ptrace.c 2004-07-01 14:30:38.000000000 -0700
+++ b/arch/i386/kernel/ptrace.c 2004-07-01 14:32:44.000000000 -0700
@@ -546,8 +546,8 @@
return;
/* 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)
- ? 0x80 : 0));
+ ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) &&
+ !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0));

/*
* this isn't the same as continuing with a signal, but it will do
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/