* PTRACE_SINGLESTEP into signal handler
@ 2004-11-27 23:28 Ulrich Weigand
2004-11-28 1:26 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Weigand @ 2004-11-27 23:28 UTC (permalink / raw)
To: gdb
Hello,
I'm seeing failures in the sigstep.exp test case on s390:
FAIL: gdb.base/sigstep.exp: step on breakpoint, to handler entry; performing step
FAIL: gdb.base/sigstep.exp: next on breakpoint, to handler entry; performing next
FAIL: gdb.base/sigstep.exp: continue on breakpoint, to handler entry; performing continue
The reason for this appears to be that they set a breakpoint on the
very first instruction of a signal handler that is being stepped into
via PTRACE_SINGLESTEP. For some reason, while this is done, the
breakpoints are not actually inserted.
When the debugger next gets control, the first instruction of the
handler was already executed. Thus, while it now does insert the
breakpoint instructions, it is too late ...
Does gdb assume PTRACE_SINGLESTEP into a handle returns *before*
the first instruction of the handler was executed?
We could change the kernel to do that, and this fixes the test case
failures, but I'm not sure if this is the right thing to do --
the ptrace documentation says "arranges for the child to be stopped
after execution of a single instruction", which would appear to
indicate the current behaviour is correct.
How does this work on other platforms?
Mit freundlichen Gruessen / Best Regards
Ulrich Weigand
--
Dr. Ulrich Weigand
Linux for S/390 Design & Development
IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
Phone: +49-7031/16-3727 --- Email: Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PTRACE_SINGLESTEP into signal handler
2004-11-27 23:28 PTRACE_SINGLESTEP into signal handler Ulrich Weigand
@ 2004-11-28 1:26 ` Daniel Jacobowitz
2004-11-29 14:43 ` Ulrich Weigand
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2004-11-28 1:26 UTC (permalink / raw)
To: Ulrich Weigand; +Cc: gdb
On Fri, Nov 26, 2004 at 06:25:26PM +0100, Ulrich Weigand wrote:
> Does gdb assume PTRACE_SINGLESTEP into a handle returns *before*
> the first instruction of the handler was executed?
>
> We could change the kernel to do that, and this fixes the test case
> failures, but I'm not sure if this is the right thing to do --
> the ptrace documentation says "arranges for the child to be stopped
> after execution of a single instruction", which would appear to
> indicate the current behaviour is correct.
>
> How does this work on other platforms?
I'm pretty sure that the answer is yes - we should stop on the first
instruction. It does seem a little strange as a behavior when
requesting single-step to step no instructions, but we have no other
way to get to the beginning of the handler. i386 was changed recently.
--
Daniel Jacobowitz
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PTRACE_SINGLESTEP into signal handler
2004-11-28 1:26 ` Daniel Jacobowitz
@ 2004-11-29 14:43 ` Ulrich Weigand
2004-11-29 15:45 ` Andrew Cagney
0 siblings, 1 reply; 4+ messages in thread
From: Ulrich Weigand @ 2004-11-29 14:43 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb
Daniel Jacobowitz <drow@false.org> wrote on 11/28/2004 12:28:14 AM:
> I'm pretty sure that the answer is yes - we should stop on the first
> instruction. It does seem a little strange as a behavior when
> requesting single-step to step no instructions, but we have no other
> way to get to the beginning of the handler. i386 was changed recently.
Ok; so we'll change the s390 kernel to also stop at the beginning of
the handler. I've asked Martin to push the patch upstream.
Bye,
Ulrich
--
Dr. Ulrich Weigand
Linux for S/390 Design & Development
IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
Phone: +49-7031/16-3727 --- Email: Ulrich.Weigand@de.ibm.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PTRACE_SINGLESTEP into signal handler
2004-11-29 14:43 ` Ulrich Weigand
@ 2004-11-29 15:45 ` Andrew Cagney
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Cagney @ 2004-11-29 15:45 UTC (permalink / raw)
To: Ulrich Weigand; +Cc: Daniel Jacobowitz, gdb
Ulrich Weigand wrote:
>
>
>
> Daniel Jacobowitz <drow@false.org> wrote on 11/28/2004 12:28:14 AM:
>
>
>>I'm pretty sure that the answer is yes - we should stop on the first
>>instruction. It does seem a little strange as a behavior when
>>requesting single-step to step no instructions, but we have no other
>>way to get to the beginning of the handler. i386 was changed recently.
Yes, I, Roland, Woodhouse (and?) have been quietly working through this
for PPC, amd64 and i386; I guess it's time to make some noise ;-)
> Ok; so we'll change the s390 kernel to also stop at the beginning of
> the handler. I've asked Martin to push the patch upstream.
Ref: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=133799
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-11-29 15:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-27 23:28 PTRACE_SINGLESTEP into signal handler Ulrich Weigand
2004-11-28 1:26 ` Daniel Jacobowitz
2004-11-29 14:43 ` Ulrich Weigand
2004-11-29 15:45 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox