|Apr 17, 2008, 10:43 AM||#1|
Xcode debugger and variable watch
I am using xcode to compile and debug my software. It's really comfortable to see variables with their contents in the debugger window, but;
let's say that I have a pointer double * P that points to an array of n doubles.
In the debugger window, when I click the small triangle next to P, I can only see the first item of this array, is there a easy/fast way to see the whole array.
In fact I wonder if there is a graphical way to do " (gdb) p P@n "
I have structures in arrays in structures with long names, so writing by hand in gdb console makes me lose time. It'll be very cool if I can do this with one click :-)
|May 9, 2008, 06:05 PM||#3|
I am not at my Mac and haven't used xcode for too much debugging, but have used GDB quite a bit. The way I would print a whole slew of things at contiguous positions in memory would be:
The second may only show you a few items if the array is very long. With the first you see 100 items, but you can increase that. The f means floating point, the g means "giant" for 8 bytes. At the gdb prompt you can type:
To get help with formatting the commands. You can use display/d to show values at every break point if that's what you want:
Last edited by lee1210; May 9, 2008 at 06:06 PM. Reason: your variable was uppercase, and i had written it in lowercase
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Xcode 4 and non-C compilers||mbarriault||Mac Programming||3||Aug 6, 2011 07:51 PM|
|XCODE 4 & viewing global variables||hajiman||Mac Programming||2||Jul 21, 2011 05:31 PM|
|Objective-C/Xcode question on pointers and variables||Sandy Santra||Mac Programming||2||Apr 15, 2009 02:03 PM|
|Xcode debugger issue||capn-slagg||Mac Programming||1||Jun 6, 2007 05:47 PM|
|Xcode Debugger Question||bobber205||Mac Programming||4||Feb 1, 2007 04:11 AM|
All times are GMT -5. The time now is 02:40 PM.