-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document debugging mage files in VSCode #280
Comments
When you say debug, do you mean with delve to step through it? I haven't needed to do that, but it seems like your procedure should work. What happens when you try to debug the generated mainfile? The comment shouldn't matter if the go tool is passed the file explicitly (and you should be able to set build tags as well) |
@mirogta did you ever figure this out? I'm having a bit of a time with this myself. |
@l50 I haven't figured out. How far did you get with it? |
Gave up and decided to cheap out with print statements like a n00b :P |
Hey folks, I'd love to be able to debug the generated binaries as well. |
This configuration worked for me: https://gist.github.com/perj/ec75ee651135ba0ba9aa64fc7eeb4033 |
@perj, thanks! I don't really use VS code, so let me ask one thing. |
@AndersonQ Technically |
@perj Thanks for the suggestion. I was searching for something similar but your solution wasn't optimal for me for various reasons:
Digging a little bit I found, this solution:
{
"version": "0.2.0",
"configurations": [
{
"name": "Connect to server",
"type": "go",
"request": "attach",
"mode": "remote",
"debugAdapter": "dlv-dap",
"port": 56268,
"host": "127.0.0.1",
"showLog": true,
"trace": "trace",
"cwd": "${workspaceFolder}",
"substitutePath": [
{
"from": "${workspaceFolder}",
# NOTE: replace `<absolute_path>` with the absolute path to your VScode root folder
"to": "<absolute_path>"
}
]
}
]
} |
I can't find any info about debugging mage files.
I've tried to run
mage -keep
and then debug the generatedmage_output_file.go
to no avail. It's probably because of the// +build ignore
restriction in it.Could this be explained in the official docs/website with some examples?
The text was updated successfully, but these errors were encountered: