diff --git a/gdb/frame.c b/gdb/frame.c index 5a6f107..0fd98ff 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1367,29 +1367,6 @@ unwind_to_current_frame (struct ui_out *ui_out, void *args) return 0; } -/* See frame.h. */ - -struct frame_info *get_current_frame_nocheck (void) -{ - if (current_frame == NULL) - { - struct frame_info *sentinel_frame = - create_sentinel_frame (current_program_space, get_current_regcache ()); - - if (catch_exceptions (current_uiout, unwind_to_current_frame, - sentinel_frame, RETURN_MASK_ERROR) != 0) - { - /* Oops! Fake a current frame? Is this useful? It has a PC - of zero, for instance. */ - current_frame = sentinel_frame; - } - } - - return current_frame; -} - -/* See frame.h. */ - struct frame_info * get_current_frame (void) { @@ -1415,7 +1392,19 @@ get_current_frame (void) error (_("Target is executing.")); } - return get_current_frame_nocheck (); + if (current_frame == NULL) + { + struct frame_info *sentinel_frame = + create_sentinel_frame (current_program_space, get_current_regcache ()); + if (catch_exceptions (current_uiout, unwind_to_current_frame, + sentinel_frame, RETURN_MASK_ERROR) != 0) + { + /* Oops! Fake a current frame? Is this useful? It has a PC + of zero, for instance. */ + current_frame = sentinel_frame; + } + } + return current_frame; } /* The "selected" stack frame is used by default for local and arg diff --git a/gdb/frame.h b/gdb/frame.h index cd2033d..f0da19e 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -242,10 +242,6 @@ enum frame_type error. */ extern struct frame_info *get_current_frame (void); -/* Similar to get_current_frame except that we omit all checks. May - return NULL if unwinding fails. */ -extern struct frame_info *get_current_frame_nocheck (void); - /* Does the current target interface have enough state to be able to query the current inferior for frame info, and is the inferior in a state where that is possible? */