From patchwork Fri Jan 6 18:57:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 62812 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0623438493DB for ; Fri, 6 Jan 2023 18:58:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0623438493DB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673031518; bh=BzNWSN7HCIq20mneLG2UZjJQgomhHFTXUipEcAWEDNo=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=W+SkfNk+QGvCIy00uly9rzpLPozyJCXqHyqLocff8/lQbQzamDWcwUZpe6KnL1a1j hCnjiTJAQHQpZT6qqh416Z7V1U3bq4ByTiO9xFgc+aH7Q7SyW6oUW5QmEXag3IF3EX SwICfpUcyq37oSaXiCvRD0KCBBpAgY9BWlEDKrUE= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 904503858C1F for ; Fri, 6 Jan 2023 18:57:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 904503858C1F X-ASG-Debug-ID: 1673031451-0c856e762a4b70d0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id ZIB0ODESH4zLZDUx (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Fri, 06 Jan 2023 13:57:31 -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 43F2A441D64; Fri, 6 Jan 2023 13:57:31 -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 Cc: Simon Marchi Subject: [PATCH 7/9] gdb/testsuite/dap: rename dap_read_event to dap_wait_for_event_and_check Date: Fri, 6 Jan 2023 13:57:27 -0500 X-ASG-Orig-Subj: [PATCH 7/9] gdb/testsuite/dap: rename dap_read_event to dap_wait_for_event_and_check Message-Id: <20230106185729.42372-8-simon.marchi@efficios.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230106185729.42372-1-simon.marchi@efficios.com> References: <20230106185729.42372-1-simon.marchi@efficios.com> MIME-Version: 1.0 X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1673031451 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 3268 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=5.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.103363 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-3498.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, 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 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-Patchwork-Original-From: Simon Marchi via Gdb-patches From: Simon Marchi Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" I think that name describes a bit better what the proc does, it is similar to "wait_for" in tuiterm.exp. Change-Id: Ie55aa011e6595dd1b5a874db13881ba572ace419 --- gdb/testsuite/gdb.dap/basic-dap.exp | 10 +++++----- gdb/testsuite/lib/dap-support.exp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gdb/testsuite/gdb.dap/basic-dap.exp b/gdb/testsuite/gdb.dap/basic-dap.exp index 68d0440f692..795702a5a8f 100644 --- a/gdb/testsuite/gdb.dap/basic-dap.exp +++ b/gdb/testsuite/gdb.dap/basic-dap.exp @@ -88,9 +88,9 @@ set bplist [dict get $response body breakpoints] set insn_pc [dict get [lindex $bplist 0] instructionReference] dap_check_request_and_response "start inferior" configurationDone -dap_read_event "inferior started" thread "body reason" started +dap_wait_for_event_and_check "inferior started" thread "body reason" started -dap_read_event "stopped at function breakpoint" stopped \ +dap_wait_for_event_and_check "stopped at function breakpoint" stopped \ "body reason" breakpoint \ "body hitBreakpointIds" $fn_bpno @@ -100,7 +100,7 @@ dap_match_values "global value in function" [lindex $obj 0] \ "body result" 23 dap_check_request_and_response step stepIn {o threadId [i 1]} -dap_read_event "stopped after step" stopped "body reason" step +dap_wait_for_event_and_check "stopped after step" stopped "body reason" step set obj [dap_check_request_and_response "evaluate global second time" \ evaluate {o expression [s global_variable]}] @@ -108,12 +108,12 @@ dap_match_values "global value after step" [lindex $obj 0] \ "body result" 24 dap_check_request_and_response "continue to address" continue -dap_read_event "stopped at address breakpoint" stopped \ +dap_wait_for_event_and_check "stopped at address breakpoint" stopped \ "body reason" breakpoint \ "body hitBreakpointIds" $insn_bpno dap_check_request_and_response "continue to line" continue -dap_read_event "stopped at line breakpoint" stopped \ +dap_wait_for_event_and_check "stopped at line breakpoint" stopped \ "body reason" breakpoint \ "body hitBreakpointIds" $line_bpno diff --git a/gdb/testsuite/lib/dap-support.exp b/gdb/testsuite/lib/dap-support.exp index ee55a4acc9c..179f675b4d8 100644 --- a/gdb/testsuite/lib/dap-support.exp +++ b/gdb/testsuite/lib/dap-support.exp @@ -284,7 +284,7 @@ proc dap_match_values {name d args} { # A helper for dap_read_event that reads events, looking for one # matching TYPE. -proc _dap_read_event {type} { +proc _dap_wait_for_event {type} { while 1 { # We don't do any extra error checking here for the time # being; we'll just get a timeout thrown instead. @@ -303,12 +303,12 @@ proc _dap_read_event {type} { # between a field name (in "dict get" form) and its expected value. # # Returns the dict for the chosen event, or empty string on error. -proc dap_read_event {name type args} { +proc dap_wait_for_event_and_check {name type args} { if {$name == ""} { set name $type } - set result [_dap_read_event $type] + set result [_dap_wait_for_event $type] eval dap_match_values [list $name $result] $args return $result