diff options
author | Tom de Vries <tdevries@suse.de> | 2024-02-13 15:53:28 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-02-13 15:53:28 +0100 |
commit | a16034bf6417dc2259fef43fd5bcc2dd1dac562f (patch) | |
tree | 3b036f69547b9e0b2acda56b3a610327b1453963 /gdb/testsuite/gdb.dap | |
parent | 3224e32fb84f034d190ad91d7b9ac86f6800d47a (diff) | |
download | gdb-a16034bf6417dc2259fef43fd5bcc2dd1dac562f.zip gdb-a16034bf6417dc2259fef43fd5bcc2dd1dac562f.tar.gz gdb-a16034bf6417dc2259fef43fd5bcc2dd1dac562f.tar.bz2 |
[gdb/testsuite] Fix fail in gdb.dap/sources.exp
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
...
The fail happens because the request races with the stopping at main as
requested by:
...
if {[dap_launch $testfile stop_at_main 1] == ""} {
...
Fix this by waiting for the stop, in the same way that is done in other
test-cases that use stop_at_main.
Tested on x86_64-linux.
Approved-By: Tom Tromey <tom@tromey.com>
PR testsuite/31374
https://sourceware.org/bugzilla/show_bug.cgi?id=31374
Diffstat (limited to 'gdb/testsuite/gdb.dap')
-rw-r--r-- | gdb/testsuite/gdb.dap/sources.exp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dap/sources.exp b/gdb/testsuite/gdb.dap/sources.exp index f601190..9b56337 100644 --- a/gdb/testsuite/gdb.dap/sources.exp +++ b/gdb/testsuite/gdb.dap/sources.exp @@ -46,6 +46,9 @@ if {$path == ""} { } else { pass "sources.c in loadedSources" + 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]] |