From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SJvVBT5vuGMnHxEAWB0awg (envelope-from ) for ; Fri, 06 Jan 2023 13:58:06 -0500 Received: by simark.ca (Postfix, from userid 112) id 120F51E222; Fri, 6 Jan 2023 13:58:06 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=K0bA0H4c; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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 39D3D1E15D for ; Fri, 6 Jan 2023 13:58:05 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3EADE385B520 for ; Fri, 6 Jan 2023 18:58:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3EADE385B520 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673031482; bh=GxrdtdpUTOvZ+cbDQszmqJJrJ3OlmEPxQDENPlursUM=; 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=K0bA0H4cJWsN2KXwRq2RBZVWQFH7YTyJhbT+EKGOTWJy7ybd0SxkqkXN46L0HcIk3 9pW3/C5n/8Xy5d2tCh6rOv5zcW2r/gVE1m+gWE9uRhxsikE8694a/a7Zht1DDdsJCH e1C6xAslHdiZd77Uo6SFc+NG2PDZGs07Vtsq7VzE= Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 8E72F3858D39 for ; Fri, 6 Jan 2023 18:57:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8E72F3858D39 X-ASG-Debug-ID: 1673031450-0c856e762b4b7e80001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id QDlUH30qCWLaKtkR (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Fri, 06 Jan 2023 13:57:30 -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 AF934441D65; Fri, 6 Jan 2023 13:57:30 -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 2/9] gdb/testsuite/dap: prefix some procs with _ Date: Fri, 6 Jan 2023 13:57:22 -0500 X-ASG-Orig-Subj: [PATCH 2/9] gdb/testsuite/dap: prefix some procs with _ Message-Id: <20230106185729.42372-3-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 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1673031450 X-Barracuda-Encrypted: AES128-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: 4054 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=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-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" Prefix some procs that are only used internally with an underscore, to make it clear they are internal. If they need to be used by some test later, we can always un-prefix them. Change-Id: Iacb8e77363b5d1f8b98d9ba5a6d115aee5c8925d --- gdb/testsuite/lib/dap-support.exp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gdb/testsuite/lib/dap-support.exp b/gdb/testsuite/lib/dap-support.exp index adf332cd7a5..a91b5533643 100644 --- a/gdb/testsuite/lib/dap-support.exp +++ b/gdb/testsuite/lib/dap-support.exp @@ -98,7 +98,7 @@ proc dap_to_ton {obj} { } # Format the object OBJ, in TON format, as JSON and send it to gdb. -proc dap_send_ton {obj} { +proc _dap_send_ton {obj} { set json [namespace eval ton::2json $obj] # FIXME this is wrong for non-ASCII characters. set len [string length $json] @@ -111,7 +111,7 @@ proc dap_send_ton {obj} { # omitted. The sequence number of the request is automatically added, # and this is also the return value. OBJ is assumed to already be in # TON form. -proc dap_send_request {command {obj {}}} { +proc _dap_send_request {command {obj {}}} { # We can construct this directly as a TON object. set result $::dap_seq incr ::dap_seq @@ -120,13 +120,13 @@ proc dap_send_request {command {obj {}}} { if {$obj != ""} { append req " arguments \[$obj\]" } - dap_send_ton $req + _dap_send_ton $req return $result } # Read a JSON response from gdb. This will return a TON object on # success, or throw an exception on error. -proc dap_read_json {} { +proc _dap_read_json {} { set length "" gdb_expect { -re "^Content-Length: (\[0-9\]+)\r\n" { @@ -181,10 +181,10 @@ proc dap_read_json {} { # emitted. The objects are in TON format. If a response object is # seen but has the wrong sequence number or command, throw an # exception -proc dap_read_response {cmd num} { +proc _dap_read_response {cmd num} { set result {} while 1 { - set obj [dap_read_json] + set obj [_dap_read_json] set d [namespace eval ton::2dict $obj] if {[dict get $d type] == "response"} { if {[dict get $d request_seq] != $num} { @@ -200,14 +200,14 @@ proc dap_read_response {cmd num} { } } -# A wrapper for dap_send_request and dap_read_response. This sends a +# A wrapper for _dap_send_request and _dap_read_response. This sends a # request to gdb and returns the result. NAME is used to issue a pass # or fail; on failure, this always returns an empty string. proc dap_request_and_response {name command {obj {}}} { set result {} if {[catch { - set seq [dap_send_request $command $obj] - set result [dap_read_response $command $seq] + set seq [_dap_send_request $command $obj] + set result [_dap_read_response $command $seq] } text]} { verbose "reason: $text" fail $name @@ -239,7 +239,7 @@ proc dap_check_request_and_response {name command {obj {}}} { # desired. Callers not caring about this should probably use # dap_launch. Returns the empty string on failure. NAME is used as # the test name. -proc dap_initialize {name} { +proc _dap_initialize {name} { if {[dap_gdb_start]} { return "" } @@ -254,7 +254,7 @@ proc dap_initialize {name} { # reasonable default but can be overridden in case a test needs to # launch gdb more than once. proc dap_launch {file {name startup}} { - if {[dap_initialize "$name - initialize"] == ""} { + if {[_dap_initialize "$name - initialize"] == ""} { return "" } return [dap_check_request_and_response "$name - launch" launch \ @@ -303,7 +303,7 @@ proc _dap_read_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. - set obj [dap_read_json] + set obj [_dap_read_json] set d [namespace eval ton::2dict $obj] if {[dict get $d type] == "event" && [dict get $d event] == $type} { -- 2.38.1