From: Jim Blandy <jimb@red-bean.com>
To: ramana.radhakrishnan@codito.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: Fix for PR 1971 .
Date: Tue, 03 Jan 2006 23:43:00 -0000 [thread overview]
Message-ID: <8f2776cb0601031543g4fc5a45bj9cf367c82d6793b0@mail.gmail.com> (raw)
In-Reply-To: <8f2776cb0601031534p23c54aadkdccb840296911560@mail.gmail.com>
On 1/3/06, Jim Blandy <jimb@red-bean.com> wrote:
> On 1/3/06, Ramana Radhakrishnan <ramana.radhakrishnan@codito.com> wrote:
> > Attached is a fix for PR 1971. This inserts a breakpoint at the return
> > address for a function that does not have a previous frame which is what
> > you have in the case of main. This would however not stop after the
> > return from main because the semantics of the next command would not
> > stop the execution in any place where there is no debug information.
> >
> > Tested on native x86 with today's head as well as 6.4 branch with no
> > extra regressions .
>
> Is this the behavior we actually want? Where the user hasn't "set
> backtrace past-main on", isn't it the correct behavior for GDB to
> allow the program to exit when doing a 'next' out of main? (I assume
> that, if one does a 'set backtrace past-main on', then 'next' works as
> you suggest it should.)
Oh, wait. I might understand better now. The current behavior is a
segfault, as get_prev_frame returns NULL. The code you patched is
clearly wrong as it stands, since it doesn't account for that
possibility. The behavior with your patch is that 'next' from main
causes the program to run to completion when past-main is off, as I
suggested it ought. Right?
I see three uses of insert_step_resume_breakpoint_at_frame
(get_prev_frame (get_current_frame ())) in infrun.c; would it be
reasonable to add a new function in the
insert_step_resume_breakpoint_at_* family,
insert_step_resume_breakpoint_at_caller (say), that sets the
step-resume breakpoint at a sal built from the given frame's return
address?
I think you'd want to use frame_pc_unwind in that function, and not
gdbarch_unwind_pc.
next prev parent reply other threads:[~2006-01-03 23:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-03 18:41 Ramana Radhakrishnan
2006-01-03 23:34 ` Jim Blandy
2006-01-03 23:43 ` Jim Blandy [this message]
2006-01-04 5:07 ` Ramana Radhakrishnan
2006-01-04 5:55 ` Jim Blandy
2006-01-04 6:52 ` Ramana Radhakrishnan
2006-01-04 7:57 ` Jim Blandy
2006-01-04 8:27 ` Ramana Radhakrishnan
2006-01-04 13:56 ` Daniel Jacobowitz
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=8f2776cb0601031543g4fc5a45bj9cf367c82d6793b0@mail.gmail.com \
--to=jimb@red-bean.com \
--cc=gdb-patches@sources.redhat.com \
--cc=ramana.radhakrishnan@codito.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