* frame.c (deprecated_selected_frame): Rename to...

(selected_frame): ...this.  Make static.
	(get_selected_frame, select_frame): Update.
	* frame.h (deprected_select_frame): Delete.
	(deprecated_safe_get_selected_frame): Update comments.

	* breakpoint.c, cli/cli-cmds.c, f-valprint.c, infcmd.c, inflow.c,
	infrun.c, stack.c, tui/tui-disasm.c, tui/tui-source.c,
	tui/tui-winsource.c, valops.c, varobj.c, findvar.c, macroscope.c,
	parse.c, regcache.h, sh64-tdep.c, tui/tui-hooks.c, tui/tui-win.c,
	tui/tui.c: Replace references to deprecated_selected_frame.
This commit is contained in:
Daniel Jacobowitz 2007-02-27 19:46:04 +00:00
parent e1c9b6f16a
commit 206415a3ea
23 changed files with 106 additions and 130 deletions

View file

@ -1,3 +1,17 @@
2007-02-27 Daniel Jacobowitz <dan@codesourcery.com>
* frame.c (deprecated_selected_frame): Rename to...
(selected_frame): ...this. Make static.
(get_selected_frame, select_frame): Update.
* frame.h (deprected_select_frame): Delete.
(deprecated_safe_get_selected_frame): Update comments.
* breakpoint.c, cli/cli-cmds.c, f-valprint.c, infcmd.c, inflow.c,
infrun.c, stack.c, tui/tui-disasm.c, tui/tui-source.c,
tui/tui-winsource.c, valops.c, varobj.c, findvar.c, macroscope.c,
parse.c, regcache.h, sh64-tdep.c, tui/tui-hooks.c, tui/tui-win.c,
tui/tui.c: Replace references to deprecated_selected_frame.
2007-02-27 Fred Fish <fnf@specifix.com> 2007-02-27 Fred Fish <fnf@specifix.com>
* rs6000-tdep.c (skip_prologue): Recognize addi instructions that * rs6000-tdep.c (skip_prologue): Recognize addi instructions that

View file

