Useful GDB/LLDB Commands
A practical note for commonly used debugger commands.
Useful GDB/LLDB Commands
1
2
3
4
5
6
7
This GDB supports auto-downloading debuginfo from the following URLs:
<https://debuginfod.ubuntu.com>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
Downloading separate debug info for system-supplied DSO at 0xfffff7ffa000
[Thread debugging using libthread_db enabled]
Debugging cross-compiled FreeBSD/CheriBSD QEMU guest on a native host
To debug FreeBSD/CheriBSD, the debugger (e.g., GDB) should be either built for the target OS/ABI (e.g., FreeBSD/CheriBSD on AArch64/Morello) and then run on the target system, or be built as a cross-debugger that runs on the host system but can understand the target OS/ABI (e.g., aarch64-linux-gnu-gdb running on x86_64 Linux host to debug AArch64 FreeBSD/CheriBSD guest).
For example, if file reports gdb as an AArch64 FreeBSD ELF binary, then it has to be run on the FreeBSD/CheriBSD system. For gdb-native is a cross-debugger that can run on a Mac OS X/Darwin host but can understand AArch64 FreeBSD/CheriBSD ELF objects.
1
2
3
4
$ gdb /
(gdb) set architecture aarch64
(gdb) target remote <ip_address>:<port> # Connect to a remote target (e.g., a QEMU VM) for debugging. The target must be running a GDB server that listens on the specified IP address and port.
This post is licensed under CC BY 4.0 by the author.