Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: [downstream patch FYI] workaround stale frame_info * (PR 13866)
Date: Tue, 05 Jun 2012 19:52:00 -0000	[thread overview]
Message-ID: <4FCE6360.5040307@redhat.com> (raw)
In-Reply-To: <4FCE5CDF.7070407@redhat.com>

On 06/05/2012 08:24 PM, Pedro Alves wrote:

> This fixes the crash.

I actually posted an outdated version before...  This version adds a little
comment.  I've applied it.

2012-06-05  Pedro Alves  <palves@redhat.com>

	PR backtrace/13866

	* breakpoint.c (until_break_command): Only fetch the selected
	frame after decode_line_1.
---
 gdb/breakpoint.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 5cc1f64..12db39b 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -10815,10 +10815,10 @@ until_break_command (char *arg, int from_tty, int anywhere)
 {
   struct symtabs_and_lines sals;
   struct symtab_and_line sal;
-  struct frame_info *frame = get_selected_frame (NULL);
-  struct gdbarch *frame_gdbarch = get_frame_arch (frame);
-  struct frame_id stack_frame_id = get_stack_frame_id (frame);
-  struct frame_id caller_frame_id = frame_unwind_caller_id (frame);
+  struct frame_info *frame;
+  struct gdbarch *frame_gdbarch;
+  struct frame_id stack_frame_id;
+  struct frame_id caller_frame_id;
   struct breakpoint *breakpoint;
   struct breakpoint *breakpoint2 = NULL;
   struct cleanup *old_chain;
@@ -10854,8 +10854,15 @@ until_break_command (char *arg, int from_tty, int anywhere)
 
   old_chain = make_cleanup (null_cleanup, NULL);
 
-  /* Installing a breakpoint invalidates the frame chain (as it may
-     need to switch threads), so do any frame handling first.  */
+  /* Note linespec handling above invalidates the frame chain.
+     Installing a breakpoint also invalidates the frame chain (as it
+     may need to switch threads), so do any frame handling before
+     that.  */
+
+  frame = get_selected_frame (NULL);
+  frame_gdbarch = get_frame_arch (frame);
+  stack_frame_id = get_stack_frame_id (frame);
+  caller_frame_id = frame_unwind_caller_id (frame);
 
   /* Keep within the current frame, or in frames called by the current
      one.  */


      reply	other threads:[~2012-06-05 19:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04 19:14 Jan Kratochvil
2012-05-18 17:44 ` Tom Tromey
2012-05-18 18:01   ` Pedro Alves
2012-05-18 18:04     ` Jan Kratochvil
2012-05-18 19:16     ` Tom Tromey
2012-06-05 19:17 ` Pedro Alves
2012-06-05 19:39   ` Jan Kratochvil
2012-06-05 19:41     ` Pedro Alves
2012-06-05 19:50     ` Pedro Alves
2012-06-06 19:38     ` Tom Tromey
2012-06-06 20:16       ` Pedro Alves
2012-06-05 19:24 ` Pedro Alves
2012-06-05 19:52   ` Pedro Alves [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=4FCE6360.5040307@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@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