LLDB / GDB
You can connect to the stub via LLDB with the address and port for your particular virtual device, located at the bottom of the virtual device page.
Our lldb
command wraps wraps and runs a GDB-remote session. GDB-remote is a protocol used for remote debugging, and both GDB and our LLDB setup supports it. This is useful for running on a remote target and debug programs running on that target, making it possible to use LLDB as a front-end for GDB-remote debugging.
LLDB
The platform supports the version of LLDB that ships with Xcode on macOS. Debugging with LLDB is beneficial for virtual devices running iOS because LLDB already has built-in knowledge of the Mach-O format and the fact that it is dealing with an XNU kernel. It is possible to use the debugger with or without the Mach-O kernel binary. Using the binary slows down load time, but gives you access to the symbols that are in the binary.
GDB
To use GDB directly, you will need an AArch64-compatible GDB. The versions that ship with Ubuntu 16.04 on AArch64, as well as the Linaro public releases since 7.1.1 (x86_64 Linux), have been tested to work. The AArch64 debug protocol was somewhat in flux until 2015, so very old GDB versions may not interoperate correctly.
Examples
To see this in action, check out our guide on Debugging the Kernel.