From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B8AE4385E002; Wed, 14 Feb 2024 14:00:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B8AE4385E002 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707919221; bh=F/oudxqzEeOF8nMejDuKPBfMMDEsseYfBwwek8wyWPI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yViuyTOul0S4+6ouk3UTS2MvZBy7nBRBYa5+DBbvjWo1eebcRMl/HYozwCcUEHFNU +iHYTlG6uWc/VK3qhud1aVhFb37ewoPqO/Sz/CEVZukc87Co7D0t1FTbBXUFWchaFi WZWWqcsK1TodcC4PXjglNYMC+gcRN+qabArQSHRU= From: "vries at gcc dot gnu.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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: testsuite X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31382 --- Comment #1 from Tom de Vries --- 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"=20=20=20=20=20 + } + if {$seen_eof} { + error "eof reading json header" + } + if {$length =3D=3D ""} { 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 s= ame treatment. --=20 You are receiving this mail because: You are on the CC list for the bug.=