From 0c501536332acda50bb3f9dfd46713e78845c82a Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Sun, 13 Jul 2008 19:25:58 +0000 Subject: [PATCH] * thread.c (restore_selected_frame): On fail to restore, select the innermost frame, and don't crash when warning the user. --- gdb/ChangeLog | 5 +++++ gdb/thread.c | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2d28e927642..dc44cc09dca 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-07-13 Pedro Alves + + * 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 * symtab.c (expand_line_sal): Fix a memory leak. diff --git a/gdb/thread.c b/gdb/thread.c index 02ef6f1f9a9..0767aa04b31 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); } } -- 2.30.2