public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug testsuite/31382] [gdb/testsuite] 2 errors instead of 1 reported by _dap_read_json
Date: Wed, 14 Feb 2024 14:00:21 +0000	[thread overview]
Message-ID: <bug-31382-4717-co2vlttyrz@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-31382-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=31382

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Fixed by:
...
diff --git a/gdb/testsuite/lib/dap-support.exp
b/gdb/testsuite/lib/dap-support.exp
index 979dfa2cd73..e9595a85418 100644
--- a/gdb/testsuite/lib/dap-support.exp
+++ b/gdb/testsuite/lib/dap-support.exp
@@ -137,6 +137,8 @@ proc dap_send_request {command {obj {}}} {
 # "last_ton" will be set to the TON form of the result.
 proc _dap_read_json {} {
     set length ""
+    set seen_timeout 0
+    set seen_eof 0
     gdb_expect {
        -re "^Content-Length: (\[0-9\]+)\r\n" {
            set length $expect_out(1,string)
@@ -150,13 +152,20 @@ proc _dap_read_json {} {
            # Done.
        }
        timeout {
-           error "timeout reading json header"
+           set seen_timeout 1
        }
        eof {
-           error "eof reading json header"
+           set seen_eof 1
        }
     }

+    if {$seen_timeout} {
+       error "timeout reading json header"     
+    }
+    if {$seen_eof} {
+       error "eof reading json header"
+    }
+
     if {$length == ""} {
        error "didn't find content-length"
     }
...
which gives us:
...
ERROR: tcl error sourcing /data/vries/gdb/src/gdb/testsuite/gdb.dap/eof.exp.
ERROR: timeout reading json header
    while executing
"error "timeout reading json header"    "
    (procedure "_dap_read_json" line 26)
    invoked from within
"_dap_read_json"
    (procedure "_dap_wait_for_event" line 7)
    invoked from within
"_dap_wait_for_event "initialized""
    (file "/data/vries/gdb/src/gdb/testsuite/gdb.dap/eof.exp" line 34)
    invoked from within
"source /data/vries/gdb/src/gdb/testsuite/gdb.dap/eof.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source /data/vries/gdb/src/gdb/testsuite/gdb.dap/eof.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name""
...

There's another gdb_expect in _dap_read_json that looks like it needs the same
treatment.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  reply	other threads:[~2024-02-14 14:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14 13:56 [Bug testsuite/31382] New: " vries at gcc dot gnu.org
2024-02-14 14:00 ` vries at gcc dot gnu.org [this message]
2024-02-14 16:23 ` [Bug testsuite/31382] " vries at gcc dot gnu.org
2024-02-21 13:25 ` cvs-commit at gcc dot gnu.org
2024-02-21 13:26 ` vries at gcc dot gnu.org
2024-02-21 13:26 ` vries at gcc dot gnu.org

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=bug-31382-4717-co2vlttyrz@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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).