GDB vs LLDB

Go up to the main documents page (md)

Both gdb and lldb are excellent debuggers. GDB is part of the GNU framework, and was created to work alongside of g++, which is the GNU C++ compiler. LLDB is part of the LLVM framework, and was created to work alongside of clang++, which is the LLVM C++ compiler.

Ideally, you would use the debugger of the same framework that the compiler is part of. However, a bug with LLVM prevents it from working inside a Ubuntu VirtualBox image (see here for the bug tracker about this issue). Thus, we are going to use gdb instead of lldb, even though we will continue to use the clang++ compiler.

Both debuggers can debug code compiled by either compiler. The only real differences, as far as this class is concerned, have to do with some of the commands. There are other differences between the debuggers, but those differences are not commands that we will see in this course. The full list of commands can be found on the GDB command summary page and the LLDB command summary page.

The majority of the commands are the same; this document only highlights the commands that are different between the two debuggers. The categories listed below match those on the two specific debugger pages (GDB command summary and LLDB command summary).


Assembly-specific commands

Program execution

Breakpoints

Examining data