What is the difference between GDB & LLDB debuggers? I recently upgraded my Xcode version from 4.2 to 4.3 & started getting warning to upgrade my debugger from GDB to LLDB.
-
One major difference that is holding me back from changing is that GDB is very clever at printing large arrays with a lot of repetitive content, whereas LLDB just blows out the vertical scrollbar. – Marcelo Cantos Apr 25 '12 at 12:12
-
1What I like about LLDB is that its syntax is more structured. GDB is a bit more free formed. – Jay Q. Apr 29 '13 at 23:48
2 Answers
LLDB is part of the LLVM suite of tools that Apple is moving to, including Clang. There are tons of improved features, including improved performance. There's a quick intro for GDB users here: http://lldb.llvm.org/tutorial.html
However...
You might want to take a trip over to the forums at developer.apple.com. There's a fair bit of rumbling about issues with LLDB at the moment (in XCode 4.3.1). One nasty issue, which people from Apple have confirmed, is that viewing ivars while stepping may show you the wrong values.

- 86,085
- 15
- 179
- 244

- 1,349
- 12
- 8
-
9That error is why you'll find me using GDB for the time being :) – Richard J. Ross III Mar 14 '12 at 21:24
-
Thanks for mentioning this issue! I was getting crazy about what the LLDB debugger showed me. It was quite impossible. GDB works better, indeed. – Martijn Courteaux Jul 10 '12 at 15:07
-
-
1LLDB has definitely gotten better. You'd best start transitioning, once [Redacted] 5 is released, GDB will be gone for good. – infinitetape Jun 30 '13 at 14:09
1. By Difference of Definition
First, what is GDB?
GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it executes -- or what another program was doing at the moment it crashed.
GDB homepage
The GNU Debugger (GDB) is a portable debugger that runs on many Unix-like systems and works for many programming languages, including Ada, Assembly, C, C++, D, Fortran, Go, Objective-C, OpenCL C, Modula-2, Pascal, Rust, and partially others.
Wikipedia
Second, what is LLDB?
LLDB is a next generation, high-performance debugger. It is built as a set of reusable components which highly leverage existing libraries in the larger LLVM Project, such as the Clang expression parser and LLVM disassembler.
LLDB is the default debugger in Xcode on macOS and supports debugging C, Objective-C and C++ on the desktop and iOS devices and simulator.
LLDB homepage
LLDB is Apple’s “from the ground up” replacement for GDB, developed in close coordination with the LLVM compilers to bring you state-of-the-art debugging with extensive capabilities in flow control and data inspection. Starting with Xcode 5, all new and preexisting development projects are automatically reconfigured to use LLDB. The standard LLDB installation provides you with an extensive set of commands designed to be compatible with familiar GDB commands. In addition to using the standard configuration, you can easily customize LLDB to suit your needs.
Apple documentation archive
Both GDB and LLDB are excellent debuggers without doubt. GDB is a debugger part of the GNU project created to work along the GNU compiler. LLDB is debugger part of the LLVM project created to work along the LLVM compiler.
2. By Difference of Debugger Command usage
The majority of the commands are the same.
However, LLDB and GDB are two different debuggers developed by different set of developers and thus have a little bit different commands.
The following two lists clearly indicate commands differences:
The summary of the major differences listed at the linked sites is shown below.
3. By Personal Opinion
LLDB has been fully integrated starting Xcode IDE 5 by default as primary debugger.
From that time, there has been some complaint report about LLDB stability, performance issues and bugs. However, LLVM with LLDB project has been being incredibly improved and upgraded so far as the one of the core open-source project in the world.
So, I think, at least, LLDB should be used for Apple development environment since LLDB stole the position of GDB and is already primary default debugger at least in Apple world.
(In late September, 2016, Xcode 8 integrating LLVM and LLDB was officially released, meaning quite a lot of time has been passed since LLVM/LLDB is default tool-chain for Xcode.)
But, GDB has been historically a strongly verified and battle-proven debugger, for over 30 years, which is awesome.
So, I would use LLDB while using Clang, use GDB while using GCC compiler as the good combination or pair because LLDB is based on LLVM, whereas GDB is the GNU debugger.

- 687
- 1
- 10
- 29

- 2,164
- 1
- 20
- 25