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.
This commit is contained in:
Tom Tromey
2014-07-22 10:09:27 -06:00
parent 8981c75857
commit 5f08566b92
5 changed files with 20 additions and 12 deletions

View File

@ -1068,16 +1068,16 @@ captured_main (void *data)
/* The exec file and the symbol-file are the same. If we can't
open it, better only print one error message.
catch_command_errors returns non-zero on success! */
if (catch_command_errors (exec_file_attach, execarg,
!batch_flag, RETURN_MASK_ALL))
if (catch_command_errors_const (exec_file_attach, execarg,
!batch_flag, RETURN_MASK_ALL))
catch_command_errors_const (symbol_file_add_main, symarg,
!batch_flag, RETURN_MASK_ALL);
}
else
{
if (execarg != NULL)
catch_command_errors (exec_file_attach, execarg,
!batch_flag, RETURN_MASK_ALL);
catch_command_errors_const (exec_file_attach, execarg,
!batch_flag, RETURN_MASK_ALL);
if (symarg != NULL)
catch_command_errors_const (symbol_file_add_main, symarg,
!batch_flag, RETURN_MASK_ALL);