From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by sourceware.org (Postfix) with ESMTPS id 5EC113972038 for ; Tue, 15 Sep 2020 13:05:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5EC113972038 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wr1-f47.google.com with SMTP id z1so3255172wrt.3 for ; Tue, 15 Sep 2020 06:05:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=JcNyAAG3HKzYPh522rDD2eJ+TQ/I+PgS15pja2Bcv8A=; b=Q3wTcnEYPRDJw2l1hPYPA8Nq1AWZc58UtwT6oBrMOM8UL015vIHZKW39klCNOvKnQa One7wLtUZURPFCKZ79d3gPeNj+n0cJY4LeOMbxslMYzKYdWwAU+G+zj2z8IZ1KxZQxCU gR+/I+IbStoA58IkPV6JNG/K/arkxvL1c021CWHvFJveDooYtmpD1H68QXXmvpM6eT8z pxiCdu+RKwVF5D0dtKaCrhXFy43SoHPOZtr6CYnxRjtRpssyOMiLC+E6Bi0l1AfN5Yb7 zFekRm4vqtYfwweYKYjImwc7qzTKY1MXNGh+YCBdg3VX+05DIY1khCKbHlXLA64vPoWz uUwg== X-Gm-Message-State: AOAM530cZGrD3RrFYN3ENbLiPA20wRcu2wdGXSJT+BGklraW/oEWjJnj z7v2XOjzD4DS0LL83KXkY0MsBFMZL8h7cg== X-Google-Smtp-Source: ABdhPJzWGE6E94Ud8fU4xAZXIQSTx6ea83yBobbYeaXZF9x2VK03d4iQXCQgR+Gm4n88OhyTKWLkHA== X-Received: by 2002:adf:db43:: with SMTP id f3mr23067098wrj.219.1600175130630; Tue, 15 Sep 2020 06:05:30 -0700 (PDT) Received: from ?IPv6:2001:8a0:f905:5600:eefd:c63:53e0:3e8a? ([2001:8a0:f905:5600:eefd:c63:53e0:3e8a]) by smtp.gmail.com with ESMTPSA id n17sm28095207wrw.0.2020.09.15.06.05.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Sep 2020 06:05:29 -0700 (PDT) Subject: Re: [PATCH][gdb/testsuite] Detect gdb prompt after monitor exit To: Tom de Vries , gdb-patches@sourceware.org References: <20200914192152.GA18245@delia> From: Pedro Alves Message-ID: <4c088e4f-0c8d-62da-215e-b7062296cb33@palves.net> Date: Tue, 15 Sep 2020 14:05:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20200914192152.GA18245@delia> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 15 Sep 2020 13:05:33 -0000 On 9/14/20 8:21 PM, Tom de Vries wrote: > After issuing a "monitor exit" command, we should always get a prompt back, so > check for that. > > Tested on x86_64-linux. > > Any comments? > Good find. > @@ -463,6 +465,15 @@ proc gdbserver_exit { is_mi } { > warning "Timed out waiting for EOF in server after $monitor_exit" > } > } > + if { ! read_prompt } { > + expect { > + -i "$gdb_spawn_id" -re "$gdb_prompt $" { > + } > + timeout { > + warning "Timed out waiting for prompt after $monitor_exit" > + } > + } > + } So if we get the prompt first, we go back to waiting for the eof. But if the eof is first, we currently don't continue waiting for the prompt. Do we really need this new block of code instead of just putting: if {!$read_prompt} { exp_continue } in the eof case? Thanks, Pedro Alves