From patchwork Tue Jun 11 13:01:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33085 Received: (qmail 16204 invoked by alias); 11 Jun 2019 13:01:40 -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 16196 invoked by uid 89); 11 Jun 2019 13:01:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.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_PASS autolearn=ham version=3.3.1 spammy=interactions, HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Jun 2019 13:01:34 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 7614856031; Tue, 11 Jun 2019 09:01:33 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZRmp4llcO5to; Tue, 11 Jun 2019 09:01:33 -0400 (EDT) Received: from murgatroyd.Home (174-29-48-168.hlrn.qwest.net [174.29.48.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 22CD15602F; Tue, 11 Jun 2019 09:01:33 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Remove alloca(0) calls Date: Tue, 11 Jun 2019 07:01:31 -0600 Message-Id: <20190611130131.19054-1-tromey@adacore.com> MIME-Version: 1.0 PR gdb/24653 points out that a gcc snapshot will complain about the calls to alloca(0) in gdb. These calls are only needed when using the C alloca. I'm inclined to think that no current platform needs this, so this patch removes the calls. Let me know what you think. gdb/ChangeLog 2019-06-11 Tom Tromey PR gdb/24653: * regcache.c (registers_changed): Don't call alloca. * top.c (execute_command): Don't call alloca. --- gdb/ChangeLog | 6 ++++++ gdb/regcache.c | 7 ------- gdb/top.c | 4 ---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/gdb/regcache.c b/gdb/regcache.c index 6e3eee96631..323f0f5ab4e 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -454,13 +454,6 @@ void registers_changed (void) { registers_changed_ptid (minus_one_ptid); - - /* Force cleanup of any alloca areas if using C alloca instead of - a builtin alloca. This particular call is used to clean up - areas allocated by low level target code which may build up - during lengthy interactions between gdb and the target before - gdb gives control to the user (ie watchpoints). */ - alloca (0); } void diff --git a/gdb/top.c b/gdb/top.c index 4f55d6af1e6..c645f3d455d 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -560,10 +560,6 @@ execute_command (const char *p, int from_tty) auto cleanup_if_error = make_scope_exit (bpstat_clear_actions); scoped_value_mark cleanup = prepare_execute_command (); - /* Force cleanup of any alloca areas if using C alloca instead of - a builtin alloca. */ - alloca (0); - /* This can happen when command_line_input hits end of file. */ if (p == NULL) {