aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-07-13 19:25:58 +0000
committerPedro Alves <palves@redhat.com>2008-07-13 19:25:58 +0000
commit0c501536332acda50bb3f9dfd46713e78845c82a (patch)
tree1c97675c6cf099f1094bfafa99a528e8ef9d71d0
parentdb009c8a0a47811360d9f346c8ee230cee647421 (diff)
downloadgdb-0c501536332acda50bb3f9dfd46713e78845c82a.zip
gdb-0c501536332acda50bb3f9dfd46713e78845c82a.tar.gz
gdb-0c501536332acda50bb3f9dfd46713e78845c82a.tar.bz2
* thread.c (restore_selected_frame): On fail to restore, select
the innermost frame, and don't crash when warning the user.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/thread.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2d28e92..dc44cc0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/thread.c b/gdb/thread.c
index 02ef6f1..0767aa0 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -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);
}
}