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

Document macOS usage #19

Open
phil-blain opened this issue Jun 27, 2020 · 0 comments
Open

Document macOS usage #19

phil-blain opened this issue Jun 27, 2020 · 0 comments

Comments

@phil-blain
Copy link

Issue: It's unclear how this package is supposed to work on macOS. I haven't been able to use the conda-forge LLDB at all.

Just doing lldb <executable>, where lldb is installed from this package, does not work (at least on my macOS 10.11.6 system). For a simple "hello-world"-type program, I get::

$ conda create -n lldb lldb
$ conda activate lldb
$ lldb hello
(lldb) target create "hello"
Current executable set to '/path/to/hello' (x86_64).
(lldb) r
error: process launch failed: failed to get reply to handshake packet

The conda-forge lldb recipe uses LLDB_USE_SYSTEM_DEBUGSERVER=ON on macOS:

if [[ "$target_platform" == osx* ]]; then
LLDB_USE_SYSTEM_DEBUGSERVER=ON
else
LLDB_USE_SYSTEM_DEBUGSERVER=OFF
fi

which I guess was done to avoid having to codesign the executable.

The error "process launch failed: failed to get reply to handshake packet" seems to be related to inability for the lldb executable to connect with the system debugserver.

Note: I have several copies of debugserver on my system, none of them are in the PATH. The system LLDB works fine this way...

/Applications/CLion.app/Contents/bin/lldb/mac/LLDB.framework/Resources/debugserver
/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver 
/Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/debugserver
/Users/Philippe/.vscode/extensions/ms-vscode.cpptools-0.28.1/debugAdapters/lldb/bin/debugserver

First reported here: conda-forge/gdb-feedstock#23 (comment)


I have been able (a few times, but not consistently) to debug an executable using these steps:

  1. Adding a call to sleep() in my program
  2. Launching my program: ./sleep
  3. In a separate shell, launch debugserver:
/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver localhost:16000 --attach=sleep
  1. In a third shell, launch lldb and attach to debugserver:
$ lldb
(lldb)  process connect connect://localhost:16000

Maybe it would be easier to actually codesign the executable, as was done in conda-forge/gdb-feedstock#23 ?

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

No branches or pull requests

1 participant