From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 830493858C50; Tue, 13 Feb 2024 14:53:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 830493858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707835998; bh=GJqreJIGUOmvg563dfUbB1ZdiDisypo1gwNFXP5l8es=; h=From:To:Subject:Date:From; b=FPb5HtffuvSP6HgpuRp/xmvnOKWzbVUnHKCGu1cm/4fIzC88gNLwbzkvVq8Bb+dUG xQpsjDWO8WJDIhWtX4VMtVxKFbB5Zf50N8b48goclZ84NuaKv5l0JF4DNxVDqQIGL1 8VRxo0msO1nRshGvnX4Kvmt90FKibGy0Xh4RW/LY= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix fail in gdb.dap/sources.exp X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 3224e32fb84f034d190ad91d7b9ac86f6800d47a X-Git-Newrev: a16034bf6417dc2259fef43fd5bcc2dd1dac562f Message-Id: <20240213145318.830493858C50@sourceware.org> Date: Tue, 13 Feb 2024 14:53:18 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da16034bf6417= dc2259fef43fd5bcc2dd1dac562f commit a16034bf6417dc2259fef43fd5bcc2dd1dac562f Author: Tom de Vries Date: Tue Feb 13 15:53:28 2024 +0100 [gdb/testsuite] Fix fail in gdb.dap/sources.exp =20 With test-case gdb.dap/sources.exp, I run into: ... {"request_seq": 4, "type": "response", "command": "source", \ "success": false, "message": "notStopped", \ "seq": 11}FAIL: gdb.dap/sources.exp: get source success ... =20 The fail happens because the request races with the stopping at main as requested by: ... if {[dap_launch $testfile stop_at_main 1] =3D=3D ""} { ... =20 Fix this by waiting for the stop, in the same way that is done in other test-cases that use stop_at_main. =20 Tested on x86_64-linux. =20 Approved-By: Tom Tromey =20 PR testsuite/31374 https://sourceware.org/bugzilla/show_bug.cgi?id=3D31374 Diff: --- gdb/testsuite/gdb.dap/sources.exp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/testsuite/gdb.dap/sources.exp b/gdb/testsuite/gdb.dap/sour= ces.exp index f601190d6f5..9b56337e5a8 100644 --- a/gdb/testsuite/gdb.dap/sources.exp +++ b/gdb/testsuite/gdb.dap/sources.exp @@ -46,6 +46,9 @@ if {$path =3D=3D ""} { } else { pass "sources.c in loadedSources" =20 + dap_wait_for_event_and_check "stopped at function breakpoint" stopped \ + "body reason" breakpoint + set obj [dap_check_request_and_response "get source" source \ [format {o source [o path [s %s]] \ sourceReference [i 0]} $path]]