@ -1045,7 +1045,7 @@ Note: automatically using hardware breakpoints for read-only addresses.\n"));
/* FIXME drow/2003-09-09: It would be nice if evaluate_expression /* FIXME drow/2003-09-09: It would be nice if evaluate_expression
took a frame parameter, so that we didn't have to change the took a frame parameter, so that we didn't have to change the
selected frame. */ selected frame. */
saved_frame_id = get_frame_id (deprecated_selected_frame); saved_frame_id = get_frame_id (get_selected_frame (NULL));
/* Determine if the watchpoint is within scope. */ /* Determine if the watchpoint is within scope. */
if (bpt->owner->exp_valid_block == NULL) if (bpt->owner->exp_valid_block == NULL)
@ -6053,7 +6053,8 @@ until_break_command (char *arg, int from_tty, int anywhere)
{ {
struct symtabs_and_lines sals; struct symtabs_and_lines sals;
struct symtab_and_line sal; struct symtab_and_line sal;
struct frame_info *prev_frame = get_prev_frame (deprecated_selected_frame); struct frame_info *frame = get_selected_frame (NULL);
struct frame_info *prev_frame = get_prev_frame (frame);
struct breakpoint *breakpoint; struct breakpoint *breakpoint;
struct cleanup *old_chain; struct cleanup *old_chain;
struct continuation_arg *arg1; struct continuation_arg *arg1;
@ -6089,8 +6090,7 @@ until_break_command (char *arg, int from_tty, int anywhere)
else else
/* Otherwise, specify the current frame, because we want to stop only /* Otherwise, specify the current frame, because we want to stop only
at the very same frame. */ at the very same frame. */
breakpoint = set_momentary_breakpoint (sal, breakpoint = set_momentary_breakpoint (sal, get_frame_id (frame),
get_frame_id (deprecated_selected_frame),
bp_until); bp_until);
if (!target_can_async_p ()) if (!target_can_async_p ())

View file

@ -915,10 +915,7 @@ disassemble_command (char *arg, int from_tty)
name = NULL; name = NULL;
if (!arg) if (!arg)
{ {
if (!deprecated_selected_frame) pc = get_frame_pc (get_selected_frame (_("No frame selected.")));
error (_("No frame selected."));
pc = get_frame_pc (deprecated_selected_frame);
if (find_pc_partial_function (pc, &name, &low, &high) == 0) if (find_pc_partial_function (pc, &name, &low, &high) == 0)
error (_("No function contains program counter for selected frame.")); error (_("No function contains program counter for selected frame."));
#if defined(TUI) #if defined(TUI)

View file

@ -65,13 +65,15 @@ int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
int int
f77_get_dynamic_lowerbound (struct type *type, int *lower_bound) f77_get_dynamic_lowerbound (struct type *type, int *lower_bound)
{ {
struct frame_info *frame;
CORE_ADDR current_frame_addr; CORE_ADDR current_frame_addr;
CORE_ADDR ptr_to_lower_bound; CORE_ADDR ptr_to_lower_bound;
switch (TYPE_ARRAY_LOWER_BOUND_TYPE (type)) switch (TYPE_ARRAY_LOWER_BOUND_TYPE (type))
{ {
case BOUND_BY_VALUE_ON_STACK: case BOUND_BY_VALUE_ON_STACK:
current_frame_addr = get_frame_base (deprecated_selected_frame); frame = deprecated_safe_get_selected_frame ();
current_frame_addr = get_frame_base (frame);
if (current_frame_addr > 0) if (current_frame_addr > 0)
{ {
*lower_bound = *lower_bound =
@ -95,7 +97,8 @@ f77_get_dynamic_lowerbound (struct type *type, int *lower_bound)
break; break;
case BOUND_BY_REF_ON_STACK: case BOUND_BY_REF_ON_STACK:
current_frame_addr = get_frame_base (deprecated_selected_frame); frame = deprecated_safe_get_selected_frame ();
current_frame_addr = get_frame_base (frame);
if (current_frame_addr > 0) if (current_frame_addr > 0)
{ {
ptr_to_lower_bound = ptr_to_lower_bound =
@ -123,13 +126,15 @@ f77_get_dynamic_lowerbound (struct type *type, int *lower_bound)
int int
f77_get_dynamic_upperbound (struct type *type, int *upper_bound) f77_get_dynamic_upperbound (struct type *type, int *upper_bound)
{ {
struct frame_info *frame;
CORE_ADDR current_frame_addr = 0; CORE_ADDR current_frame_addr = 0;
CORE_ADDR ptr_to_upper_bound; CORE_ADDR ptr_to_upper_bound;
switch (TYPE_ARRAY_UPPER_BOUND_TYPE (type)) switch (TYPE_ARRAY_UPPER_BOUND_TYPE (type))
{ {
case BOUND_BY_VALUE_ON_STACK: case BOUND_BY_VALUE_ON_STACK:
current_frame_addr = get_frame_base (deprecated_selected_frame); frame = deprecated_safe_get_selected_frame ();
current_frame_addr = get_frame_base (frame);
if (current_frame_addr > 0) if (current_frame_addr > 0)
{ {
*upper_bound = *upper_bound =
@ -158,7 +163,8 @@ f77_get_dynamic_upperbound (struct type *type, int *upper_bound)
break; break;
case BOUND_BY_REF_ON_STACK: case BOUND_BY_REF_ON_STACK:
current_frame_addr = get_frame_base (deprecated_selected_frame); frame = deprecated_safe_get_selected_frame ();
current_frame_addr = get_frame_base (frame);
if (current_frame_addr > 0) if (current_frame_addr > 0)
{ {
ptr_to_upper_bound = ptr_to_upper_bound =
@ -643,10 +649,7 @@ info_common_command (char *comname, int from_tty)
first make sure that it is visible and if so, let first make sure that it is visible and if so, let
us display its contents */ us display its contents */
fi = deprecated_selected_frame; fi = get_selected_frame (_("No frame selected"));
if (fi == NULL)
error (_("No frame selected"));
/* The following is generally ripped off from stack.c's routine /* The following is generally ripped off from stack.c's routine
print_frame_info() */ print_frame_info() */
@ -735,10 +738,7 @@ there_is_a_visible_common_named (char *comname)
if (comname == NULL) if (comname == NULL)
error (_("Cannot deal with NULL common name!")); error (_("Cannot deal with NULL common name!"));
fi = deprecated_selected_frame; fi = get_selected_frame (_("No frame selected"));
if (fi == NULL)
error (_("No frame selected"));
/* The following is generally ripped off from stack.c's routine /* The following is generally ripped off from stack.c's routine
print_frame_info() */ print_frame_info() */

View file

@ -378,7 +378,7 @@ symbol_read_needs_frame (struct symbol *sym)
and a stack frame id, read the value of the variable and a stack frame id, read the value of the variable
and return a (pointer to a) struct value containing the value. and return a (pointer to a) struct value containing the value.
If the variable cannot be found, return a zero pointer. If the variable cannot be found, return a zero pointer.
If FRAME is NULL, use the deprecated_selected_frame. */ If FRAME is NULL, use the selected frame. */
struct value * struct value *
read_var_value (struct symbol *var, struct frame_info *frame) read_var_value (struct symbol *var, struct frame_info *frame)

View file

@ -935,7 +935,7 @@ get_current_frame (void)
/* The "selected" stack frame is used by default for local and arg /* The "selected" stack frame is used by default for local and arg
access. May be zero, for no selected frame. */ access. May be zero, for no selected frame. */
struct frame_info *deprecated_selected_frame; static struct frame_info *selected_frame;
/* Return the selected frame. Always non-NULL (unless there isn't an /* Return the selected frame. Always non-NULL (unless there isn't an
inferior sufficient for creating a frame) in which case an error is inferior sufficient for creating a frame) in which case an error is
@ -944,7 +944,7 @@ struct frame_info *deprecated_selected_frame;
struct frame_info * struct frame_info *
get_selected_frame (const char *message) get_selected_frame (const char *message)
{ {
if (deprecated_selected_frame == NULL) if (selected_frame == NULL)
{ {
if (message != NULL && (!target_has_registers if (message != NULL && (!target_has_registers
|| !target_has_stack || !target_has_stack
@ -956,8 +956,8 @@ get_selected_frame (const char *message)
select_frame (get_current_frame ()); select_frame (get_current_frame ());
} }
/* There is always a frame. */ /* There is always a frame. */
gdb_assert (deprecated_selected_frame != NULL); gdb_assert (selected_frame != NULL);
return deprecated_selected_frame; return selected_frame;
} }
/* This is a variant of get_selected_frame() which can be called when /* This is a variant of get_selected_frame() which can be called when
@ -979,7 +979,7 @@ select_frame (struct frame_info *fi)
{ {
struct symtab *s; struct symtab *s;
deprecated_selected_frame = fi; selected_frame = fi;
/* NOTE: cagney/2002-05-04: FI can be NULL. This occurs when the /* NOTE: cagney/2002-05-04: FI can be NULL. This occurs when the
frame is being invalidated. */ frame is being invalidated. */
if (deprecated_selected_frame_level_changed_hook) if (deprecated_selected_frame_level_changed_hook)

View file

@ -665,10 +665,10 @@ extern void (*deprecated_selected_frame_level_changed_hook) (int);
extern void return_command (char *, int); extern void return_command (char *, int);
/* NOTE: cagney/2002-11-27: /* Notes (cagney/2002-11-27, drow/2003-09-06):
You might think that the below global can simply be replaced by a You might think that calls to this function can simply be replaced by a
call to either get_selected_frame() or select_frame(). call to get_selected_frame().
Unfortunately, it isn't that easy. Unfortunately, it isn't that easy.
@ -680,25 +680,17 @@ extern void return_command (char *, int);
The only real exceptions occur at the edge (in the CLI code) where The only real exceptions occur at the edge (in the CLI code) where
user commands need to pick up the selected frame before proceeding. user commands need to pick up the selected frame before proceeding.
There are also some functions called with a NULL frame meaning either "the
program is not running" or "use the selected frame".
This is important. GDB is trying to stamp out the hack: This is important. GDB is trying to stamp out the hack:
saved_frame = deprecated_selected_frame; saved_frame = deprecated_safe_get_selected_frame ();
deprecated_selected_frame = ...; select_frame (...);
hack_using_global_selected_frame (); hack_using_global_selected_frame ();
deprecated_selected_frame = saved_frame; select_frame (saved_frame);
Take care! */ Take care!
extern struct frame_info *deprecated_selected_frame;
/* NOTE: drow/2003-09-06:
This function is "a step sideways" for uses of deprecated_selected_frame.
They should be fixed as above, but meanwhile, we needed a solution for
cases where functions are called with a NULL frame meaning either "the
program is not running" or "use the selected frame". Lazy building of
deprecated_selected_frame confuses the situation, because now
deprecated_selected_frame can be NULL even when the inferior is running.
This function calls get_selected_frame if the inferior should have a This function calls get_selected_frame if the inferior should have a
frame, or returns NULL otherwise. */ frame, or returns NULL otherwise. */

View file

@ -1295,10 +1295,8 @@ finish_command (char *arg, int from_tty)
error (_("The \"finish\" command does not take any arguments.")); error (_("The \"finish\" command does not take any arguments."));
if (!target_has_execution) if (!target_has_execution)
error (_("The program is not running.")); error (_("The program is not running."));
if (deprecated_selected_frame == NULL)
error (_("No selected frame."));
frame = get_prev_frame (deprecated_selected_frame); frame = get_prev_frame (get_selected_frame (_("No selected frame.")));
if (frame == 0) if (frame == 0)
error (_("\"finish\" not meaningful in the outermost frame.")); error (_("\"finish\" not meaningful in the outermost frame."));
@ -1316,7 +1314,7 @@ finish_command (char *arg, int from_tty)
/* Find the function we will return from. */ /* Find the function we will return from. */
function = find_pc_function (get_frame_pc (deprecated_selected_frame)); function = find_pc_function (get_frame_pc (get_selected_frame (NULL)));
/* Print info on the selected frame, including level number but not /* Print info on the selected frame, including level number but not
source. */ source. */
@ -1677,18 +1675,18 @@ default_print_registers_info (struct gdbarch *gdbarch,
void void
registers_info (char *addr_exp, int fpregs) registers_info (char *addr_exp, int fpregs)
{ {
struct frame_info *frame;
int regnum, numregs; int regnum, numregs;
char *end; char *end;
if (!target_has_registers) if (!target_has_registers)
error (_("The program has no registers now.")); error (_("The program has no registers now."));
if (deprecated_selected_frame == NULL) frame = get_selected_frame (NULL);
error (_("No selected frame."));
if (!addr_exp) if (!addr_exp)
{ {
gdbarch_print_registers_info (current_gdbarch, gdb_stdout, gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
deprecated_selected_frame, -1, fpregs); frame, -1, fpregs);
return; return;
} }
@ -1721,12 +1719,12 @@ registers_info (char *addr_exp, int fpregs)
/* A register name? */ /* A register name? */
{ {
int regnum = frame_map_name_to_regnum (deprecated_selected_frame, int regnum = frame_map_name_to_regnum (frame,
start, end - start); start, end - start);
if (regnum >= 0) if (regnum >= 0)
{ {
gdbarch_print_registers_info (current_gdbarch, gdb_stdout, gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
deprecated_selected_frame, regnum, fpregs); frame, regnum, fpregs);
continue; continue;
} }
} }
@ -1740,7 +1738,7 @@ registers_info (char *addr_exp, int fpregs)
&& regnum < NUM_REGS + NUM_PSEUDO_REGS) && regnum < NUM_REGS + NUM_PSEUDO_REGS)
{ {
gdbarch_print_registers_info (current_gdbarch, gdb_stdout, gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
deprecated_selected_frame, regnum, fpregs); frame, regnum, fpregs);
continue; continue;
} }
} }
@ -1766,7 +1764,7 @@ registers_info (char *addr_exp, int fpregs)
if (gdbarch_register_reggroup_p (current_gdbarch, regnum, if (gdbarch_register_reggroup_p (current_gdbarch, regnum,
group)) group))
gdbarch_print_registers_info (current_gdbarch, gdbarch_print_registers_info (current_gdbarch,
gdb_stdout, deprecated_selected_frame, gdb_stdout, frame,
regnum, fpregs); regnum, fpregs);
} }
continue; continue;
@ -1794,11 +1792,6 @@ static void
print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, print_vector_info (struct gdbarch *gdbarch, struct ui_file *file,
struct frame_info *frame, const char *args) struct frame_info *frame, const char *args)
{ {
if (!target_has_registers)
error (_("The program has no registers now."));
if (deprecated_selected_frame == NULL)
error (_("No selected frame."));
if (gdbarch_print_vector_info_p (gdbarch)) if (gdbarch_print_vector_info_p (gdbarch))
gdbarch_print_vector_info (gdbarch, file, frame, args); gdbarch_print_vector_info (gdbarch, file, frame, args);
else else
@ -1822,7 +1815,11 @@ print_vector_info (struct gdbarch *gdbarch, struct ui_file *file,
static void static void
vector_info (char *args, int from_tty) vector_info (char *args, int from_tty)
{ {
print_vector_info (current_gdbarch, gdb_stdout, deprecated_selected_frame, args); if (!target_has_registers)
error (_("The program has no registers now."));
print_vector_info (current_gdbarch, gdb_stdout,
get_selected_frame (NULL), args);
} }
@ -2012,11 +2009,6 @@ static void
print_float_info (struct gdbarch *gdbarch, struct ui_file *file, print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
struct frame_info *frame, const char *args) struct frame_info *frame, const char *args)
{ {
if (!target_has_registers)
error (_("The program has no registers now."));
if (deprecated_selected_frame == NULL)
error (_("No selected frame."));
if (gdbarch_print_float_info_p (gdbarch)) if (gdbarch_print_float_info_p (gdbarch))
gdbarch_print_float_info (gdbarch, file, frame, args); gdbarch_print_float_info (gdbarch, file, frame, args);
else else
@ -2041,8 +2033,11 @@ No floating-point info available for this processor.\n");
static void static void
float_info (char *args, int from_tty) float_info (char *args, int from_tty)
{ {
if (!target_has_registers)
error (_("The program has no registers now."));
print_float_info (current_gdbarch, gdb_stdout, print_float_info (current_gdbarch, gdb_stdout,
deprecated_selected_frame, args); get_selected_frame (NULL), args);
} }
static void static void

View file

@ -588,9 +588,6 @@ kill_command (char *arg, int from_tty)
if (target_has_stack) if (target_has_stack)
{ {
printf_filtered (_("In %s,\n"), target_longname); printf_filtered (_("In %s,\n"), target_longname);
if (deprecated_selected_frame == NULL)
fputs_filtered ("No selected stack frame.\n", gdb_stdout);
else
print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC); print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC);
} }
bfd_cache_close_all (); bfd_cache_close_all ();

View file

@ -3173,7 +3173,7 @@ Further execution is probably impossible.\n"));
bpstat_print() contains the logic deciding in detail bpstat_print() contains the logic deciding in detail
what to print, based on the event(s) that just occurred. */ what to print, based on the event(s) that just occurred. */
if (stop_print_frame && deprecated_selected_frame) if (stop_print_frame)
{ {
int bpstat_ret; int bpstat_ret;
int source_flag; int source_flag;
@ -3692,7 +3692,7 @@ save_inferior_status (int restore_stack_info)
inf_status->registers = regcache_dup (current_regcache); inf_status->registers = regcache_dup (current_regcache);
inf_status->selected_frame_id = get_frame_id (deprecated_selected_frame); inf_status->selected_frame_id = get_frame_id (get_selected_frame (NULL));
return inf_status; return inf_status;
} }

View file

@ -84,17 +84,14 @@ default_macro_scope (void)
{ {
struct symtab_and_line sal; struct symtab_and_line sal;
struct macro_scope *ms; struct macro_scope *ms;
struct frame_info *frame;
/* If there's a selected frame, use its PC. */ /* If there's a selected frame, use its PC. */
if (deprecated_selected_frame) frame = deprecated_safe_get_selected_frame ();
sal = find_pc_line (get_frame_pc (deprecated_selected_frame), 0); if (frame)
sal = find_pc_line (get_frame_pc (frame), 0);
/* If the target has any registers at all, then use its PC. Why we /* Fall back to the current listing position. */
would have registers but no stack, I'm not sure. */
else if (target_has_registers)
sal = find_pc_line (read_pc (), 0);
/* If all else fails, fall back to the current listing position. */
else else
{ {
/* Don't call select_source_symtab here. That can raise an /* Don't call select_source_symtab here. That can raise an

View file

@ -509,7 +509,7 @@ write_dollar_variable (struct stoken str)
/* Handle tokens that refer to machine registers: /* Handle tokens that refer to machine registers:
$ followed by a register name. */ $ followed by a register name. */
i = frame_map_name_to_regnum (deprecated_selected_frame, i = frame_map_name_to_regnum (deprecated_safe_get_selected_frame (),
str.ptr + 1, str.length - 1); str.ptr + 1, str.length - 1);
if (i >= 0) if (i >= 0)
goto handle_register; goto handle_register;

View file

@ -163,7 +163,7 @@ extern void regcache_cpy_no_passthrough (struct regcache *dest, struct regcache
simple substitution is required when updating the code. The simple substitution is required when updating the code. The
change, as far as practical, should avoid adding references to change, as far as practical, should avoid adding references to
global variables (e.g., current_regcache, current_frame, global variables (e.g., current_regcache, current_frame,
current_gdbarch or deprecated_selected_frame) and instead refer to current_gdbarch or the selected frame) and instead refer to
the FRAME or REGCACHE that has been passed into the containing the FRAME or REGCACHE that has been passed into the containing
function as parameters. Consequently, the change typically function as parameters. Consequently, the change typically
involves modifying the containing function so that it takes a FRAME involves modifying the containing function so that it takes a FRAME

View file

@ -1408,8 +1408,7 @@ sh64_show_compact_regs (void)
void void
sh64_show_regs (void) sh64_show_regs (void)
{ {
if (deprecated_selected_frame if (pc_is_isa32 (get_frame_pc (get_selected_frame (NULL))))
&& pc_is_isa32 (get_frame_pc (deprecated_selected_frame)))
sh64_show_media_regs (); sh64_show_media_regs ();
else else
sh64_show_compact_regs (); sh64_show_compact_regs ();

View file

@ -1592,24 +1592,7 @@ get_selected_block (CORE_ADDR *addr_in_block)
if (!target_has_stack) if (!target_has_stack)
return 0; return 0;
/* NOTE: cagney/2002-11-28: Why go to all this effort to not create return get_frame_block (get_selected_frame (NULL), addr_in_block);
a selected/current frame? Perhaps this function is called,
indirectly, by WFI in "infrun.c" where avoiding the creation of
an inner most frame is very important (it slows down single
step). I suspect, though that this was true in the deep dark
past but is no longer the case. A mindless look at all the
callers tends to support this theory. I think we should be able
to assume that there is always a selcted frame. */
/* gdb_assert (deprecated_selected_frame != NULL); So, do you feel
lucky? */
if (!deprecated_selected_frame)
{
CORE_ADDR pc = read_pc ();
if (addr_in_block != NULL)
*addr_in_block = pc;
return block_for_pc (pc);
}
return get_frame_block (deprecated_selected_frame, addr_in_block);
} }
/* Find a frame a certain number of levels away from FRAME. /* Find a frame a certain number of levels away from FRAME.
@ -1933,7 +1916,7 @@ func_command (char *arg, int from_tty)
if (!found) if (!found)
printf_filtered (_("'%s' not within current stack frame.\n"), arg); printf_filtered (_("'%s' not within current stack frame.\n"), arg);
else if (frame != deprecated_selected_frame) else if (frame != get_selected_frame (NULL))
select_and_print_frame (frame); select_and_print_frame (frame);
} }
@ -1942,7 +1925,7 @@ func_command (char *arg, int from_tty)
enum language enum language
get_frame_language (void) get_frame_language (void)
{ {
struct frame_info *frame = deprecated_selected_frame; struct frame_info *frame = deprecated_safe_get_selected_frame ();
if (frame) if (frame)
{ {

View file

@ -386,7 +386,7 @@ tui_vertical_disassem_scroll (enum tui_scroll_direction scroll_direction,
content = (tui_win_content) TUI_DISASM_WIN->generic.content; content = (tui_win_content) TUI_DISASM_WIN->generic.content;
if (cursal.symtab == (struct symtab *) NULL) if (cursal.symtab == (struct symtab *) NULL)
s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); s = find_pc_symtab (get_frame_pc (get_selected_frame (NULL)));
else else
s = cursal.symtab; s = cursal.symtab;

View file

@ -132,8 +132,8 @@ tui_registers_changed_hook (void)
{ {
struct frame_info *fi; struct frame_info *fi;
fi = deprecated_selected_frame; fi = get_selected_frame (NULL);
if (fi && tui_refreshing_registers == 0) if (tui_refreshing_registers == 0)
{ {
tui_refreshing_registers = 1; tui_refreshing_registers = 1;
#if 0 #if 0
@ -148,8 +148,8 @@ tui_register_changed_hook (int regno)
{ {
struct frame_info *fi; struct frame_info *fi;
fi = deprecated_selected_frame; fi = get_selected_frame (NULL);
if (fi && tui_refreshing_registers == 0) if (tui_refreshing_registers == 0)
{ {
tui_refreshing_registers = 1; tui_refreshing_registers = 1;
tui_check_data_values (fi); tui_check_data_values (fi);
@ -230,7 +230,7 @@ tui_selected_frame_level_changed_hook (int level)
{ {
struct frame_info *fi; struct frame_info *fi;
fi = deprecated_selected_frame; fi = get_selected_frame (NULL);
/* Ensure that symbols for this frame are read in. Also, determine the /* Ensure that symbols for this frame are read in. Also, determine the
source language of this frame, and switch to it if desired. */ source language of this frame, and switch to it if desired. */
if (fi) if (fi)
@ -264,7 +264,7 @@ tui_print_frame_info_listing_hook (struct symtab *s, int line,
int stopline, int noerror) int stopline, int noerror)
{ {
select_source_symtab (s); select_source_symtab (s);
tui_show_frame_info (deprecated_selected_frame); tui_show_frame_info (get_selected_frame (NULL));
} }
/* Called when the target process died or is detached. /* Called when the target process died or is detached.

View file

@ -338,7 +338,7 @@ tui_vertical_source_scroll (enum tui_scroll_direction scroll_direction,
struct symtab_and_line cursal = get_current_source_symtab_and_line (); struct symtab_and_line cursal = get_current_source_symtab_and_line ();
if (cursal.symtab == (struct symtab *) NULL) if (cursal.symtab == (struct symtab *) NULL)
s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); s = find_pc_symtab (get_frame_pc (get_selected_frame (NULL)));
else else
s = cursal.symtab; s = cursal.symtab;

View file

@ -1328,13 +1328,13 @@ make_visible_with_new_height (struct tui_win_info * win_info)
tui_free_win_content (&win_info->generic); tui_free_win_content (&win_info->generic);
tui_update_source_window (win_info, cursal.symtab, line_or_addr, TRUE); tui_update_source_window (win_info, cursal.symtab, line_or_addr, TRUE);
} }
else if (deprecated_selected_frame != (struct frame_info *) NULL) else if (deprecated_safe_get_selected_frame () != NULL)
{ {
struct tui_line_or_address line; struct tui_line_or_address line;
struct symtab_and_line cursal = get_current_source_symtab_and_line (); struct symtab_and_line cursal = get_current_source_symtab_and_line ();
struct frame_info *frame = deprecated_safe_get_selected_frame ();
s = find_pc_symtab (get_frame_pc (frame));
s = find_pc_symtab (get_frame_pc (deprecated_selected_frame));
if (win_info->generic.type == SRC_WIN) if (win_info->generic.type == SRC_WIN)
{ {
line.loa = LOA_LINE; line.loa = LOA_LINE;

View file

@ -314,7 +314,7 @@ tui_horizontal_source_scroll (struct tui_win_info * win_info,
struct symtab_and_line cursal = get_current_source_symtab_and_line (); struct symtab_and_line cursal = get_current_source_symtab_and_line ();
if (cursal.symtab == (struct symtab *) NULL) if (cursal.symtab == (struct symtab *) NULL)
s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); s = find_pc_symtab (get_frame_pc (get_selected_frame (NULL)));
else else
s = cursal.symtab; s = cursal.symtab;

View file

@ -408,8 +408,8 @@ tui_enable (void)
tui_setup_io (1); tui_setup_io (1);
tui_active = 1; tui_active = 1;
if (deprecated_selected_frame) if (deprecated_safe_get_selected_frame ())
tui_show_frame_info (deprecated_selected_frame); tui_show_frame_info (deprecated_safe_get_selected_frame ());
/* Restore TUI keymap. */ /* Restore TUI keymap. */
tui_set_key_mode (tui_current_key_mode); tui_set_key_mode (tui_current_key_mode);

View file

@ -578,7 +578,7 @@ value_assign (struct value *toval, struct value *fromval)
/* Since modifying a register can trash the frame chain, and modifying memory /* Since modifying a register can trash the frame chain, and modifying memory
can trash the frame cache, we save the old frame and then restore the new can trash the frame cache, we save the old frame and then restore the new
frame afterwards. */ frame afterwards. */
old_frame = get_frame_id (deprecated_selected_frame); old_frame = get_frame_id (deprecated_safe_get_selected_frame ());
switch (VALUE_LVAL (toval)) switch (VALUE_LVAL (toval))
{ {
@ -2667,16 +2667,18 @@ value_of_local (const char *name, int complain)
struct symbol *func, *sym; struct symbol *func, *sym;
struct block *b; struct block *b;
struct value * ret; struct value * ret;
struct frame_info *frame;
if (deprecated_selected_frame == 0)
{
if (complain) if (complain)
error (_("no frame selected")); frame = get_selected_frame (_("no frame selected"));
else else
{
frame = deprecated_safe_get_selected_frame ();
if (frame == 0)
return 0; return 0;
} }
func = get_frame_function (deprecated_selected_frame); func = get_frame_function (frame);
if (!func) if (!func)
{ {
if (complain) if (complain)
@ -2705,7 +2707,7 @@ value_of_local (const char *name, int complain)
return NULL; return NULL;
} }
ret = read_var_value (sym, deprecated_selected_frame); ret = read_var_value (sym, frame);
if (ret == 0 && complain) if (ret == 0 && complain)
error (_("`%s' argument unreadable"), name); error (_("`%s' argument unreadable"), name);
return ret; return ret;

View file

@ -440,7 +440,7 @@ varobj_create (char *objname,
/* Allow creator to specify context of variable */ /* Allow creator to specify context of variable */
if ((type == USE_CURRENT_FRAME) || (type == USE_SELECTED_FRAME)) if ((type == USE_CURRENT_FRAME) || (type == USE_SELECTED_FRAME))
fi = deprecated_selected_frame; fi = deprecated_safe_get_selected_frame ();
else else
/* FIXME: cagney/2002-11-23: This code should be doing a /* FIXME: cagney/2002-11-23: This code should be doing a
lookup using the frame ID and not just the frame's lookup using the frame ID and not just the frame's
@ -487,7 +487,7 @@ varobj_create (char *objname,
if (fi != NULL) if (fi != NULL)
{ {
var->root->frame = get_frame_id (fi); var->root->frame = get_frame_id (fi);
old_fi = deprecated_selected_frame; old_fi = get_selected_frame (NULL);
select_frame (fi); select_frame (fi);
} }
@ -1064,7 +1064,7 @@ varobj_update (struct varobj **varp, struct varobj ***changelist)
/* Save the selected stack frame, since we will need to change it /* Save the selected stack frame, since we will need to change it
in order to evaluate expressions. */ in order to evaluate expressions. */
old_fid = get_frame_id (deprecated_selected_frame); old_fid = get_frame_id (deprecated_safe_get_selected_frame ());
/* Update the root variable. value_of_root can return NULL /* Update the root variable. value_of_root can return NULL
if the variable is no longer around, i.e. we stepped out of if the variable is no longer around, i.e. we stepped out of