Skip to content

service/dap: allow clients to specify rebuild on restart - #4103

Merged
aarzilli merged 2 commits into
go-delve:masterfrom
derekparker:wip/dap-recompile-on-restart
Aug 24, 2025
Merged

aarzilli merged 2 commits into
go-delve:masterfrom
derekparker:wip/dap-recompile-on-restart

Conversation

@derekparker

Copy link
Copy Markdown
Member

Adds a new param to the restart request which if set will cause the debugger to recompile the program before restarting it.

Note the existing behavior is unchanged, clients must specify this new flag to trigger a recompile.

Fixes golang/vscode-go#3835 (comment)

Adds a new param to the restart request which if set will cause the
debugger to recompile the program before restarting it.

Note the existing behavior is unchanged, clients *must* specify this new
flag to trigger a recompile.

Fixes
golang/vscode-go#3835 (comment)
Comment thread service/dap/server.go Resolved
Comment thread service/dap/server.go

// TODO(deparker) handle args from the launch regarding re-recording.
discardedBreakpoints, err := s.debugger.Restart(false, "", resetArgs, newArgs, [3]string{}, false)
discardedBreakpoints, err := s.debugger.Restart(false, "", resetArgs, newArgs, [3]string{}, rebuild)

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.

How can this work? The rebuild flag of restart only works if the configuration of the debugger has ExecuteKind set to ExecutingGeneratedFile or ExecutingGeneratedTest but I don't see the dap server setting this and it does its own compilation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Yes.

@aarzilli aarzilli 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

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.

Run > Restart Debugging is Broken in dlv-dap debug adapter

2 participants