I am trying to debug an application that makes extensive use of C macros (nested macros of macros). It gives "use of undeclared identifier" error.
Is there any way to make LLDB debugger recognize and evaluate it properly? I can decompose the macros myself and write the full expression but it's very tedious and error prone.
The main difference between LLDB and GDB is that in LLDB, the programmer can debug programs written in C, Objective C and C++ while, in GDB, the programmer can debug programs written in Ada, C, C++, Objective C, Pascal, FORTRAN and Go.
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. All of the code in the LLDB project is available under the “Apache 2.0 License with LLVM exceptions”.
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. Both GDB and LLDB are of course excellent debuggers without doubt.
In lldb you can set breakpoints by typing either break or b followed by information on where you want the program to pause. After the b command, you can put either: a function name (e.g., b my_subroutine ) a line number (e.g., b 12 )
Unfortunately this is not gonna happen because we get no debug info for macros from the compiler, which kinda makes sense because macros disappear after the preprocessor does its deed and before the compiler converts your sources to machine code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With