* thread.c (restore_selected_frame): On fail to restore, select
authorPedro Alves <palves@redhat.com>
Sun, 13 Jul 2008 19:25:58 +0000 (19:25 +0000)
committerPedro Alves <palves@redhat.com>
Sun, 13 Jul 2008 19:25:58 +0000 (19:25 +0000)
the innermost frame, and don't crash when warning the user.

gdb/ChangeLog
gdb/thread.c

index 2d28e92764228e841d5b6247e3f7693123c908df..dc44cc09dcae10949fa292023f66b870f772c11a 100644 (file)
@@ -1,3 +1,8 @@
+2008-07-13  Pedro Alves  <pedro@codesourcery.com>
+
+       * thread.c (restore_selected_frame): On fail to restore, select
+       the innermost frame, and don't crash when warning the user.
+
 2008-07-13  Hui Zhu  <teawater@gmail.com>
 
        * symtab.c (expand_line_sal): Fix a memory leak.
index 02ef6f1f9a9f9ea7269490076045198a00bd61c6..0767aa04b31826bb494cf0904af222dbeb825929 100644 (file)
@@ -938,8 +938,11 @@ restore_selected_frame (struct frame_id a_frame_id, int frame_level)
       return;
     }
 
-  /* Nothing else to do, the frame layout really changed.
-     Tell the user.  */
+  /* Nothing else to do, the frame layout really changed.  Select the
+     innermost stack frame.  */
+  select_frame (get_current_frame ());
+
+  /* Warn the user.  */
   if (!ui_out_is_mi_like_p (uiout))
     {
       warning (_("\
@@ -948,7 +951,7 @@ Couldn't restore frame #%d in current thread, at reparsed frame #0\n"),
       /* For MI, we should probably have a notification about
         current frame change.  But this error is not very
         likely, so don't bother for now.  */
-      print_stack_frame (frame, 1, SRC_LINE);
+      print_stack_frame (get_selected_frame (NULL), 1, SRC_LINE);
     }
 }
 
This page took 0.029922 seconds and 4 git commands to generate.