Skip to content

Add optional two-level DAP protocol logging#16

Merged
derekparker merged 1 commit into
go-delve:masterfrom
T-J-Teru:gdb-dap-logging
Apr 29, 2026
Merged

Add optional two-level DAP protocol logging#16
derekparker merged 1 commit into
go-delve:masterfrom
T-J-Teru:gdb-dap-logging

Conversation

@T-J-Teru

Copy link
Copy Markdown
Contributor

When diagnosing issues between the MCP server and a DAP debugger, it is valuable to see what each side thinks was sent and received. A single log cannot provide this because the MCP server's view may diverge from the debugger's view due to message corruption, buffering issues, or bugs in either side. Two levels of logging allow the logs to be diffed to pinpoint exactly where a problem occurs.

Protocol-level logging (protocolLog parameter) records the DAP JSON messages as the MCP server's DAPClient sees them: what it marshaled for sending and what it unmarshaled after reading. This works with all debugger backends.

Tool-level logging (toolLog parameter) enables the debugger's own native DAP logging. For GDB, this passes -iex 'set debug dap-log-file ' so GDB records what it actually received and sent. For Delve, a warning is logged since its DAP output already goes to the server log via stderr.

Both parameters are optional on the debug tool and accept a file path.

When diagnosing issues between the MCP server and a DAP debugger, it is
valuable to see what each side thinks was sent and received. A single
log cannot provide this because the MCP server's view may diverge from
the debugger's view due to message corruption, buffering issues, or
bugs in either side. Two levels of logging allow the logs to be diffed
to pinpoint exactly where a problem occurs.

Protocol-level logging (protocolLog parameter) records the DAP JSON
messages as the MCP server's DAPClient sees them: what it marshaled
for sending and what it unmarshaled after reading. This works with all
debugger backends.

Tool-level logging (toolLog parameter) enables the debugger's own
native DAP logging. For GDB, this passes -iex 'set debug dap-log-file
<path>' so GDB records what it actually received and sent. For Delve,
a warning is logged since its DAP output already goes to the server
log via stderr.

Both parameters are optional on the debug tool and accept a file path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@derekparker derekparker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@derekparker derekparker merged commit f0d4944 into go-delve:master Apr 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants