/* Local functions: */
-static void nofp_registers_info (char *, int);
+static void info_registers_command (char *, int);
static void until_next_command (int);
static void unset_command (char *, int);
-static void float_info (char *, int);
+static void info_float_command (char *, int);
static void disconnect_command (char *, int);
static void environment_info (char *, int);
-static void program_info (char *, int);
+static void info_program_command (char *, int);
static void finish_command (char *, int);
static void run_command (char *, int);
-void _initialize_infcmd (void);
-
#define ERROR_NO_INFERIOR \
if (!target_has_execution) error (_("The program is not being run."));
static void
set_step_frame (void)
{
- struct symtab_and_line sal;
- CORE_ADDR pc;
- struct frame_info *frame = get_current_frame ();
- struct thread_info *tp = inferior_thread ();
+ frame_info *frame = get_current_frame ();
- find_frame_sal (frame, &sal);
+ symtab_and_line sal = find_frame_sal (frame);
set_step_info (frame, sal);
- pc = get_frame_pc (frame);
+
+ CORE_ADDR pc = get_frame_pc (frame);
+ thread_info *tp = inferior_thread ();
tp->control.step_start_function = find_pc_function (pc);
}
{
struct gdbarch *gdbarch = get_current_arch ();
CORE_ADDR addr;
- struct symtabs_and_lines sals;
- struct symtab_and_line sal;
struct symbol *fn;
struct symbol *sfn;
int async_exec;
if (!arg)
error_no_arg (_("starting address"));
- sals = decode_line_with_last_displayed (arg, DECODE_LINE_FUNFIRSTLINE);
- if (sals.nelts != 1)
- {
- error (_("Unreasonable jump request"));
- }
-
- sal = sals.sals[0];
- xfree (sals.sals);
+ std::vector<symtab_and_line> sals
+ = decode_line_with_last_displayed (arg, DECODE_LINE_FUNFIRSTLINE);
+ if (sals.size () != 1)
+ error (_("Unreasonable jump request"));
/* Done with ARGS. */
do_cleanups (args_chain);
+ symtab_and_line &sal = sals[0];
+
if (sal.symtab == 0 && sal.pc == 0)
error (_("No source file has been specified."));
{
struct frame_info *frame = get_selected_frame (NULL);
struct gdbarch *gdbarch = get_frame_arch (frame);
- struct symtab_and_line sr_sal;
/* Set a step-resume at the function's entry point. Once that's
hit, we'll do one more step backwards. */
- init_sal (&sr_sal);
+ symtab_and_line sr_sal;
sr_sal.pc = sal.pc;
sr_sal.pspace = get_frame_program_space (frame);
insert_step_resume_breakpoint_at_sal (gdbarch,
called by that frame. We don't use the magic "1" value for
step_range_end, because then infrun will think this is nexti,
and not step over the rest of this inlined function call. */
- struct symtab_and_line empty_sal;
-
- init_sal (&empty_sal);
- set_step_info (frame, empty_sal);
+ set_step_info (frame, {});
tp->control.step_range_start = get_frame_pc (frame);
tp->control.step_range_end = tp->control.step_range_start;
tp->control.step_over_calls = STEP_OVER_ALL;
\f
static void
-program_info (char *args, int from_tty)
+info_program_command (char *args, int from_tty)
{
bpstat bs;
int num, stat;
/* If there is no argument, delete all environment variables.
Ask for confirmation if reading from the terminal. */
if (!from_tty || query (_("Delete all environment variables? ")))
- current_inferior ()->environment = gdb_environ::from_host_environ ();
+ current_inferior ()->environment.clear ();
}
else
current_inferior ()->environment.unset (var);
}
static void
-all_registers_info (char *addr_exp, int from_tty)
+info_all_registers_command (char *addr_exp, int from_tty)
{
registers_info (addr_exp, 1);
}
static void
-nofp_registers_info (char *addr_exp, int from_tty)
+info_registers_command (char *addr_exp, int from_tty)
{
registers_info (addr_exp, 0);
}
}
static void
-vector_info (char *args, int from_tty)
+info_vector_command (char *args, int from_tty)
{
if (!target_has_registers)
error (_("The program has no registers now."));
}
static void
-float_info (char *args, int from_tty)
+info_float_command (char *args, int from_tty)
{
struct frame_info *frame;
otherwise all the threads in the program are stopped. To \n\
interrupt all running threads in non-stop mode, use the -a option."));
- c = add_info ("registers", nofp_registers_info, _("\
+ c = add_info ("registers", info_registers_command, _("\
List of integer registers and their contents, for selected stack frame.\n\
Register name as argument means describe only that register."));
add_info_alias ("r", "registers", 1);
set_cmd_completer (c, reg_or_group_completer);
- c = add_info ("all-registers", all_registers_info, _("\
+ c = add_info ("all-registers", info_all_registers_command, _("\
List of all registers and their contents, for selected stack frame.\n\
Register name as argument means describe only that register."));
set_cmd_completer (c, reg_or_group_completer);
- add_info ("program", program_info,
+ add_info ("program", info_program_command,
_("Execution status of the program."));
- add_info ("float", float_info,
+ add_info ("float", info_float_command,
_("Print the status of the floating point unit\n"));
- add_info ("vector", vector_info,
+ add_info ("vector", info_vector_command,
_("Print the status of the vector unit\n"));
add_prefix_cmd ("proc", class_info, info_proc_cmd,