From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67323 invoked by alias); 23 Jul 2017 16:08:54 -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 64667 invoked by uid 89); 23 Jul 2017 16:08:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:648 X-HELO: gproxy5.mail.unifiedlayer.com Received: from gproxy5-pub.mail.unifiedlayer.com (HELO gproxy5.mail.unifiedlayer.com) (67.222.38.55) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 23 Jul 2017 16:08:51 +0000 Received: from cmgw4 (unknown [10.0.90.85]) by gproxy5.mail.unifiedlayer.com (Postfix) with ESMTP id 350B6140A30 for ; Sun, 23 Jul 2017 10:08:50 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by cmgw4 with id oG8m1v00i2f2jeq01G8pmb; Sun, 23 Jul 2017 10:08:50 -0600 X-Authority-Analysis: v=2.2 cv=G/hsK5s5 c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=G3gG6ho9WtcA:10 a=20KFwNOVAAAA:8 a=KQI3KnLdfosuPGO6v7EA:9 Received: from c-67-176-62-53.hsd1.co.comcast.net ([67.176.62.53]:40826 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1dZJR0-002Pjw-Nx; Sun, 23 Jul 2017 10:08:46 -0600 From: Tom Tromey To: Pedro Alves Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA 03/23] Use gdb_file_up in find_and_open_script References: <20170503224626.2818-1-tom@tromey.com> <20170503224626.2818-4-tom@tromey.com> <8e575587-67d5-3d19-a70b-646a6b712e07@redhat.com> Date: Sun, 23 Jul 2017 16:08:00 -0000 In-Reply-To: <8e575587-67d5-3d19-a70b-646a6b712e07@redhat.com> (Pedro Alves's message of "Fri, 2 Jun 2017 18:24:23 +0100") Message-ID: <87shhnkueq.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Exim-ID: 1dZJR0-002Pjw-Nx X-Source-Sender: c-67-176-62-53.hsd1.co.comcast.net (bapiya) [67.176.62.53]:40826 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-Local-Domain: yes X-SW-Source: 2017-07/txt/msg00338.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: >> -extern int find_and_open_script (const char *file, int search_path, >> - FILE **streamp, char **full_path); >> +extern gdb_file_up >> + find_and_open_script (const char *file, int search_path, >> + gdb::unique_xmalloc_ptr *full_path); >> Pedro> Though I wonder whether using gdb::optional wouldn't look clearer: Pedro> /* The script that was opened. */ Pedro> struct open_script Pedro> { Pedro> gdb_file_up stream; Pedro> gdb::unique_xmalloc_ptr full_path; Pedro> }; [...] I went ahead and did it this way. Tom