How to print chained variables using GDB console?
How to print C type variables at GDB console in xcode4? I'm able to print variables using p var, also able to print variables like p myObj.property but unable to print variables that that are on 3rd level depth. For example using p objName.pointerToOtherObject.someProperty does not work. The开发者_如何学Python GDB dislays "There is no member named someProperty." message but it is there for surely. I'm using the 4.02 version of xcode4 but still it sucks when it comes to displaying properties, variables and etc from debug area. I mean it is unable to show the content or arrays and dictionaries, also, sometimes, it is not displaying the values of vars when I move the mouse over that var, in that case I need to click and move the mouse somewhere else and then move the mouse over again, then it works. Maybe I'm missing some hints but those small problems sometimes annoys me :) For object printing I' using po.
The solution would be to use method messaging syntax instead of property syntax:
p [[SomeObj pointerToOtherObject] someProperty]
精彩评论