[PATCH 1/3] constify exec_file_attach
Pedro Alves
palves@redhat.com
Thu Jul 24 01:27:00 GMT 2014
On 07/23/2014 10:27 PM, Tom Tromey wrote:
> @@ -420,6 +420,14 @@ typedef struct cmdarg {
> /* Define type VEC (cmdarg_s). */
> DEF_VEC_O (cmdarg_s);
>
> +/* A wrapper for exec_file_attach that has the correct type. */
> +
> +static void
> +call_exec_file_attach (char *arg, int from_tty)
> +{
> + exec_file_attach (arg, from_tty);
> +}
> +
> static int
> captured_main (void *data)
> {
> @@ -1068,7 +1076,7 @@ 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,
> + if (catch_command_errors (call_exec_file_attach, execarg,
> !batch_flag, RETURN_MASK_ALL))
Why not use catch_command_errors_const instead? Seems like
you wouldn't need call_exec_file_attach then.
> catch_command_errors_const (symbol_file_add_main, symarg,
> !batch_flag, RETURN_MASK_ALL);
--
Pedro Alves
More information about the Gdb-patches
mailing list