Constify some commands in tracepoint.c
In addition to the constification, this fixes a command-repeat bug. gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * tracepoint.c (delete_trace_variable_command) (tfind_end_command, tfind_start_command, tfind_pc_command) (tfind_tracepoint_command, tfind_line_command) (tfind_range_command, tfind_outside_command): Constify.
This commit is contained in:
parent
4fd41b2486
commit
2983f7cbdb
|
@ -1,3 +1,10 @@
|
||||||
|
2017-09-27 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* tracepoint.c (delete_trace_variable_command)
|
||||||
|
(tfind_end_command, tfind_start_command, tfind_pc_command)
|
||||||
|
(tfind_tracepoint_command, tfind_line_command)
|
||||||
|
(tfind_range_command, tfind_outside_command): Constify.
|
||||||
|
|
||||||
2017-09-27 Tom Tromey <tom@tromey.com>
|
2017-09-27 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* ax-gdb.c (maint_agent_printf_command, agent_command)
|
* ax-gdb.c (maint_agent_printf_command, agent_command)
|
||||||
|
|
|
@ -165,18 +165,6 @@ char *trace_notes = NULL;
|
||||||
|
|
||||||
char *trace_stop_notes = NULL;
|
char *trace_stop_notes = NULL;
|
||||||
|
|
||||||
/* ======= Important command functions: ======= */
|
|
||||||
static void actions_command (char *, int);
|
|
||||||
static void tstart_command (char *, int);
|
|
||||||
static void tstop_command (char *, int);
|
|
||||||
static void tstatus_command (char *, int);
|
|
||||||
static void tfind_pc_command (char *, int);
|
|
||||||
static void tfind_tracepoint_command (char *, int);
|
|
||||||
static void tfind_line_command (char *, int);
|
|
||||||
static void tfind_range_command (char *, int);
|
|
||||||
static void tfind_outside_command (char *, int);
|
|
||||||
static void tdump_command (char *, int);
|
|
||||||
|
|
||||||
/* support routines */
|
/* support routines */
|
||||||
|
|
||||||
struct collection_list;
|
struct collection_list;
|
||||||
|
@ -442,7 +430,7 @@ trace_variable_command (char *args, int from_tty)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
delete_trace_variable_command (char *args, int from_tty)
|
delete_trace_variable_command (const char *args, int from_tty)
|
||||||
{
|
{
|
||||||
if (args == NULL)
|
if (args == NULL)
|
||||||
{
|
{
|
||||||
|
@ -2362,21 +2350,21 @@ tfind_command (char *args, int from_tty)
|
||||||
|
|
||||||
/* tfind end */
|
/* tfind end */
|
||||||
static void
|
static void
|
||||||
tfind_end_command (char *args, int from_tty)
|
tfind_end_command (const char *args, int from_tty)
|
||||||
{
|
{
|
||||||
tfind_command_1 ("-1", from_tty);
|
tfind_command_1 ("-1", from_tty);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tfind start */
|
/* tfind start */
|
||||||
static void
|
static void
|
||||||
tfind_start_command (char *args, int from_tty)
|
tfind_start_command (const char *args, int from_tty)
|
||||||
{
|
{
|
||||||
tfind_command_1 ("0", from_tty);
|
tfind_command_1 ("0", from_tty);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tfind pc command */
|
/* tfind pc command */
|
||||||
static void
|
static void
|
||||||
tfind_pc_command (char *args, int from_tty)
|
tfind_pc_command (const char *args, int from_tty)
|
||||||
{
|
{
|
||||||
CORE_ADDR pc;
|
CORE_ADDR pc;
|
||||||
|
|
||||||
|
@ -2392,7 +2380,7 @@ tfind_pc_command (char *args, int from_tty)
|
||||||
|
|
||||||
/* tfind tracepoint command */
|
/* tfind tracepoint command */
|
||||||
static void
|
static void
|
||||||
tfind_tracepoint_command (char *args, int from_tty)
|
tfind_tracepoint_command (const char *args, int from_tty)
|
||||||
{
|
{
|
||||||
int tdp;
|
int tdp;
|
||||||
struct tracepoint *tp;
|
struct tracepoint *tp;
|
||||||
|
@ -2428,7 +2416,7 @@ tfind_tracepoint_command (char *args, int from_tty)
|
||||||
corresponding to a source line OTHER THAN THE CURRENT ONE. */
|
corresponding to a source line OTHER THAN THE CURRENT ONE. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
tfind_line_command (char *args, int from_tty)
|
tfind_line_command (const char *args, int from_tty)
|
||||||
{
|
{
|
||||||
check_trace_running (current_trace_status ());
|
check_trace_running (current_trace_status ());
|
||||||
|
|
||||||
|
@ -2486,10 +2474,10 @@ tfind_line_command (char *args, int from_tty)
|
||||||
|
|
||||||
/* tfind range command */
|
/* tfind range command */
|
||||||
static void
|
static void
|
||||||
tfind_range_command (char *args, int from_tty)
|
tfind_range_command (const char *args, int from_tty)
|
||||||
{
|
{
|
||||||
static CORE_ADDR start, stop;
|
static CORE_ADDR start, stop;
|
||||||
char *tmp;
|
const char *tmp;
|
||||||
|
|
||||||
check_trace_running (current_trace_status ());
|
check_trace_running (current_trace_status ());
|
||||||
|
|
||||||
|
@ -2501,9 +2489,10 @@ tfind_range_command (char *args, int from_tty)
|
||||||
|
|
||||||
if (0 != (tmp = strchr (args, ',')))
|
if (0 != (tmp = strchr (args, ',')))
|
||||||
{
|
{
|
||||||
*tmp++ = '\0'; /* Terminate start address. */
|
std::string start_addr (args, tmp);
|
||||||
|
++tmp;
|
||||||
tmp = skip_spaces (tmp);
|
tmp = skip_spaces (tmp);
|
||||||
start = parse_and_eval_address (args);
|
start = parse_and_eval_address (start_addr.c_str ());
|
||||||
stop = parse_and_eval_address (tmp);
|
stop = parse_and_eval_address (tmp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2517,10 +2506,10 @@ tfind_range_command (char *args, int from_tty)
|
||||||
|
|
||||||
/* tfind outside command */
|
/* tfind outside command */
|
||||||
static void
|
static void
|
||||||
tfind_outside_command (char *args, int from_tty)
|
tfind_outside_command (const char *args, int from_tty)
|
||||||
{
|
{
|
||||||
CORE_ADDR start, stop;
|
CORE_ADDR start, stop;
|
||||||
char *tmp;
|
const char *tmp;
|
||||||
|
|
||||||
if (current_trace_status ()->running
|
if (current_trace_status ()->running
|
||||||
&& current_trace_status ()->filename == NULL)
|
&& current_trace_status ()->filename == NULL)
|
||||||
|
@ -2534,9 +2523,10 @@ tfind_outside_command (char *args, int from_tty)
|
||||||
|
|
||||||
if (0 != (tmp = strchr (args, ',')))
|
if (0 != (tmp = strchr (args, ',')))
|
||||||
{
|
{
|
||||||
*tmp++ = '\0'; /* Terminate start address. */
|
std::string start_addr (args, tmp);
|
||||||
|
++tmp;
|
||||||
tmp = skip_spaces (tmp);
|
tmp = skip_spaces (tmp);
|
||||||
start = parse_and_eval_address (args);
|
start = parse_and_eval_address (start_addr.c_str ());
|
||||||
stop = parse_and_eval_address (tmp);
|
stop = parse_and_eval_address (tmp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue