Skip to content

mode debug can't set binary path #3761

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

Open
Lioncky opened this issue May 4, 2025 · 2 comments
Open

mode debug can't set binary path #3761

Lioncky opened this issue May 4, 2025 · 2 comments
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@Lioncky
Copy link

Lioncky commented May 4, 2025

launch.sjon

        {
            "name": "XDLMSrv-Debug",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "program": ".", // main.go
            "buildFlags": "-o .vs/debug.exe", // if set this path, the debugger won't launch
            "env": { "_DEBUG": "true"}
        },

if not set, the windows firewall will always show the information of allow or deny the debugger program

@gopherbot gopherbot added this to the Untriaged milestone May 4, 2025
@madelinekalil
Copy link
Contributor

Are you seeing any error messages when trying to launch the debugger?

If you haven't seen it already, here's our documentation about launch configurations for debugging: https://github.com/golang/vscode-go/blob/master/docs/debugging.md
Specific launch.json attributes are listed here: https://github.com/golang/vscode-go/blob/master/docs/debugging.md#launchjson-attributes

@madelinekalil madelinekalil added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label May 5, 2025
@Lioncky
Copy link
Author

Lioncky commented May 5, 2025

❓ Problem Summary:

When using "mode": "debug" in your launch.json for Go in VSCode, the debugger (Delve) compiles a temporary executable like debug_bin_xxxx.exe every time. On Windows:

  • This file changes name every time (due to randomness).
  • Windows Firewall prompts you each time for permission.
  • Specifying buildFlags does not control the output binary name.
  • It's annoying and can block debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants