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 23:37:00 -0000 [thread overview]
Message-ID: <200812052336.52427.pedro@codesourcery.com> (raw)
In-Reply-To: <200812052243.13753.pedro@codesourcery.com>
[-- Attachment #1: Type: text/plain, Size: 344 bytes --]
On Friday 05 December 2008 22:43:13, Pedro Alves wrote:
> 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.
Might as well be consistent. Tested on x86-64-unknown-linux-gnu.
OK?
--
Pedro Alves
[-- Attachment #2: get_frame_pc.diff --]
[-- Type: text/x-diff, Size: 1513 bytes --]
2008-12-05 Pedro Alves <pedro@codesourcery.com>
* infcmd.c (until_next_command, finish_backward): Use get_frame_pc
instead of read_pc.
---
gdb/infcmd.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Index: src/gdb/infcmd.c
===================================================================
--- src.orig/gdb/infcmd.c 2008-12-05 23:02:12.000000000 +0000
+++ src/gdb/infcmd.c 2008-12-05 23:19:21.000000000 +0000
@@ -1181,7 +1181,7 @@ until_next_command (int from_tty)
than the current line (if in symbolic section) or pc (if
not). */
- pc = read_pc ();
+ pc = get_frame_pc (frame);
func = find_pc_function (pc);
if (!func)
@@ -1405,11 +1405,13 @@ finish_backward (struct symbol *function
struct thread_info *tp = inferior_thread ();
struct breakpoint *breakpoint;
struct cleanup *old_chain;
+ CORE_ADDR pc;
CORE_ADDR func_addr;
int back_up;
- if (find_pc_partial_function (get_frame_pc (get_current_frame ()),
- NULL, &func_addr, NULL) == 0)
+ pc = get_frame_pc (get_current_frame ());
+
+ if (find_pc_partial_function (pc, NULL, &func_addr, NULL) == 0)
internal_error (__FILE__, __LINE__,
_("Finish: couldn't find function."));
@@ -1426,7 +1428,7 @@ finish_backward (struct symbol *function
no way that a function up the stack can have a return address
that's equal to its entry point. */
- if (sal.pc != read_pc ())
+ if (sal.pc != pc)
{
/* Set breakpoint and continue. */
breakpoint =
next prev parent reply other threads:[~2008-12-05 23:37 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
2008-12-05 23:37 ` Pedro Alves [this message]
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=200812052336.52427.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