From: Pedro Alves Date: Sun, 13 Jul 2008 19:25:58 +0000 (+0000) Subject: * thread.c (restore_selected_frame): On fail to restore, select X-Git-Tag: sid-snapshot-20080801~171 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0c501536332acda50bb3f9dfd46713e78845c82a;p=external%2Fbinutils.git * thread.c (restore_selected_frame): On fail to restore, select the innermost frame, and don't crash when warning the user. --- 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 + + * 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 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); } }