As the question said. In Xcode 4.6.
Want to print ints, chars, arrays, custom structs etc etc.
Possible?
With Objective-C I could do something like:
int three = 3;
po [NSString stringWithFormat:@"%i", three];
Thanks.
To do that, you can use %format inside an expression path, as in ${var. x->x%u}, which would display the value of x as an unsigned integer. Use this object's location (memory address, register name, …) Since lldb 3.7.
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”.
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 )
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.
po
stands for Print Object, which essentially calls the description
method on the object.
Use p
to print an integer. For example:
p three
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