aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-09-12 18:39:07 -0600
committerTom Tromey <tom@tromey.com>2017-09-27 08:44:49 -0600
commit1d8b34a7a233d89938fd173389f7884aa7d105b3 (patch)
tree2822134aec724b165393be86690f7deba6c399d7
parent442019e118afb6bdbae490c0b072e8f024f2d9a2 (diff)
downloadfsf-binutils-gdb-1d8b34a7a233d89938fd173389f7884aa7d105b3.zip
fsf-binutils-gdb-1d8b34a7a233d89938fd173389f7884aa7d105b3.tar.gz
fsf-binutils-gdb-1d8b34a7a233d89938fd173389f7884aa7d105b3.tar.bz2
Constify some commands in exec.c, plus symbol_file_command
Note that this commit also changes deprecated_file_changed_hook -- not used in the tree, but Insight will require a (presumably minor) change. gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * symfile.c (symbol_file_command): Constify. * gdbcore.h (deprecated_file_changed_hook): Constify. * exec.c (deprecated_file_changed_hook, exec_file_command) (file_command): Constify. * defs.h (symbol_file_command): Constify.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/defs.h2
-rw-r--r--gdb/exec.c8
-rw-r--r--gdb/gdbcore.h2
-rw-r--r--gdb/symfile.c2
5 files changed, 14 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8ec4a7a..407f941 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
2017-09-27 Tom Tromey <tom@tromey.com>
+ * symfile.c (symbol_file_command): Constify.
+ * gdbcore.h (deprecated_file_changed_hook): Constify.
+ * exec.c (deprecated_file_changed_hook, exec_file_command)
+ (file_command): Constify.
+ * defs.h (symbol_file_command): Constify.
+
+2017-09-27 Tom Tromey <tom@tromey.com>
+
* remote-fileio.c (set_system_call_allowed)
(show_system_call_allowed): Constify.
diff --git a/gdb/defs.h b/gdb/defs.h
index 077a816..cf59602 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -298,7 +298,7 @@ EXTERN_C char *re_comp (const char *);
/* From symfile.c */
-extern void symbol_file_command (char *, int);
+extern void symbol_file_command (const char *, int);
/* * Remote targets may wish to use this as their load function. */
extern void generic_load (const char *name, int from_tty);
diff --git a/gdb/exec.c b/gdb/exec.c
index d20afdc..6eda9b2 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -45,12 +45,10 @@
#include "solist.h"
#include <algorithm>
-void (*deprecated_file_changed_hook) (char *);
+void (*deprecated_file_changed_hook) (const char *);
/* Prototypes for local functions */
-static void file_command (char *, int);
-
static void set_section_command (char *, int);
static void exec_files_info (struct target_ops *);
@@ -398,7 +396,7 @@ exec_file_attach (const char *filename, int from_tty)
If ARGS is NULL, we just want to close the exec file. */
static void
-exec_file_command (char *args, int from_tty)
+exec_file_command (const char *args, int from_tty)
{
char *filename;
@@ -433,7 +431,7 @@ exec_file_command (char *args, int from_tty)
command was added? */
static void
-file_command (char *arg, int from_tty)
+file_command (const char *arg, int from_tty)
{
/* FIXME, if we lose on reading the symbol file, we should revert
the exec file, but that's rough. */
diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h
index 7554245..5c86e98 100644
--- a/gdb/gdbcore.h
+++ b/gdb/gdbcore.h
@@ -127,7 +127,7 @@ extern void (*deprecated_exec_file_display_hook) (const char *filename);
/* Hook for "file_command", which is more useful than above
(because it is invoked AFTER symbols are read, not before). */
-extern void (*deprecated_file_changed_hook) (char *filename);
+extern void (*deprecated_file_changed_hook) (const char *filename);
extern void specify_exec_file_hook (void (*hook) (const char *filename));
diff --git a/gdb/symfile.c b/gdb/symfile.c
index c6e3b90..c6d657b 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1617,7 +1617,7 @@ find_separate_debug_file_by_debuglink (struct objfile *objfile)
conventions (because it is confusing and inconvenient). */
void
-symbol_file_command (char *args, int from_tty)
+symbol_file_command (const char *args, int from_tty)
{
dont_repeat ();