public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Simon Marchi <simark@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] gdb/testsuite/dap: prefix some procs with _
Date: Thu, 26 Jan 2023 20:22:42 +0000 (GMT)	[thread overview]
Message-ID: <20230126202242.E33E3385842C@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=48680a5f9d8ec2fcfa349ff2006a21b3b788b959

commit 48680a5f9d8ec2fcfa349ff2006a21b3b788b959
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Fri Jan 6 10:35:53 2023 -0500

    gdb/testsuite/dap: prefix some procs with _
    
    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

Diff:
---
 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} {

                 reply	other threads:[~2023-01-26 20:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230126202242.E33E3385842C@sourceware.org \
    --to=simark@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).