From: Andrew Cagney <cagney@gnu.org>
To: Andrew Cagney <ac131313@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [patch/rfc] Fix step/next across signals
Date: Mon, 30 Aug 2004 16:58:00 -0000 [thread overview]
Message-ID: <41335C76.6050803@gnu.org> (raw)
In-Reply-To: <412F5557.3000700@redhat.com>
I've checked this in.
Andrew
> Hello,
>
> The attached fixes a bug with step/next across signals. Given:
>
> Breakpoint at 10 hit
> 10 while (!done);
> (gdb) next
>
> when there was a signal pending (that set DONE), GDB would:
>
> Attempt to step of the breakpoint at "10":
> - pull all breakpoints
> - PT_STEP (to get off the BP instruction)
> - get back the signal instead
>
> Attempt to skip the signal handler:
> - add a step_resume_breakpoint at "10" the signal return addr
> - PT_STEP delivering the signal
> - insert all breakpoints (including step_resume)
> - PT_CONTINUE the inferior
> - get back SIGTRAP from the step_resume breakpoint
> - delete the step_resume bp
>
> Go back to doing the next:
> - PT_STEP the inferior (breakpoints including "10" still inserted)
> - re-hit "10"
>
> the problem is that GDB forgot that it was, at the time of the signal, trying to step off a breakpoint.
>
> The attached patch fixes this, it notes if/when it was stepping off a breakpoint, so that it can return to that task once the step-resume-breakpoint is hit.
>
> I've tested it on a my patched PPC/NetBSD kernel and it KPASSes 1757; and a vanila rhel3u2 system with no test changes.
>
> Since the 1757 KFAILs pass, I've removed them as `obvious'.
>
> comments?
> Andrew
>
>
>
> Index: testsuite/ChangeLog
> 2004-08-26 Andrew Cagney <cagney@gnu.org>
>
> * gdb.base/sigstep.exp (breakpoint_over_handler): Remove kfail
> gdb/1757.
>
> Index: ChangeLog
> 2004-08-26 Andrew Cagney <cagney@gnu.org>
>
> Fix PR breakpoints/1757.
> * infrun.c (struct execution_control_state): Replace
> remove_breakpoints_on_following_step with
> step_after_step_resume_breakpoint.
> (init_execution_control_state): Update.
> (handle_inferior_event): For signals, when stepping off a
> breakpoint, set step_after_step_resume_breakpoint. When
> BPSTAT_WHAT_STEP_RESUME, do a single-step off the breakpoint.
> (keep_going): Delete code handling
> remove_breakpoints_on_following_step.
>
prev parent reply other threads:[~2004-08-30 16:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-27 15:40 Andrew Cagney
2004-08-27 16:05 ` Daniel Jacobowitz
2004-08-27 16:10 ` Michael Chastain
2004-08-30 16:58 ` Andrew Cagney [this message]
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=41335C76.6050803@gnu.org \
--to=cagney@gnu.org \
--cc=ac131313@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/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