summaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2013-07-01 11:22:11 +0000
committerPedro Alves <palves@redhat.com>2013-07-01 11:22:11 +0000
commitc80f3fec040bc0ba629c910da2b773d5215859aa (patch)
treeb81690631fff4e8e795dd329c00155d1a249bdb7 /gdb/cli
parent608ddd4e6025711117c89abdcb2825fc0825d82e (diff)
downloadgdb-c80f3fec040bc0ba629c910da2b773d5215859aa.tar.gz
Constify main.c:get_init_files.
A following patch will want to make the "gdbinit" global array const. As usual, that forces in a cascading series of const additions. This patch preemptively does those. I went all the way up to constifying catch_command_errors, but then that would require constifying execute_command as well (which is a much more significant effort). So as stop point, I found the cleanest would be to add a variant of catch_command_errors that takes const args, and use that in the few spots that needed it due to the the get_init_files constification. gdb/ 2013-07-01 Pedro Alves <palves@redhat.com> * cli/cli-cmds.c (source_script): Make 'file' parameter const. * cli/cli-cmds.h (source_script): Likewise. * exceptions.c (catch_command_errors_const): New function. * exceptions.h (catch_command_errors_const): Declare. * main.c (get_init_files): Make parameters const, and adjust. (captured_main): Make 'system_gdbinit', 'home_gdbinit' and 'local_gdbinit' locals const. Adjust to use catch_command_errors_const. (print_gdb_help): Make 'system_gdbinit', 'home_gdbinit' and 'local_gdbinit' locals const.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-cmds.c2
-rw-r--r--gdb/cli/cli-cmds.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 6ee767320b0..bd2ca2d58fe 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -597,7 +597,7 @@ source_script_with_search (const char *file, int from_tty, int search_path)
for use in loading .gdbinit scripts. */
void
-source_script (char *file, int from_tty)
+source_script (const char *file, int from_tty)
{
source_script_with_search (file, from_tty, 0);
}
diff --git a/gdb/cli/cli-cmds.h b/gdb/cli/cli-cmds.h
index 9f6977c0c66..34fe44554c6 100644
--- a/gdb/cli/cli-cmds.h
+++ b/gdb/cli/cli-cmds.h
@@ -117,7 +117,7 @@ extern void cd_command (char *, int);
extern void quit_command (char *, int);
-extern void source_script (char *, int);
+extern void source_script (const char *, int);
/* Exported to objfiles.c. */