From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 52EA7385B190 for ; Mon, 28 Nov 2022 14:12:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 52EA7385B190 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 2ASECI1l002119 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Nov 2022 09:12:23 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 2ASECI1l002119 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1669644743; bh=QjNl2AR0vcLcqTHItxWuxtjaUi1bkltkYoj2o9nKKsA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=GHZdtyK6C1dXFVzedjhC8eo/rFYSBdKeGzNRUyb6/DhVT1IcJ5zdo8AJ4K4Ex/NyD J5aFfL2HnLWCAXR43VSJ11i2ZZUAnGYi76zbvDi7BJmGaf2gZgaY+pSlkbI8oHaZns Zqf/ywhT0NqGZtK+adOwyeIGkl3EpBYIqlUlawjg= Received: from [10.0.0.11] (unknown [217.28.27.60]) (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 89BA41E0CB; Mon, 28 Nov 2022 09:12:18 -0500 (EST) Message-ID: Date: Mon, 28 Nov 2022 09:12:18 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v2 5/5] gdb: disable commit resumed in target_kill Content-Language: en-US To: Andrew Burgess , gdb-patches@sourceware.org Cc: Simon Marchi References: <20221121171213.1414366-1-simon.marchi@polymtl.ca> <20221121171213.1414366-6-simon.marchi@polymtl.ca> <87a64b2nz3.fsf@redhat.com> From: Simon Marchi In-Reply-To: <87a64b2nz3.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 28 Nov 2022 14:12:18 +0000 X-Spam-Status: No, score=-3032.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >> +proc do_test { action1 action2 } { >> + save_vars { ::GDBFLAGS } { >> + append ::GDBFLAGS " -ex \"maintenance set target-non-stop on\"" >> + clean_restart $::binfile >> + } >> + >> + # Ensure we are at least after the getpid call, shall we need it. > > s/shall/should/ Fixed. > >> + if { ![runto "after_getpid"] } { >> + return >> + } >> + >> + # Some commands below ask for confirmation. Turn that off for simplicity. >> + gdb_test "set confirm off" >> + gdb_test -no-prompt-anchor "continue &" >> + >> + if { $action1 == "kill" } { >> + gdb_test "kill" "Inferior 1 .* killed.*" >> + } elseif { $action1 == "detach" } { >> + set child_pid [get_integer_valueof "mypid" -1] >> + if { $child_pid == -1 } { >> + fail "failed to extract child pid" >> + return >> + } >> + >> + gdb_test "detach" "Inferior 1 .* detached.*" "detach from first instance" >> + >> + # Kill the detached process, to avoid hanging when exiting GDBserver, >> + # when testing with the native-extended-gdbserver board. >> + remote_exec target "kill $child_pid" >> + } elseif { $action1 == "add" } { >> + gdb_test "add-inferior -exec $::binfile" \ >> + "Added inferior 2 on connection 1.*" "add-inferior" >> + gdb_test "inferior 2" "Switching to inferior 2 .*" >> + } elseif { $action1 == "none" } { >> + >> + } else { >> + error "invalid action 1" >> + } >> + >> + if { $action2 == "start" } { >> + gdb_test "start" "Temporary breakpoint $::decimal, main .*" > > When I tested using a recent version of master, I needed to change this > line to: > > gdb_test "start" "Temporary breakpoint $::decimal\(?:\.$::decimal\)?, main .*" > > this is a result of commit 78805ff8aecf0a8c828fb1e2c344fa3a56655120. Fixed. > >> + } elseif { $action2 == "run" } { >> + gdb_test "break main" "Breakpoint $::decimal at $::hex.*" >> + gdb_test "run" "Breakpoint $::decimal, main .*" > > and I ran into the same issue here: > > gdb_test "run" "Breakpoint $::decimal\(?:\.$::decimal\)?, main .*" Fixed, thanks for spotting these. > With those fixes, this LGTM. Thanks, will push. Simon