aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread.c
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 /gdb/thread.c
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.
Diffstat (limited to 'gdb/thread.c')
-rw-r--r--gdb/thread.c9
1 files changed, 6 insertions, 3 deletions
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);
}
}