adit
adit

Reputation: 33674

check property value via gdb in xcode

I have set a breakpoint in my code. The code in that line is an if statement

if (((RKMappableObjectTableItem *) item).options){

now I want to see the value of options when the application breaks at this point, how do I do this in xcode?

Upvotes: 2

Views: 414

Answers (2)

Jano
Jano

Reputation: 63697

Set a breakpoint and when execution stops open the console (⇧+⌘+Y) and type the following at the gdb prompt:

po [((RKMappableObjectTableItem *) item) options]

Assuming options is an object, it should work. If it returns a struct try

p (Type)[((RKMappableObjectTableItem *) item) options]

replacing Type with the name of the struct represented by options.

Another option is to open the Variables View (use the icons at the top right in the console) in the console and expand the node for the variable item.

Upvotes: 2

user756245
user756245

Reputation:

An easy way is defining a tmp variable and set its value to options's one. Once the application breaks, it should appear in the locals variables list in the bottom of Xcode's window.

Upvotes: 0

Related Questions