diff options
author | Tom Tromey <tromey@redhat.com> | 2014-07-22 10:09:27 -0600 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2014-07-30 08:02:50 -0600 |
commit | 5f08566b92f63e60559577dedfabf9ed517a3ddf (patch) | |
tree | bc36a8f501a9215e252d28ea84df162bc1f11123 /gdb/corefile.c | |
parent | 8981c75857ec8ef645ccb4f7ccc70fccc609085d (diff) | |
download | gdb-5f08566b92f63e60559577dedfabf9ed517a3ddf.zip gdb-5f08566b92f63e60559577dedfabf9ed517a3ddf.tar.gz gdb-5f08566b92f63e60559577dedfabf9ed517a3ddf.tar.bz2 |
constify exec_file_attach
This constifies exec_file_attach and updates the rest of gdb.
Insight will need some minor tweaks after this, though it's worth
noting that I think all that hook stuff can actually just go away. I
sent a patch to this effect once, but since the Insight source
repository situation isn't currently resolved there wasn't a
convenient way to test it.
2014-07-30 Tom Tromey <tromey@redhat.com>
* corefile.c (hook_type, call_extra_exec_file_hooks)
(specify_exec_file_hook): Constify.
* exec.c (exec_file_attach): Make "filename" const.
* gdbcore.h (deprecated_exec_file_display_hook)
(specify_exec_file_hook, exec_file_attach): Constify.
* main.c (captured_main): Use catch_command_errors_const.
Diffstat (limited to 'gdb/corefile.c')
-rw-r--r-- | gdb/corefile.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/corefile.c b/gdb/corefile.c index 8a96d75..89d9e19 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -39,7 +39,6 @@ /* Local function declarations. */ extern void _initialize_core (void); -static void call_extra_exec_file_hooks (char *filename); /* You can have any number of hooks for `exec_file_command' command to call. If there's only one hook, it is set in exec_file_display @@ -50,7 +49,7 @@ static void call_extra_exec_file_hooks (char *filename); only one hook could be set, and which called deprecated_exec_file_display_hook directly. */ -typedef void (*hook_type) (char *); +typedef void (*hook_type) (const char *); hook_type deprecated_exec_file_display_hook; /* The original hook. */ static hook_type *exec_file_extra_hooks; /* Array of additional @@ -87,7 +86,7 @@ core_file_command (char *filename, int from_tty) functions. */ static void -call_extra_exec_file_hooks (char *filename) +call_extra_exec_file_hooks (const char *filename) { int i; @@ -99,7 +98,7 @@ call_extra_exec_file_hooks (char *filename) This is called from the x-window display code. */ void -specify_exec_file_hook (void (*hook) (char *)) +specify_exec_file_hook (void (*hook) (const char *)) { hook_type *new_array; |