From patchwork Wed Aug 15 18:23:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 28929 Received: (qmail 49603 invoked by alias); 15 Aug 2018 18:24:39 -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 35250 invoked by uid 89); 15 Aug 2018 18:24:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=repeat, H*f:sk:1533845, H*f:sk:87bmaav, use-after-free X-HELO: gateway23.websitewelcome.com Received: from gateway23.websitewelcome.com (HELO gateway23.websitewelcome.com) (192.185.49.60) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Aug 2018 18:24:05 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 1706FD4DB for ; Wed, 15 Aug 2018 13:24:03 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id q0SRfGGDCBcCXq0SafoAZs; Wed, 15 Aug 2018 13:24:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To: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=+x4O3L1v2QRcj3Yk/YEZCZH6R4FgKhmCwPlRfM7G8Do=; b=FP7paTw1Mvk0DvIpMY4rYh5Vqe ripkb8hxXc6m+/BUaUENmhvD9WszstHvlCbqI6aunKfwtyimBQlBMGVHpDK7VKw8Ge3F2xOJKdOxj 66Hk8heZXntSFUQNDCqici3Ht; Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:33560 helo=pokyo) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fq0SR-000tSf-6O; Wed, 15 Aug 2018 13:23:47 -0500 From: Tom Tromey To: Tom Tromey Cc: Pedro Alves , Philippe Waroquiers , gdb-patches@sourceware.org Subject: Re: [RFA 1/2] Fix regressions for multi breakpoints command line setting/clearing References: <20180802212613.29813-1-philippe.waroquiers@skynet.be> <20180802212613.29813-2-philippe.waroquiers@skynet.be> <87sh3v1ezc.fsf@tromey.com> <87lg9gi1c4.fsf@tromey.com> <1533845999.1860.1.camel@skynet.be> <878t5fhxdl.fsf@tromey.com> <87ftzmvs42.fsf@tromey.com> <87bmaavrr6.fsf@tromey.com> <840f67ef-2754-5d6b-9c44-83a5f815bd27@redhat.com> <877eksajdp.fsf@tromey.com> Date: Wed, 15 Aug 2018 12:23:46 -0600 In-Reply-To: <877eksajdp.fsf@tromey.com> (Tom Tromey's message of "Tue, 14 Aug 2018 12:33:06 -0600") Message-ID: <8736vfa3pp.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) MIME-Version: 1.0 Tom> I will test a new (much smaller) patch a bit later. This is hilariously simpler and seems to fix the problem. Let me know what you think. Tom commit 06b655186f44cf3cf9f0c9419427a65f6b32cb5c Author: Tom Tromey Date: Wed Aug 15 08:25:49 2018 -0600 Do not allow command repetition from read_next_line Pedro pointed out that the commands being read by "commands" should not be repeatable. This patch fixes that problem, and the use-after-free bug, by simply modifying read_next_line to disallow repetition. Tested by the buildbot. gdb/ChangeLog 2018-08-15 Tom Tromey * cli/cli-script.c (read_next_line): Pass 0 as repeat argument to command_line_input. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9fac8ccf5f4..1e5f5a8e30d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-08-15 Tom Tromey + + * cli/cli-script.c (read_next_line): Pass 0 as repeat argument to + command_line_input. + 2018-08-15 Tom Tromey * aarch64-linux-tdep.c (aarch64_linux_core_read_vq): Use pulongest. diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index 6f31a400197..d03b3bcf60b 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -903,7 +903,7 @@ read_next_line (void) else prompt_ptr = NULL; - return command_line_input (prompt_ptr, from_tty, "commands"); + return command_line_input (prompt_ptr, 0, "commands"); } /* Return true if CMD's name is NAME. */