From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10716 invoked by alias); 24 Jul 2014 01:24:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 10706 invoked by uid 89); 24 Jul 2014 01:24:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 24 Jul 2014 01:24:23 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6O1OMNa002127 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 23 Jul 2014 21:24:22 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6O1OLFc001901; Wed, 23 Jul 2014 21:24:21 -0400 Message-ID: <53D06044.4060808@redhat.com> Date: Thu, 24 Jul 2014 01:27:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 1/3] constify exec_file_attach References: <1406150844-17134-1-git-send-email-tromey@redhat.com> <1406150844-17134-2-git-send-email-tromey@redhat.com> In-Reply-To: <1406150844-17134-2-git-send-email-tromey@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-07/txt/msg00598.txt.bz2 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