Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 17, 2008, 09:43 AM   #1
magneto2007
macrumors newbie
 
Join Date: Sep 2007
Xcode debugger and variable watch

Hi,

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 :-)

Thanks
magneto2007 is offline   0 Reply With Quote
Old May 9, 2008, 03:51 PM   #2
magneto2007
Thread Starter
macrumors newbie
 
Join Date: Sep 2007
nobody use xcode for debugging??
magneto2007 is offline   0 Reply With Quote
Old May 9, 2008, 05:05 PM   #3
lee1210
macrumors 68040
 
lee1210's Avatar
 
Join Date: Jan 2005
Location: Dallas, TX
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:
x/100fg P
or
p P

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:
help x
or
help p

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:
display/100fg P

-Lee

Last edited by lee1210; May 9, 2008 at 05:06 PM. Reason: your variable was uppercase, and i had written it in lowercase
lee1210 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Property doesn't show up in XCode debugger multinode Mac Programming 1 Jun 23, 2013 08:47 AM
Check in xcode where is the value of a variable in memory alexandre16 Mac Programming 27 Dec 2, 2012 01:59 PM
PHP debugger 3heap Mac Applications and Mac App Store 0 Oct 25, 2012 10:28 AM
Viewing values in the debugger KarlJay iPhone/iPad Programming 19 Aug 9, 2012 06:26 PM
watching vars in debugger KarlJay iPhone/iPad Programming 0 Jul 11, 2012 11:57 AM

Forum Jump

All times are GMT -5. The time now is 11:26 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC