/* List all the trace state variables. */
static void
-tvariables_info (char *args, int from_tty)
+info_tvariables_command (char *args, int from_tty)
{
tvariables_info_1 ();
}
static void
tfind_line_command (char *args, int from_tty)
{
- static CORE_ADDR start_pc, end_pc;
- struct symtabs_and_lines sals;
- struct symtab_and_line sal;
- struct cleanup *old_chain;
-
check_trace_running (current_trace_status ());
+ symtab_and_line sal;
if (args == 0 || *args == 0)
{
sal = find_pc_line (get_frame_pc (get_current_frame ()), 0);
- sals.nelts = 1;
- sals.sals = XNEW (struct symtab_and_line);
- sals.sals[0] = sal;
}
else
{
- sals = decode_line_with_current_source (args, DECODE_LINE_FUNFIRSTLINE);
- sal = sals.sals[0];
+ std::vector<symtab_and_line> sals
+ = decode_line_with_current_source (args, DECODE_LINE_FUNFIRSTLINE);
+ sal = sals[0];
}
-
- old_chain = make_cleanup (xfree, sals.sals);
+
if (sal.symtab == 0)
error (_("No line number information available."));
+ CORE_ADDR start_pc, end_pc;
if (sal.line > 0 && find_line_pc_range (sal, &start_pc, &end_pc))
{
if (start_pc == end_pc)
tfind_1 (tfind_range, 0, start_pc, end_pc - 1, from_tty);
else
tfind_1 (tfind_outside, 0, start_pc, end_pc - 1, from_tty);
- do_cleanups (old_chain);
}
/* tfind range command */
/* info scope command: list the locals for a scope. */
static void
-scope_info (char *args, int from_tty)
+info_scope_command (char *args, int from_tty)
{
- struct symtabs_and_lines sals;
struct symbol *sym;
struct bound_minimal_symbol msym;
const struct block *block;
event_location_up location = string_to_event_location (&args,
current_language);
- sals = decode_line_1 (location.get (), DECODE_LINE_FUNFIRSTLINE,
- NULL, NULL, 0);
- if (sals.nelts == 0)
+ std::vector<symtab_and_line> sals
+ = decode_line_1 (location.get (), DECODE_LINE_FUNFIRSTLINE,
+ NULL, NULL, 0);
+ if (sals.empty ())
{
/* Presumably decode_line_1 has already warned. */
return;
}
/* Resolve line numbers to PC. */
- resolve_sal_pc (&sals.sals[0]);
- block = block_for_pc (sals.sals[0].pc);
+ resolve_sal_pc (&sals[0]);
+ block = block_for_pc (sals[0].pc);
while (block != 0)
{
else if (0 == strncasecmp (action_exp, "$_ret", 5))
;
else if (0 == strncasecmp (action_exp, "$loc", 4))
- locals_info (NULL, from_tty);
+ info_locals_command (NULL, from_tty);
else if (0 == strncasecmp (action_exp, "$arg", 4))
- args_info (NULL, from_tty);
+ info_args_command (NULL, from_tty);
else
{ /* variable */
if (next_comma != NULL)
traceframe_number = -1;
tracepoint_number = -1;
- add_info ("scope", scope_info,
+ add_info ("scope", info_scope_command,
_("List the variables local to a scope"));
add_cmd ("tracepoints", class_trace, NULL,
If no arguments are supplied, delete all variables."), &deletelist);
/* FIXME add a trace variable completer. */
- add_info ("tvariables", tvariables_info, _("\
+ add_info ("tvariables", info_tvariables_command, _("\
Status of trace state variables and their values.\n\
"));