Skip to content
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

lldb-mi failed to locate lldb-server-10.0.0 #66

Closed
Entoryvekum opened this issue Feb 6, 2021 · 3 comments · Fixed by #86
Closed

lldb-mi failed to locate lldb-server-10.0.0 #66

Entoryvekum opened this issue Feb 6, 2021 · 3 comments · Fixed by #86

Comments

@Entoryvekum
Copy link

Entoryvekum commented Feb 6, 2021

When debugging applications lldb-mi report error “process launch failed: unable to locate lldb-server-10.0.0”.

Environment:
Ubuntu 20.04 LTS on WSL2
LLVM 10.0
Clang 10.0.0
LLDB 10.0.0

pic

@jez
Copy link

jez commented Feb 26, 2021

I'm seeing the same problem. I haven't found a workaround yet.

@jez
Copy link

jez commented Feb 26, 2021

I was able to work around this by explicitly setting

export LLDB_DEBUGSERVER_PATH=/usr/bin/lldb-server-11

(for me, the error was "unable to locate lldb-server-11.1.0"—you might want to replace this with wherever you have lldb-server on your system, which is probably lldb-server-10 or lldb-server-10.0.0)


I found that by working backwards from where that error is raised in the LLDB source code:

https://github.com/llvm/llvm-project/blob/1fdec59bffc11ae37eb51a1b9869f0696bfd5312/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp#L1212

I don't believe this setting is documented anywhere except in the source code.

Looking at the source code might be a way to find out what the root cause is (presumably lldb-mi should be able to find lldb-server in most cases, so I'm not sure what's holding it back and reading the source might answer that).

@tkrasnukha tkrasnukha mentioned this issue Oct 5, 2021
@tkrasnukha
Copy link
Member

LLDB uses dladdr function to discover the path to liblldb and looks there for lldb-server. However, sometimes this function returns the path to the executable that loaded liblldb (see section BUGS of the function's man). Since lldb-server is located in the same directory as lldb executable, it works fine. If you move lldb to another directory, you'll have the same error, I think.

I updated Readme with LLDB_DEBUGSERVER_PATH workaround. Close this issue as it is not an lldb-mi bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants