From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id LJ3TI8LvhV/FEAAAWB0awg (envelope-from ) for ; Tue, 13 Oct 2020 14:19:46 -0400 Received: by simark.ca (Postfix, from userid 112) id 838A81EF6F; Tue, 13 Oct 2020 14:19:46 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id ECCA01E58E for ; Tue, 13 Oct 2020 14:19:45 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2251C393C86B; Tue, 13 Oct 2020 18:19:45 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 4E85738618E2 for ; Tue, 13 Oct 2020 18:19:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4E85738618E2 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id F22641E58E; Tue, 13 Oct 2020 14:19:41 -0400 (EDT) Subject: Re: [RESEND][PATCH 5/5] Eliminate mi_run_to_main, introduce mi_clean_restart To: Pedro Alves , gdb-patches@sourceware.org References: <20201012004732.22999-1-pedro@palves.net> <37fd1ff1-289d-a165-e408-0f48f452bb39@palves.net> From: Simon Marchi Message-ID: <0e501a33-cd2a-d680-a1b4-a76a45d8cea1@simark.ca> Date: Tue, 13 Oct 2020 14:19:41 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <37fd1ff1-289d-a165-e408-0f48f452bb39@palves.net> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2020-10-12 2:56 p.m., Pedro Alves wrote: > diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp > index 693c7d2c467..0de3aa8703a 100644 > --- a/gdb/testsuite/lib/mi-support.exp > +++ b/gdb/testsuite/lib/mi-support.exp > @@ -1023,28 +1023,41 @@ proc mi_run_with_cli {args} { > return [eval mi_run_cmd_full 0 $args] > } > > -# > -# Just like run-to-main but works with the MI interface > -# > - > -proc mi_run_to_main { } { > - global suppress_flag > - if { $suppress_flag } { > - return -1 > - } > +# Starts fresh GDB binary and loads an optional executable into GDB. > +# Usage: mi_clean_restart [executable] > +# EXECUTABLE is the basename of the binary. > +# Return -1 if starting gdb or loading the executable failed. > > +proc mi_clean_restart { args } { Again, for a new optional argument I'd suggest using parse_args, meaning calling mi_clean_restart with an explicit binfile would be: mi_clean_restart -binfile ${binfile} But, this is not very important, the next person to add an argument to mi_clean_restart can do it (if it ever happens). The patch LGTM as it is. Simon