This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/3] constify exec_file_attach
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>, gdb-patches at sourceware dot org
- Date: Thu, 24 Jul 2014 02:24:20 +0100
- Subject: Re: [PATCH 1/3] constify exec_file_attach
- Authentication-results: sourceware.org; auth=none
- References: <1406150844-17134-1-git-send-email-tromey at redhat dot com> <1406150844-17134-2-git-send-email-tromey at redhat dot com>
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