Gdb core file support#17
Merged
Merged
Conversation
derekparker
reviewed
Apr 29, 2026
GDB's DAP implementation does not support core files via the launch
request. When the MCP server sent a launch request with a coreFile
argument, GDB ignored coreFile and ran the program from scratch,
resulting in a hang followed by session termination.
Upstream GDB handles core files via the attach request with a coreFile
argument, this has been added with GDB commit:
commit 0a481bb9a6d49591a7f21b132ff63a96704bce97
Date: Mon Mar 23 22:25:17 2026 +0000
gdb/dap: add support for opening core files
which is merged to GDB's master branch, and should be in the GDB 18
release later this year (2026). The approach taken by GDB is
consistent with how lldb-dap also handles core files. This commit
updates the server to make use of this new GDB functionality, after
which basic core file debugging now works as expected.
Delve continues to use launch requests with debug mode "core", and
should see no change after this commit.
A new CoreRequestType() method on the DebuggerBackend interface lets
each backend declare which DAP request type to use for core dump
debugging. The "core" debug mode uses this to create an appropriate
request type.
The only problem with this approach is that it requires building top
of tree GDB in order to test it.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GDB can auto-detect the executable from a core file, so the path parameter is no longer required when using GDB in core mode. Delve still requires the path as it cannot perform this auto-detection. The gdbBackend.CoreArgs() method now omits the "program" field from the DAP attach request when no path is specified, letting GDB resolve it from the core file metadata. Adds TestGDBCoreDumpWithoutPath to verify path-less core debugging works alongside the existing TestGDBCoreDump with-path test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
813ad4e to
ab44fdf
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.
Two changes to improve core file debugging using GDB.
path, instead allowing GDB to auto-detect it. I don't know if the delve debugger supports this, so for now I've leftpathas required when using delve for core file debug. I've also updated the docs in this commit, which in a few places meant adding text describing core file debug as it was otherwise missing.