-/* Select frame FI, and note that its stack level is LEVEL.
- LEVEL may be -1 if an actual level number is not known. */
-
-void
-select_frame (struct frame_info *fi, int level)
-{
- register struct symtab *s;
-
- selected_frame = fi;
- selected_frame_level = level;
- /* FIXME: cagney/2002-04-05: It can't be this easy (and looking at
- the increasingly complex list of checkes, it wasn't)! GDB is
- dragging around, and constantly updating, the global variable
- selected_frame_level. Surely all that was needed was for the
- level to be computed direct from the frame (by counting back to
- the inner-most frame) or, as has been done here using a cached
- value. For moment, check that the expected and the actual level
- are consistent. If, after a few weeks, no one reports that this
- assertion has failed, the global selected_frame_level and many
- many parameters can all be deleted. */
- if (fi == NULL && level == -1)
- /* Ok. The target is clearing the selected frame as part of a
- cache flush. */
- ;
- else if (fi != NULL && fi->level == level)
- /* Ok. What you would expect. Level is redundant. */
- ;
- else if (fi != NULL && level == -1)
- /* Ok. See breakpoint.c. The watchpoint code changes the
- selected frame to the frame that contains the watchpoint and
- then, later changes it back to the old value. The -1 is used
- as a marker so that the watchpoint code can easily detect that
- things are not what they should be. Why the watchpoint code
- can't mindlessly save/restore the selected frame I don't know,
- hopefully it can be simplified that way. Hopefully the global
- selected_frame can be replaced by a frame parameter, making
- still more simplification possible. */
- ;
- else
- internal_error (__FILE__, __LINE__,
- "oops! fi=0x%p, fi->level=%d, level=%d",
- fi, fi ? fi->level : -1, level);
- if (selected_frame_level_changed_hook)
- selected_frame_level_changed_hook (level);
-
- /* Ensure that symbols for this frame are read in. Also, determine the
- source language of this frame, and switch to it if desired. */
- if (fi)
- {
- s = find_pc_symtab (fi->pc);
- if (s
- && s->language != current_language->la_language
- && s->language != language_unknown
- && language_mode == language_mode_auto)
- {
- set_language (s->language);
- }
- }
-}
-\f
-
-/* Select frame FI, noting that its stack level is LEVEL. Also print
- the stack frame and show the source if this is the tui version. */
-void
-select_and_print_frame (struct frame_info *fi, int level)