You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of Delve are you using (dlv version)?
Delve Debugger
Version: 1.20.1
Build: $Id: 96e65b6c615845d42e0e31d903f6475b0e4ece6e $
What version of Go are you using? (go version)?
go version go1.19.3 linux/amd64
What operating system and processor architecture are you using?
ubuntu amd64
What did you do?
trying to find a way to get vscode to pass launcharguments which appears to be how to potentially pass dlvFlags to a remote dlv???
What did you expect to see?
Some reference somewhere in either the go vscode extension or in the dlv docs, how to pass these arguments. Something beyond the cryptic Warning: build flags ignored with dap; specify via launch/attach request instead
I can't even seem to find anything in the vscode documentation itself about how to do this; and googling for this info is damn-near impossible because all the responsive documents are about how to pass arguments to the program being debugged (not the debugger itself).
What did you see instead?
cryptic error message
Also, I did open a discussion about this which may end up having some relevant notes: #3461
EDIT: Wouldn't it be simpler/nicer to allow the use of the dlvFlags available to dlv via the config, if nothing is specified in the launch request?! Seems disallowing this just gets in the way of the simplest possible config. E.g. in the below config, the dlvFlags arrive at the far end dlv, which then generates the above Warning, when it could have just used those flags and made my life easy.
Also, maybe the vscode go extension needs a bug filed on this issue too? I'm guessing it supplies some kind of validation schema for "type":go configurations, and that validation schema does not seem to allow specifying an "arguments" item, if that's what's needed.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/go/cmd/thingBeingDebugged",
"env": {},
"dlvFlags": [
"--build-flags",
"-mod=mod"
],
"args": [
"-progarg1"
]
}
]
}
The text was updated successfully, but these errors were encountered:
I'm leaving this open since an update to the error message may be warranted.
The solution seems to be to use buildFlags in launch.json. It took quite a bit of digging to figure this out, and it may be good to change the wording of the help message provided by delve. E.g., it could say Warning: configured build flags ignored in dap mode; specify within launch/attach request instead (e.g., vscode-go's buildFlags in launch.json)
I'm assuming in practice 99% of dap mode use is via vscode.
aarzilli
changed the title
passing dlvFlags from vscode in dap mode seems impossible
Warning message when specifying build flags in dap mode is unclear
Aug 11, 2023
What version of Delve are you using ($Id: 96e65b6c615845d42e0e31d903f6475b0e4ece6e $
dlv version
)?Delve Debugger
Version: 1.20.1
Build:
What version of Go are you using? (
go version
)?go version go1.19.3 linux/amd64
What operating system and processor architecture are you using?
ubuntu amd64
What did you do?
trying to find a way to get vscode to pass
launch
arguments
which appears to be how to potentially passdlvFlags
to a remote dlv???What did you expect to see?
Some reference somewhere in either the go vscode extension or in the dlv docs, how to pass these arguments. Something beyond the cryptic
Warning: build flags ignored with dap; specify via launch/attach request instead
I can't even seem to find anything in the vscode documentation itself about how to do this; and googling for this info is damn-near impossible because all the responsive documents are about how to pass arguments to the program being debugged (not the debugger itself).
What did you see instead?
cryptic error message
Also, I did open a discussion about this which may end up having some relevant notes: #3461
EDIT: Wouldn't it be simpler/nicer to allow the use of the dlvFlags available to dlv via the config, if nothing is specified in the launch request?! Seems disallowing this just gets in the way of the simplest possible config. E.g. in the below config, the dlvFlags arrive at the far end dlv, which then generates the above Warning, when it could have just used those flags and made my life easy.
Also, maybe the vscode go extension needs a bug filed on this issue too? I'm guessing it supplies some kind of validation schema for "type":go configurations, and that validation schema does not seem to allow specifying an "arguments" item, if that's what's needed.
The text was updated successfully, but these errors were encountered: