Search code examples
cxcodelldb

How do I print C variables in LLDB Debugger?


I'm working in Xcode 4 and I want to print, in the debugger, variables like ints, chars, arrays, custom structs, etc. Is this possible?

With Objective-C I could do something like:

int three = 3;
> po [NSString stringWithFormat:@"%i", three];

Thanks.


Solution

  • po stands for Print Object, which essentially calls the description method on the object.

    Use p to print an integer. For example:

    p three