From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Daniel Jacobowitz <drow@false.org>,
Ulrich Weigand <uweigand@de.ibm.com>
Subject: Re: Set the stepping range from the function@PC, not@stop_pc.
Date: Fri, 05 Dec 2008 22:43:00 -0000 [thread overview]
Message-ID: <200812052243.13753.pedro@codesourcery.com> (raw)
In-Reply-To: <20081205204328.GA4373@caradoc.them.org>
[-- Attachment #1: Type: text/plain, Size: 557 bytes --]
On Friday 05 December 2008 20:43:28, Daniel Jacobowitz wrote:
> On Fri, Dec 05, 2008 at 09:30:38PM +0100, Ulrich Weigand wrote:
> > > I think it's obvious after the discussion, but I'd still like to
> > > have your approval. OK? Any objections?
> >
> > It might be better to use get_frame_pc (frame) instead of read_pc (),
>
> Yes, please.
>
Good idea. I wonder if this I've checked this in then. There are two
other instances of read_pc in infcmd.c that could use the same idiom --- I
guess these calls predate the sentinel frame.
--
Pedro Alves
[-- Attachment #2: step_func_pc.diff --]
[-- Type: text/x-diff, Size: 1706 bytes --]
2008-12-05 Pedro Alves <pedro@codesourcery.com>
* infcmd.c (step_1, step_once): Look up the stepping range based
on the current frame's PC, not on stop_pc.
---
gdb/infcmd.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
Index: src/gdb/infcmd.c
===================================================================
--- src.orig/gdb/infcmd.c 2008-12-05 20:03:59.000000000 +0000
+++ src/gdb/infcmd.c 2008-12-05 21:42:56.000000000 +0000
@@ -812,12 +812,15 @@ step_1 (int skip_subroutines, int single
if (!single_inst)
{
- find_pc_line_pc_range (stop_pc,
+ CORE_ADDR pc;
+
+ pc = get_frame_pc (frame);
+ find_pc_line_pc_range (pc,
&tp->step_range_start, &tp->step_range_end);
if (tp->step_range_end == 0)
{
char *name;
- if (find_pc_partial_function (stop_pc, &name,
+ if (find_pc_partial_function (pc, &name,
&tp->step_range_start,
&tp->step_range_end) == 0)
error (_("Cannot find bounds of current function"));
@@ -932,7 +935,10 @@ step_once (int skip_subroutines, int sin
if (!single_inst)
{
- find_pc_line_pc_range (stop_pc,
+ CORE_ADDR pc;
+
+ pc = get_frame_pc (frame);
+ find_pc_line_pc_range (pc,
&tp->step_range_start, &tp->step_range_end);
/* If we have no line info, switch to stepi mode. */
@@ -943,7 +949,7 @@ step_once (int skip_subroutines, int sin
else if (tp->step_range_end == 0)
{
char *name;
- if (find_pc_partial_function (stop_pc, &name,
+ if (find_pc_partial_function (pc, &name,
&tp->step_range_start,
&tp->step_range_end) == 0)
error (_("Cannot find bounds of current function"));
next prev parent reply other threads:[~2008-12-05 22:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-05 19:47 Set the stepping range from the function at PC, not at stop_pc Pedro Alves
2008-12-05 20:31 ` Set the stepping range from the function@PC, not@stop_pc Ulrich Weigand
2008-12-05 20:44 ` Daniel Jacobowitz
2008-12-05 22:43 ` Pedro Alves [this message]
2008-12-05 23:37 ` Pedro Alves
2008-12-10 21:27 ` Pedro Alves
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=200812052243.13753.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.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