From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id sIClGkXhAmIbagAAWB0awg (envelope-from ) for ; Tue, 08 Feb 2022 16:31:49 -0500 Received: by simark.ca (Postfix, from userid 112) id 6A84C1F3C6; Tue, 8 Feb 2022 16:31:49 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.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 9E45D1EE1A for ; Tue, 8 Feb 2022 16:31:48 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A50CF3858C27 for ; Tue, 8 Feb 2022 21:31:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A50CF3858C27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644355907; bh=l+Wcijw0E7/RM2NU+sVcqJExkzPWamsTbxk9eGUiloE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=te4x3r/WTbh7yfvqubSJgP+RMplZrbYqydBtEx/QYqEwlSQQ8m2bbmD5EixNpdS+9 5p2Asgn9LxOsEGM6J7NqtQjkxMRQSy9AjrZT9YNqIT+Bj8emia9/6aHodlOQPEbbos Mm5ACqYeHqNaPVgurhm3WOwKggoi+VJbFSjebtPU= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 7FF773858D28 for ; Tue, 8 Feb 2022 21:31:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7FF773858D28 X-ASG-Debug-ID: 1644355870-0c856e06ab38bf20001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id 9ECNWm9hvAcYqRSH (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 08 Feb 2022 16:31:10 -0500 (EST) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from epycamd.internal.efficios.com (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) by smtp.ebox.ca (Postfix) with ESMTP id EE1D3441B21; Tue, 8 Feb 2022 16:31:09 -0500 (EST) X-Barracuda-RBL-IP: 192.222.180.24 X-Barracuda-Effective-Source-IP: 192-222-180-24.qc.cable.ebox.net[192.222.180.24] X-Barracuda-Apparent-Source-IP: 192.222.180.24 To: gdb-patches@sourceware.org Subject: [PATCH] gdb/testsuite: make gdb_breakpoint and runto take a linespec Date: Tue, 8 Feb 2022 16:31:09 -0500 X-ASG-Orig-Subj: [PATCH] gdb/testsuite: make gdb_breakpoint and runto take a linespec Message-Id: <20220208213109.2976269-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.35.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1644355870 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 3423 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.95892 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" From: Simon Marchi Change gdb_breakpoint to accept a linespec, not just a function. In fact, no behavior changes are necessary, this only changes the parameter name and documentation. Change runto as well, since the two are so close (runto forwards all its arguments to gdb_breakpoint). I wrote this for a downstrean GDB port, but thought it could be useful upstream, eventually, even though not callers take advantage of it yet. Change-Id: I08175fd444d5a60df90fd9985e1b5dfd87c027cc --- gdb/testsuite/lib/gdb.exp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index a3717a40229..76401d01a91 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -510,9 +510,11 @@ proc gdb_starti_cmd { {inferior_args {}} } { return -1 } -# Set a breakpoint at FUNCTION. If there is an additional argument it is -# a list of options; the supported options are allow-pending, temporary, -# message, no-message and qualified. +# Set a breakpoint using LINESPEC. +# +# If there is an additional argument it is a list of options; the supported +# options are allow-pending, temporary, message, no-message and qualified. +# # The result is 1 for success, 0 for failure. # # Note: The handling of message vs no-message is messed up, but it's based @@ -521,7 +523,7 @@ proc gdb_starti_cmd { {inferior_args {}} } { # no-message: turns off printing of fails (and passes, but they're already off) # message: turns on printing of passes (and fails, but they're already on) -proc gdb_breakpoint { function args } { +proc gdb_breakpoint { linespec args } { global gdb_prompt global decimal @@ -552,9 +554,9 @@ proc gdb_breakpoint { function args } { set print_pass 1 } - set test_name "setting breakpoint at $function" + set test_name "gdb_breakpoint: set breakpoint at $linespec" - send_gdb "$break_command $function\n" + send_gdb "$break_command $linespec\n" # The first two regexps are what we get with -g, the third is without -g. gdb_expect 30 { -re "$break_message \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {} @@ -622,7 +624,7 @@ proc gdb_breakpoint { function args } { # no-message: turns off printing of fails (and passes, but they're already off) # message: turns on printing of passes (and fails, but they're already on) -proc runto { function args } { +proc runto { linespec args } { global gdb_prompt global decimal @@ -639,14 +641,14 @@ proc runto { function args } { set print_pass 1 } - set test_name "running to $function in runto" + set test_name "runto: run to $linespec" # We need to use eval here to pass our varargs args to gdb_breakpoint # which is also a varargs function. - # But we also have to be careful because $function may have multiple + # But we also have to be careful because $linespec may have multiple # elements, and we don't want Tcl to move the remaining elements after - # the first to $args. That is why $function is wrapped in {}. - if ![eval gdb_breakpoint {$function} $args] { + # the first to $args. That is why $linespec is wrapped in {}. + if ![eval gdb_breakpoint {$linespec} $args] { return 0 } -- 2.35.0