Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Unhelpful error message when program is not full path in launch.config #782

Closed
ghost opened this issue Feb 10, 2017 · 5 comments
Closed

Comments

@ghost
Copy link

ghost commented Feb 10, 2017

Summery

When using delve in vscode, I got Failed to continue: "Error: spawn /usr/local/bin/dlv ENOENT" error. Using command line to launch delve works as expected.

Reproduction

  1. Clone https://github.com/surajbarkale-dolby/gb-example/tree/vscode
  2. Execute debug.sh to launch delve to verify that delve works
  3. Launch visual studio code (preferably using code .)
  4. Try launching debugger by pressing F5
@ramya-rao-a
Copy link
Contributor

Can you run which dlv in your command line and see if the value is /usr/local/bin/dlv?

@ghost
Copy link
Author

ghost commented Feb 10, 2017

Yes I installed it using brew and it is located at /usr/local/bin/dlv. The reported version is 0.12.1 with build version v0.12.1.

@ghost
Copy link
Author

ghost commented Feb 10, 2017

The fix is to use full path of executable for "program" key in launch configuration (see this diff).

Thanks to your instructions about debugging the debugger, I was able to pinpoint root cause of this issue. In goDebug.ts, program name is not added to command line (as I did in debug.sh). Instead, vscode-go tries to change directory to the one containing program argument. However, the directory is not valid causing ENOENT error.

We should improve the documentation and add a better error message in goDebug.ts instead of ignoring the error.

I shall try to send a pull request with the change tomorrow.

@ramya-rao-a
Copy link
Contributor

Thanks @surajbarkale-dolby !

Yes, the program key needs to be a full path. I just added a line about this in the wiki

The debugging part of the extension needs some work, we have been trying to improve it in the last few weeks.

Looking forward to your PR.

@ramya-rao-a ramya-rao-a changed the title Unable debug a project which uses gb as build tool Unhelpful error message when program is not full path in launch.config Feb 11, 2017
@ramya-rao-a
Copy link
Contributor

Fixed in the latest update (0.6.54) to the Go extension.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant