A crash course on LLDB
Debuggers are a great tool for inspecting the state of a program at runtime.
LLDB is the LLVM debugger – that is, a debugger built using the LLVM project.
A debugger lets you run a program, stop it at any point, and inspect its state.
Depending on how your program was built, your debug session may be more or less close to the source code. A program built with a lower optimization level (for example, O0
) is going to reflect the way the program was written more naturally than a program built with a higher optimization level.
To put it in simple terms, if you want to use a debugger to inspect your program at the source level, you’re better off building your program with optimization disabled (-O0
) and the debug information enabled (-g
). This is exactly what the Debug
CMake build type is about.
Beyond that, you may have some information, such as the call stack, but you may not have easy access to symbolic information such as the...