gdb/testsuite: add DAP tests for core-file state-tracking bugs#137
Open
czidev-amd wants to merge 1 commit into
Open
gdb/testsuite: add DAP tests for core-file state-tracking bugs#137czidev-amd wants to merge 1 commit into
czidev-amd wants to merge 1 commit into
Conversation
4c29af0 to
4e7b707
Compare
Author
|
Bug-fixing commit: |
Contributor
|
I tested, reviewed and it looks good to me. |
lumachad
reviewed
May 29, 2026
lumachad
left a comment
Collaborator
There was a problem hiding this comment.
Only some nits. Furthermore, this should be pursue upstream rather than rocgdb. Once pushed upstream, we will pick this up from the regular master syncs.
aktemur
reviewed
Jun 1, 2026
Add two tests in gdb.dap/ covering bugs reported against rocgdb 16.3,
where GDB DAP's state tracker fell out of sync with the inferior
after a core file was loaded.
corefile-cli-preload.exp
Spawn gdb with a core file already attached on the command line
(either '-ex "core-file <core>"' or '-c <core>'), then send one DAP
'initialize' request. In rocgdb 16.3 the response came back with
success=false and message="notStopped" because the pre-loaded core
was not registered as a stopped target. The test asserts
success=true; on failure, a follow-up assertion fires to flag
whether the specific "notStopped" message was returned.
corefile-after-launch.exp
Launch a binary with stopAtBeginningOfMainSubprogram, wait for the
stopped event at main, then load a core file by sending the CLI
command through a DAP 'evaluate' request in the repl context. The
evaluate succeeds and the new core inferior reaches stopped state,
but in rocgdb 16.3 every follow-up DAP request (threads, evaluate,
stackTrace, ...) returned success=false with message="notStopped"
because the state tracker missed the CLI-driven inferior switch.
The test issues 'threads', 'evaluate("info threads")', and
'stackTrace' and asserts each one succeeds.
Both tests reuse the existing gdb.dap/corefile.c source by setting
testfile/srcfile/binfile manually; standard_testfile would otherwise
derive the source name from the .exp basename.
The bugs do not reproduce against current trunk (gdb 18.0.50), so the
tests pass today and will catch regressions if either bug returns.
Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@amd.com>
4e7b707 to
50ce487
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add two tests in gdb.dap/ covering bugs reported against rocgdb 16.3, where GDB DAP's state tracker fell out of sync with the inferior after a core file was loaded.
corefile-cli-preload.exp
Spawn gdb with a core file already attached on the command line
(either '-ex "core-file "' or '-c '), then send one DAP
'initialize' request. In rocgdb 16.3 the response came back with
success=false and message="notStopped" because the pre-loaded core
was not registered as a stopped target. The test asserts
success=true; on failure, a follow-up assertion fires to flag
whether the specific "notStopped" message was returned.
corefile-after-launch.exp
Launch a binary with stopAtBeginningOfMainSubprogram, wait for the
stopped event at main, then load a core file by sending the CLI
command through a DAP 'evaluate' request in the repl context. The
evaluate succeeds and the new core inferior reaches stopped state,
but in rocgdb 16.3 every follow-up DAP request (threads, evaluate,
stackTrace, ...) returned success=false with message="notStopped"
because the state tracker missed the CLI-driven inferior switch.
The test issues 'threads', 'evaluate("info threads")', and
'stackTrace' and asserts each one succeeds.
Both tests reuse the existing gdb.dap/corefile.c source by setting testfile/srcfile/binfile manually; standard_testfile would otherwise derive the source name from the .exp basename.
The bugs do not reproduce against current trunk (gdb 18.0.50), so the tests pass today and will catch regressions if either bug returns.