Xcode debug lldb remote

I want to do source level debugging of an external environment using Xcode's graphical debugger.

I have an External Build System project with local source files that builds libraries/executables (not macOS or iOS) and creates their dSYM symbol files (also stored locally). I have a script that I can run from Xcode that starts the library/executables (in an external environment), and gets their slide addresses so their symbols can be loaded into lldb. The script also returns a gdb-remote url that I can use with lldb to begin debugging.

Is there a way for Xcode to use the lldb info gathered by my script to start its graphical debugger?

If this feature doesn't exist, then I see two simple ways that this feature could be implemented:

a) In the Run Action, there's a Run Script action in the Pre-actions to start the remote environment and gather the debug info to create a lldb script that has the gdb-remote command, and commands to add the target modules, and to load the target modules with their slide values. All of that I've already implemented. The Run Action can then have an option to launch lldb with the generated lldb source script.

b) The Run Script action in the Pre-actions of the Run Action that sets up the external environment and gathers the debug info can launch lldb itself with the generated lldb source script. The Run Action can have an option to watch the terminal output for an lldb prompt and then take over when the prompt appears.

Post not yet marked as solved Up vote post of joevt Down vote post of joevt
1.6k views

Replies

I also want this.

  • https://lldb.llvm.org/use/remote.html sure seems like it should be possible but maybe Xcode team needs to add support (time to file a feedback I guess).

Add a Comment