From patchwork Tue Aug 6 20:43:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33981 Received: (qmail 55024 invoked by alias); 6 Aug 2019 20:43:44 -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 54844 invoked by uid 89); 6 Aug 2019 20:43:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway22.websitewelcome.com Received: from gateway22.websitewelcome.com (HELO gateway22.websitewelcome.com) (192.185.47.125) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Aug 2019 20:43:41 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 7D493726B for ; Tue, 6 Aug 2019 15:43:40 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id v6J2hgayziQerv6J2h48YS; Tue, 06 Aug 2019 15:43:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=foS2da7l/TsnsQJMckDcLj28cVDnoD5E8jVfEff1GYA=; b=G/je38SPQYyK3GpYxVCPSEeTXq 67VNxIfApEgrBArnqXCsmw1kDmAW/z4W8AxN3CAXfnNf6GHv07ekAWq0vsC5bT+G8ADuIAdG1TFyS y6KUoa1atqp5668acABHsdSh7; Received: from 97-122-178-82.hlrn.qwest.net ([97.122.178.82]:57414 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hv6J2-003V9n-8A; Tue, 06 Aug 2019 15:43:40 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 4/8] Remove gdb workaround from readline/xfree.c Date: Tue, 6 Aug 2019 14:43:30 -0600 Message-Id: <20190806204334.13441-5-tom@tromey.com> In-Reply-To: <20190806204334.13441-1-tom@tromey.com> References: <20190806204334.13441-1-tom@tromey.com> There is a gdb-local patch to deal with interrupts during completion. The original thread adding this patch is here: https://sourceware.org/ml/gdb-patches/2011-06/msg00147.html I believe readline now implements the approach suggested by Chet Ramey: https://sourceware.org/ml/gdb-patches/2011-06/msg00493.html So, I believe this patch can be removed. 2018-10-07 Tom Tromey * Makefile.in (xfree.o): Don't depend on readline.h. * xfree.c (xfree): Remove gdb workaround. * xmalloc.h (xfree): Remove #define. --- readline/ChangeLog.gdb | 6 ++++++ readline/Makefile.in | 2 +- readline/xfree.c | 7 ------- readline/xmalloc.h | 3 --- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/readline/Makefile.in b/readline/Makefile.in index 0916d33e065..1adfc286b81 100644 --- a/readline/Makefile.in +++ b/readline/Makefile.in @@ -437,7 +437,7 @@ vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h vi_mode.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h vi_mode.o: history.h ansi_stdlib.h rlstdc.h xfree.o: ${BUILD_DIR}/config.h -xfree.o: ansi_stdlib.h readline.h +xfree.o: ansi_stdlib.h xmalloc.o: ${BUILD_DIR}/config.h xmalloc.o: ansi_stdlib.h diff --git a/readline/xfree.c b/readline/xfree.c index d3af7d9aef0..37a81e6c236 100644 --- a/readline/xfree.c +++ b/readline/xfree.c @@ -31,10 +31,7 @@ # include "ansi_stdlib.h" #endif /* HAVE_STDLIB_H */ -#include - #include "xmalloc.h" -#include "readline.h" /* **************************************************************** */ /* */ @@ -48,10 +45,6 @@ void xfree (string) PTR_T string; { - /* Leak a bit. */ - if (RL_ISSTATE(RL_STATE_SIGHANDLER)) - return; - if (string) free (string); } diff --git a/readline/xmalloc.h b/readline/xmalloc.h index 0fb6a1960e1..f40d7a596a2 100644 --- a/readline/xmalloc.h +++ b/readline/xmalloc.h @@ -38,9 +38,6 @@ #endif /* !PTR_T */ -/* xmalloc and xrealloc should be also protected from RL_STATE_SIGHANDLER. */ -#define xfree xfree_readline - extern PTR_T xmalloc PARAMS((size_t)); extern PTR_T xrealloc PARAMS((void *, size_t)); extern void xfree PARAMS((void *));