if (has_stack_frames ())
{
prev_len = result.size ();
- ada_add_exceptions_from_frame (preg, get_selected_frame (NULL),
+ ada_add_exceptions_from_frame (preg, get_selected_frame (),
&result);
if (result.size () > prev_len)
sort_remove_dups_ada_exceptions_list (&result, prev_len);
task_to_str (taskno, task_info).c_str ());
switch_to_thread (tp);
- ada_find_printable_frame (get_selected_frame (NULL));
+ ada_find_printable_frame (get_selected_frame ());
gdb_printf (_("[Switching to task %s]\n"),
task_to_str (taskno, task_info).c_str ());
- print_stack_frame (get_selected_frame (NULL),
- frame_relative_level (get_selected_frame (NULL)),
+ print_stack_frame (get_selected_frame (),
+ frame_relative_level (get_selected_frame ()),
SRC_AND_LOC, 1);
}
get_current_arch (void)
{
if (has_stack_frames ())
- return get_frame_arch (get_selected_frame (NULL));
+ return get_frame_arch (get_selected_frame ());
else
return current_inferior ()->arch ();
}
if (b->exp_valid_block == nullptr)
wp_pspace = current_program_space;
else
- wp_pspace = get_frame_program_space (get_selected_frame (NULL));
+ wp_pspace = get_frame_program_space (get_selected_frame ());
/* Look at each value on the value chain. */
gdb_assert (!val_chain.empty ());
may need to switch threads), so do any frame handling before
that. */
- frame = get_selected_frame (NULL);
+ frame = get_selected_frame ();
frame_gdbarch = get_frame_arch (frame);
stack_frame_id = get_stack_frame_id (frame);
caller_frame_id = frame_unwind_caller_id (frame);
target_fetch_registers (get_thread_regcache (thr), -1);
reinit_frame_cache ();
- print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC, 1);
+ print_stack_frame (get_selected_frame (), 0, SRC_AND_LOC, 1);
}
void
target_fetch_registers (get_thread_regcache (inferior_thread ()), -1);
reinit_frame_cache ();
- print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC, 1);
+ print_stack_frame (get_selected_frame (), 0, SRC_AND_LOC, 1);
}
#endif
target_fetch_registers (get_thread_regcache (inferior_thread ()), -1);
reinit_frame_cache ();
- print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC, 1);
+ print_stack_frame (get_selected_frame (), 0, SRC_AND_LOC, 1);
}
bool
{
/* Find the current line by getting the PC of the currently
selected frame, and finding the line associated to it. */
- frame_info_ptr frame = get_selected_frame (nullptr);
+ frame_info_ptr frame = get_selected_frame ();
CORE_ADDR curr_pc = get_frame_pc (frame);
cursal = find_sal_for_pc (curr_pc, 0);
if (symbol_read_needs_frame (sym.symbol))
{
- frame = get_selected_frame (NULL);
+ frame = get_selected_frame ();
if (frame == NULL)
error (_("Symbol \"%s\" cannot be used because "
"there is no selected frame"),
if (symbol_read_needs_frame (sym.symbol))
{
- frame = get_selected_frame (nullptr);
+ frame = get_selected_frame ();
if (frame == nullptr)
error (_("Symbol \"%s\" cannot be used because "
"there is no selected frame"),
offset by hand seemed too hackish. */
if (is_tls)
{
- frame_info_ptr frame = get_selected_frame (NULL);
+ frame_info_ptr frame = get_selected_frame ();
struct value *val;
if (frame == NULL)
static const char *
get_selected_pc_producer_options (void)
{
- CORE_ADDR pc = get_frame_pc (get_selected_frame (NULL));
+ CORE_ADDR pc = get_frame_pc (get_selected_frame ());
struct compunit_symtab *symtab = find_compunit_symtab_for_pc (pc);
const char *cs;
"work."));
expr_block = get_expr_block_and_pc (&trash_pc);
- expr_pc = get_frame_address_in_block (get_selected_frame (NULL));
+ expr_pc = get_frame_address_in_block (get_selected_frame ());
/* Set up instance and context for the compiler. */
std::unique_ptr<compile_instance> compiler
/* Now, set up the frame cache, and print the top of stack. */
reinit_frame_cache ();
- print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
+ print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC, 1);
/* Current thread should be NUM 1 but the user does not know that.
If a program is single threaded gdb in general does not mention
frame_info_ptr frame = initial_frame;
if (frame == NULL && has_stack_frames ())
- frame = get_selected_frame (NULL);
+ frame = get_selected_frame ();
switch (prop->kind ())
{
error (_("Symbol \"%s\" does not have any specific entry value"),
sym->print_name ());
- frame_info_ptr frame = get_selected_frame (NULL);
+ frame_info_ptr frame = get_selected_frame ();
return computed_ops->read_variable_at_entry (sym, frame);
}
{
if (!has_stack_frames ())
return NULL;
- return get_selected_frame (NULL);
+ return get_selected_frame ();
}
/* Invalidate the selected frame. */
CORE_ADDR func_addr;
CORE_ADDR alt_entry_point;
CORE_ADDR entry_point;
- frame_info_ptr frame = get_selected_frame (nullptr);
+ frame_info_ptr frame = get_selected_frame ();
struct gdbarch *gdbarch = get_frame_arch (frame);
pc = get_frame_pc (get_current_frame ());
if (from_tty)
{
gdb_printf (_("Run till exit from "));
- print_stack_frame (get_selected_frame (nullptr), 1, LOCATION, 0);
+ print_stack_frame (get_selected_frame (), 1, LOCATION, 0);
}
proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
}
/* Find the function we will return from. */
- frame_info_ptr callee_frame = get_selected_frame (nullptr);
+ frame_info_ptr callee_frame = get_selected_frame ();
sm->function = find_symbol_for_pc (get_frame_pc (callee_frame));
sm->return_buf = 0; /* Initialize buffer address is not available. */
if (!target_has_registers ())
error (_("The program has no registers now."));
- frame = get_selected_frame (nullptr);
+ frame = get_selected_frame ();
gdbarch = get_frame_arch (frame);
if (!addr_exp)
if (!target_has_registers ())
error (_("The program has no registers now."));
- print_vector_info (gdb_stdout, get_selected_frame (nullptr), args);
+ print_vector_info (gdb_stdout, get_selected_frame (), args);
}
\f
/* Kill the inferior process. Make us have no inferior. */
if (!target_has_registers ())
error (_("The program has no registers now."));
- frame = get_selected_frame (nullptr);
+ frame = get_selected_frame ();
gdbarch_print_float_info (get_frame_arch (frame), gdb_stdout, frame, args);
}
\f
/* Function bpstat_print selects the frame to print. Typically, that is the
stop frame, in other words get_current_frame (). But bpstat_print may
select a different frame, see for instance ada_catchpoint::print_it. */
- frame_info_ptr print_frame = get_selected_frame (nullptr);
+ frame_info_ptr print_frame = get_selected_frame ();
switch (bpstat_ret)
{
{
frame_info_ptr frame;
- frame = get_selected_frame (NULL);
+ frame = get_selected_frame ();
flang = get_frame_language (frame);
if (flang != language_unknown
&& language_mode == language_mode_manual
{
frame_info_ptr frame;
- frame = get_selected_frame (NULL);
+ frame = get_selected_frame ();
flang = get_frame_language (frame);
}
catch (const gdb_exception_error &ex)
error (_("-stack-list-locals: Usage: [--no-frame-filters] "
"[--skip-unavailable] PRINT_VALUES"));
- frame = get_selected_frame (NULL);
+ frame = get_selected_frame ();
print_value = mi_parse_print_values (argv[oind]);
if (! raw_arg && frame_filters)
error (_("-stack-list-variables: Usage: [--no-frame-filters] " \
"[--skip-unavailable] PRINT_VALUES"));
- frame = get_selected_frame (NULL);
+ frame = get_selected_frame ();
print_value = mi_parse_print_values (argv[oind]);
if (! raw_arg && frame_filters)
error (_("-stack-info-frame: No arguments allowed"));
print_frame_info (user_frame_print_options,
- get_selected_frame (NULL), 1, LOC_AND_ADDRESS, 0, 1);
+ get_selected_frame (), 1, LOC_AND_ADDRESS, 0, 1);
}
if (tp->state () != THREAD_RUNNING)
{
if (has_stack_frames ())
- print_stack_frame_to_uiout (mi_uiout, get_selected_frame (NULL),
+ print_stack_frame_to_uiout (mi_uiout, get_selected_frame (),
1, SRC_AND_LOC, 1);
}
}
/* Because we have called return_command with from_tty = 0, we need
to print the frame here. */
- print_stack_frame (get_selected_frame (NULL), 1, LOC_AND_ADDRESS, 1);
+ print_stack_frame (get_selected_frame (), 1, LOC_AND_ADDRESS, 1);
}
void
contents. */
prev_regs = std::move (this_regs);
- this_regs = frame_save_as_regcache (get_selected_frame (NULL));
+ this_regs = frame_save_as_regcache (get_selected_frame ());
/* Note that the test for a valid register must include checking the
gdbarch_register_name because gdbarch_num_regs may be allocated
format = (int) argv[oind][0];
- frame = get_selected_frame (NULL);
+ frame = get_selected_frame ();
gdbarch = get_frame_arch (frame);
numregs = gdbarch_num_cooked_regs (gdbarch);
error (_("Invalid mode '%s'"), mode);
if (has_stack_frames () || get_traceframe_number () >= 0)
- print_stack_frame (get_selected_frame (NULL), 1, LOC_AND_ADDRESS, 1);
+ print_stack_frame (get_selected_frame (), 1, LOC_AND_ADDRESS, 1);
}
void
ui_out_emit_list list_emitter (uiout, "registers");
- frame = get_selected_frame (NULL);
+ frame = get_selected_frame ();
gdbarch = get_frame_arch (frame);
numregs = gdbarch_num_cooked_regs (gdbarch);
{
try
{
- CORE_ADDR curr_pc = get_frame_pc (get_selected_frame (nullptr));
+ CORE_ADDR curr_pc = get_frame_pc (get_selected_frame ());
symtab_and_line curr_sal = find_sal_for_pc (curr_pc, 0);
return (decl_line <= curr_sal.line)
|| (decl_line >= boundary);
frame_info_ptr frame;
std::optional<CORE_ADDR> pc;
- frame = get_selected_frame (NULL);
+ frame = get_selected_frame ();
if ((pc = get_frame_pc_if_available (frame)) && *pc == addr)
return "=> ";
}
record_btrace_clear_histories (btinfo);
tp->set_stop_pc (regcache_read_pc (get_thread_regcache (tp)));
- print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
+ print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC, 1);
}
/* The goto_record_begin method of target record-btrace. */
thread_info *thr = inferior_thread ();
thr->set_stop_pc (regcache_read_pc (get_thread_regcache (thr)));
- print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
+ print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC, 1);
}
/* The "goto_record_begin" target method. */
gdb_printf (_("Restored records from core file %s.\n"),
bfd_get_filename (&cbfd));
- print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
+ print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC, 1);
}
/* bfdcore_write -- write bytes into a core file section. */
if (!has_stack_frames ())
return 0;
- return get_frame_block (get_selected_frame (NULL), addr_in_block);
+ return get_frame_block (get_selected_frame (), addr_in_block);
}
/* Find a frame a certain number of levels away from FRAME.
}
/* Discard the selected frame and all frames inner-to it. */
- frame_pop (get_selected_frame (NULL));
+ frame_pop (get_selected_frame ());
/* Store RETURN_VALUE in the just-returned register set. */
if (return_value != NULL)
select_frame (get_current_frame ());
/* If interactive, print the frame that is now current. */
if (from_tty)
- print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
+ print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC, 1);
}
/* Find the most inner frame in the current stack for a function called
{
/* The switch above put us at the top of the stack (leaf
frame). */
- print_stack_frame (get_selected_frame (NULL),
+ print_stack_frame (get_selected_frame (),
/* For MI output, print frame level. */
uiout->is_mi_like_p (),
LOCATION, 0);
uiout->text ("\n");
if (has_stack_frames ())
- print_stack_frame_to_uiout (uiout, get_selected_frame (NULL),
+ print_stack_frame_to_uiout (uiout, get_selected_frame (),
1, SRC_AND_LOC, 1);
}
}
else
print_what = SRC_AND_LOC;
- print_stack_frame (get_selected_frame (NULL), 1, print_what, 1);
+ print_stack_frame (get_selected_frame (), 1, print_what, 1);
do_displays ();
}
}
And even if the frames differ a register change made in one can still show
up in the other. So we always use the selected frame here, and ignore
FRAME. */
- fi = get_selected_frame (NULL);
+ fi = get_selected_frame ();
tui_data_win ()->check_register_values (fi);
}
frame_info_ptr fi;
if (has_stack_frames ())
{
- fi = get_selected_frame (NULL);
+ fi = get_selected_frame ();
/* Display the frame position (even if there is no symbols or
the PC is not known). */
if (group == nullptr)
group = general_reggroup;
- frame_info_ptr frame = get_selected_frame (nullptr);
+ frame_info_ptr frame = get_selected_frame ();
struct gdbarch *gdbarch = get_frame_arch (frame);
if (m_current_group == group && m_gdbarch == gdbarch)
if (cursal.symtab == NULL)
{
- frame_info_ptr fi = get_selected_frame (NULL);
+ frame_info_ptr fi = get_selected_frame ();
s = find_symtab_for_pc (get_frame_pc (fi));
arch = get_frame_arch (fi);
}
{
/* Allow creator to specify context of variable. */
if ((type == USE_CURRENT_FRAME) || (type == USE_SELECTED_FRAME))
- fi = get_selected_frame (NULL);
+ fi = get_selected_frame ();
else
/* FIXME: cagney/2002-11-23: This code should be doing a
lookup using the frame ID and not just the frame's
var->root->frame = get_frame_id (fi);
var->root->thread_id = inferior_thread ()->global_num;
- old_id = get_frame_id (get_selected_frame (NULL));
+ old_id = get_frame_id (get_selected_frame ());
select_frame (fi);
}