Delve: lldb-server needs to be installed in $PATH

Created on 10 Oct 2017  路  9Comments  路  Source: go-delve/delve

  1. What version of Delve are you using (dlv version)?
$ dlv version
Delve Debugger
Version: 1.0.0-rc.1
Build: $Id: b6077a6a35c48a31716aad2ad3fdf77bbdf70abd $
  1. What version of Go are you using? (go version)?
$ go version
go version go1.9.1 darwin/amd64
  1. What operating system and processor architecture are you using?
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.12.3
BuildVersion:   16D32
  1. What did you do?
$ go get -u github.com/derekparker/delve/cmd/dlv
$ dlv exec k6 run samples/http_2.js
  1. What did you expect to see?
    The Go debugger

  2. What did you see instead?

could not launch process: exec: "lldb-server": executable file not found in $PATH
areapi kinenhancement

Most helpful comment

On macOS with Xcode, without installing a standalone CLT, I used

sudo mkdir -p /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/
sudo ln -s "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver" /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/debugserver

It is hard-coded in gdbserver.go around L370, I think it should also find the executable come with Xcode.

All 9 comments

You either need lldb-server in $PATH or debugserver at /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/debugserver, which should be installed with xcode command line tools.

This error can show up for Mac users using delve of version 0.12.2 or above. Not sure why, but doing a xcode-select --install has solved the problem for users who have seen this issue.

in here
this fix my issue.

This isn't really a Delve issue but perhaps the error message could be improved.

Also adding this to "Installation" page would be helpful.
This seems to be standard problem with macos users.

Reference to xcode-select --install is already in the "manual install" section of the docs: https://github.com/derekparker/delve/blob/master/Documentation/installation/osx/install.md#manual-install

On macOS with Xcode, without installing a standalone CLT, I used

sudo mkdir -p /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/
sudo ln -s "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver" /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/debugserver

It is hard-coded in gdbserver.go around L370, I think it should also find the executable come with Xcode.

Would be a nice enhancement. I am using dlv through JetBrains goland IDE and thought the error was wrong since CLT is updated/managed when Xcode is installed.

@unknownzerx since your comment the line has changed from 370 to 302 in gdbserver.go

https://github.com/go-delve/delve/blob/aa0b4eb180124c68a5dbd5389d6d30734735129d/pkg/proc/gdbserial/gdbserver.go#L302

On macOS with Xcode, without installing a standalone CLT, I used

sudo mkdir -p /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/
sudo ln -s "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver" /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/debugserver

It is hard-coded in gdbserver.go around L370, I think it should also find the executable come with Xcode.

This worked for me!! Many thanks.

On macOS with Xcode, without installing a standalone CLT, I used

sudo mkdir -p /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/
sudo ln -s "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver" /Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/debugserver

It is hard-coded in gdbserver.go around L370, I think it should also find the executable come with Xcode.

Good stuff, thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

luminacious picture luminacious  路  5Comments

NanXiao picture NanXiao  路  3Comments

antoineco picture antoineco  路  3Comments

ankur0101 picture ankur0101  路  4Comments

devtoro picture devtoro  路  6Comments