Skip to content

Commit

Permalink
[Docs] Describe gdbserver lookup issue and a workaround
Browse files Browse the repository at this point in the history
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 this dll - lldb-mi executable in this case (see section BUGS of [the function's man](https://man7.org/linux/man-pages/man3/dladdr.3.html)).
  • Loading branch information
tkrasnukha committed Oct 5, 2021
1 parent db5db4a commit f2acb1f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,13 @@ cmake -DLLVM_ENABLE_PROJECTS="clang;lldb;libcxx;libcxxabi" -DCMAKE_INSTALL_PREFI
// Building lldb-mi
cmake -DCMAKE_PREFIX_PATH=~/buildspace/llvm-inst/ -DUSE_LLDB_FRAMEWORK=1 -GNinja ..
```
```

# Notes

On some architectures (e. g. Linux, x86-64), LLDB dinamic library fails to determine its location. That results to inability of locating a gdbserver stub:
```bash
process launch failed: unable to locate lldb-server
```

The workaraund is to set LLDB_DEBUGSERVER_PATH environment variable before running LLDB-MI.

0 comments on commit f2acb1f

Please sign in to comment.