Constify some linespec functions

This changes a few linespec functions to work on "const char *" and
then fixes up all the callers.  This allows further constification
elsewhere.

gdb/ChangeLog
2017-09-27  Tom Tromey  <tom@tromey.com>

	* tracepoint.c (info_scope_command): Constify.
	* python/python.c (gdbpy_decode_line): Constify.
	* python/py-breakpoint.c (bppy_init): Constify.
	* mi/mi-cmd-break.c (mi_cmd_break_insert_1): Constify.
	* location.h: (new_linespec_location)
	(string_to_event_location_basic, string_to_event_location):
	Constify.
	* location.c (new_linespec_location)
	(string_to_event_location_basic, string_to_event_location):
	Constify.
	* linespec.h (decode_line_with_current_source)
	(decode_line_with_last_displayed, linespec_lex_to_end): Constify.
	* linespec.c (linespec_lex_to_end)
	(decode_line_with_current_source)
	(decode_line_with_last_displayed): Constify.
	* guile/scm-breakpoint.c (gdbscm_register_breakpoint_x):
	Constify.
	* cli/cli-cmds.c (edit_command, list_command): Constify.
	* breakpoint.h (until_break_command, watch_command_wrapper)
	(awatch_command_wrapper, rwatch_command_wrapper)
	(init_ada_exception_breakpoint): Constify.
	* breakpoint.c (break_command_1, dprintf_command)
	(break_range_command, watch_command_wrapper)
	(rwatch_command_wrapper, awatch_command_wrapper)
	(until_break_command, init_ada_exception_breakpoint)
	(strace_marker_create_sals_from_location, trace_command)
	(ftrace_command, strace_command, struct tracepoint): Constify.
	* ax-gdb.c (agent_command_1): Constify.
	* ada-lang.c (ada_exception_sal): Constify.
This commit is contained in:
Tom Tromey 2017-09-12 18:32:41 -06:00
parent 8c2f95f434
commit f2fc30156c
15 changed files with 95 additions and 56 deletions

View file

@ -2550,17 +2550,18 @@ tfind_outside_command (char *args, int from_tty)
/* info scope command: list the locals for a scope. */
static void
info_scope_command (char *args, int from_tty)
info_scope_command (char *args_in, int from_tty)
{
struct symbol *sym;
struct bound_minimal_symbol msym;
const struct block *block;
const char *symname;
char *save_args = args;
const char *save_args = args_in;
struct block_iterator iter;
int j, count = 0;
struct gdbarch *gdbarch;
int regno;
const char *args = args_in;
if (args == 0 || *args == 0)
error (_("requires an argument (function, "