gdb/ChangeLog * frame.c (get_selected_frame): Move selected frame to current frame mapping to ... (select_frame): ... here. --- gdb/frame.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) Index: src/gdb/frame.c =================================================================== --- src.orig/gdb/frame.c 2007-03-18 23:22:10.000000000 +0000 +++ src/gdb/frame.c 2007-03-20 00:29:42.000000000 +0000 @@ -953,19 +953,6 @@ static struct frame_info *selected_frame struct frame_info * get_selected_frame (const char *message) { - if (selected_frame == NULL) - { - if (message != NULL && (!target_has_registers - || !target_has_stack - || !target_has_memory)) - error (("%s"), message); - /* Hey! Don't trust this. It should really be re-finding the - last selected frame of the currently selected thread. This, - though, is better than nothing. */ - select_frame (get_current_frame ()); - } - /* There is always a frame. */ - gdb_assert (selected_frame != NULL); return selected_frame; } @@ -994,6 +981,21 @@ select_frame (struct frame_info *fi) if (deprecated_selected_frame_level_changed_hook) deprecated_selected_frame_level_changed_hook (frame_relative_level (fi)); + if (fi == NULL) + { + if (!target_has_registers + || !target_has_stack + || !target_has_memory) + return; + + /* Hey! Don't trust this. It should really be re-finding the + last selected frame of the currently selected thread. This, + though, is better than nothing. */ + selected_frame = get_current_frame (); + } + /* There is always a frame. */ + gdb_assert (selected_frame != NULL); + /* FIXME: kseitz/2002-08-28: It would be nice to call selected_frame_level_changed_event() right here, but due to limitations in the current interfaces, we would end up flooding UIs with events