Matt Hudson
Matt Hudson

Reputation: 7348

Print an object using GDB debugger by object id (i.e., 0xee63d60)

Is there a way to do a "po" or print object by the object's id/memory location? For instance if I have an object with id: 0xee63d60 can I show what is in that object? I know I can use:

(gdb) info malloc-history 0xee63d60

to get the StackTrace, which is very helpful but I would love to see what is in that object or even what it's name is.

Upvotes: 1

Views: 532

Answers (2)

Josh Hinman
Josh Hinman

Reputation: 6805

(lldb) po 0xee63d60 works for me.

Upvotes: 2

Rob
Rob

Reputation: 4239

I believe if you are paused in a "break point" you can right-click an object and select Print Object. This should print out the "description" of the object. See +(NSString *)description of the NSObject class. You can override this method if you need something more specific.

Hope this Helps

Upvotes: 0

Related Questions