From patchwork Wed Aug 2 15:02:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 21858 Received: (qmail 27417 invoked by alias); 2 Aug 2017 15:02:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 26621 invoked by uid 89); 2 Aug 2017 15:02:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gproxy2-pub.mail.unifiedlayer.com Received: from gproxy2-pub.mail.unifiedlayer.com (HELO gproxy2-pub.mail.unifiedlayer.com) (69.89.18.3) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 02 Aug 2017 15:02:54 +0000 Received: from cmgw2 (unknown [10.0.90.83]) by gproxy2.mail.unifiedlayer.com (Postfix) with ESMTP id 3D4FA1E13ED for ; Wed, 2 Aug 2017 09:02:46 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by cmgw2 with id sF2j1v00Y2f2jeq01F2meU; Wed, 02 Aug 2017 09:02:46 -0600 X-Authority-Analysis: v=2.2 cv=Aoae5K1P c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=KeKAF7QvOSUA:10 a=zstS-IiYAAAA:8 a=PdBfSNVsLDSfvFCtRjQA:9 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from 174-29-39-24.hlrn.qwest.net ([174.29.39.24]:54692 helo=bapiya.Home) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1dcvAZ-002dpC-2g; Wed, 02 Aug 2017 09:02:43 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA v3 23/23] Remove make_cleanup_freeargv and gdb_buildargv Date: Wed, 2 Aug 2017 09:02:27 -0600 Message-Id: <20170802150227.24460-24-tom@tromey.com> In-Reply-To: <20170802150227.24460-1-tom@tromey.com> References: <20170802150227.24460-1-tom@tromey.com> X-BWhitelist: no X-Exim-ID: 1dcvAZ-002dpC-2g X-Source-Sender: 174-29-39-24.hlrn.qwest.net (bapiya.Home) [174.29.39.24]:54692 X-Source-Auth: tom+tromey.com X-Email-Count: 24 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-Local-Domain: yes After the previous patches in this series, make_cleanup_freeargv and gdb_buildargv are now unused and can be removed. ChangeLog 2017-08-02 Tom Tromey * utils.c (make_cleanup_freeargv, do_freeargv, gdb_buildargv): Remove. * utils.h (make_cleanup_freeargv, gdb_buildargv): Remove. --- gdb/ChangeLog | 6 ++++++ gdb/utils.c | 27 --------------------------- gdb/utils.h | 4 ---- 3 files changed, 6 insertions(+), 31 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 259c37c..de8e046 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2017-08-02 Tom Tromey + * utils.c (make_cleanup_freeargv, do_freeargv, gdb_buildargv): + Remove. + * utils.h (make_cleanup_freeargv, gdb_buildargv): Remove. + +2017-08-02 Tom Tromey + * python/py-param.c (compute_enum_values): Use gdb_argv. 2017-08-02 Tom Tromey diff --git a/gdb/utils.c b/gdb/utils.c index e7e176d..96ae709 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -136,18 +136,6 @@ show_pagination_enabled (struct ui_file *file, int from_tty, because while they use the "cleanup API" they are not part of the "cleanup API". */ -static void -do_freeargv (void *arg) -{ - freeargv ((char **) arg); -} - -struct cleanup * -make_cleanup_freeargv (char **arg) -{ - return make_cleanup (do_freeargv, arg); -} - /* Helper function for make_cleanup_ui_out_redirect_pop. */ static void @@ -2877,21 +2865,6 @@ gdb_argv::reset (const char *s) m_argv = argv; } -/* Call libiberty's buildargv, and return the result. - If buildargv fails due to out-of-memory, call nomem. - Therefore, the returned value is guaranteed to be non-NULL, - unless the parameter itself is NULL. */ - -char ** -gdb_buildargv (const char *s) -{ - char **argv = buildargv (s); - - if (s != NULL && argv == NULL) - malloc_failure (0); - return argv; -} - int compare_positive_ints (const void *ap, const void *bp) { diff --git a/gdb/utils.h b/gdb/utils.h index 88cab4b..c922a22 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -85,8 +85,6 @@ extern int parse_pid_to_attach (const char *args); extern int parse_escape (struct gdbarch *, const char **); -char **gdb_buildargv (const char *); - /* A wrapper for an array of char* that was allocated in the way that 'buildargv' does, and should be freed with 'freeargv'. */ @@ -207,8 +205,6 @@ private: /* Cleanup utilities. */ -extern struct cleanup *make_cleanup_freeargv (char **); - struct ui_out; extern struct cleanup * make_cleanup_ui_out_redirect_pop (struct ui_out *uiout);