delve icon indicating copy to clipboard operation
delve copied to clipboard

(DAP) Arbitrary command execution

Open firelizzard18 opened this issue 5 months ago • 2 comments

As I understand it, when I type something into the entry field/bar at the bottom of vscode's debugger pane, that is sent to delve as an evaluation request. AFAIK this supports one 'command': call.

I propose adding support for arbitrary command execution: If the string to be evaluated is prefixed with >, the input is treated as a command and processed in the same way dlv cli commands would be processed. For example this would help enable multiprocess debugging by adding support for executing > target follow-exec -on (#3947).

firelizzard18 avatar Jul 29 '25 18:07 firelizzard18

Some of this already exists, the prefix is "dlv " but it doesn't support many commands: https://github.com/go-delve/delve/blob/2e540ac0f0a2f0fdb463b422a9a628bad870cc69/service/dap/command.go#L81

aarzilli avatar Jul 30 '25 12:07 aarzilli

My thought behind the > prefix is that it is that should prevent it from being a valid Go expression, and it may be familiar to vscode users since > is the prefix that tells vscode's command pallet that you want to execute a command (vs open a file/etc).

firelizzard18 avatar Jul 30 '25 18:07 firelizzard18