I noticed the TotalView tag on this question. Are you asking how to see the values in your array in totalview? If so then the answer is pretty easy.
Lets say you have a pointer p which is of type int * and you have it currently pointing towards an array with 10 integers.
Step 1. Dive on the pointer. That's accomplished by double clicking, clicking the middle mouse button, or using the dive option on the context menu -- all after having placed the mouse cursor on the variable int he source code pane or the stack frame pane.
This will bring up a new window that will say
Expression: p
Address: 0xbfaa1234
Type: int *
and down in the data area will say something like
0x08059199 -> 0x000001a5 (412)
This window is showing you the pointer itself, the address listed is the address of the pointer. The value (0x08059199 in the example above) is the actual value that the pointer has. Everything to the right of the arrow is just a "hint" telling you want it points to.
Step 2. Dive on the pointer again. Repeat the double click or middle mouse button, this time on the data value in the variable window. (So you are double clicking where it says 0x08059199).
This will effectively "dereference" the pointer. Now the window is focused not on pointer itself but the thing that the pointer pointed to. Notice that the address box now contains 0x08059199 which was the value before.
expression: *(((int *) p))
Address: 0x08059199
Type: int
and down in the data area it will say something like
0x000001a5 (412)
Step 3. Cast the data window to the type you want. Just click in the type field and change it to say int[10]. Then hit return.
This tells the debugger that 0x08059199 is the beginning of an array of 10 integers.
The window will grow two new fields: Slice and Filter. You can leave those alone for now, but they can be useful later.
The data area will now show two columns "field" and "value" and 10 rows.
The field column will be the index in the array [0] - [9] and the value column will tell you what data you have in each array location.
Other tips:
In more complicated data structures you can may want to dive on individual elements (which might also be pointers, diving will dereference them as well)
You can always cast to different types or lengths to look at data "as if it was" whatever
You can edit the actual data values by clicking on the value column and editing what you find there. This is useful when you want to provoke specific mis-behavior from your application
You can always undo diving operations with the "<" icon in the upper right hand corner of the variable window.
There are some online videos that you might find helpful at
http://www.totalviewtech.com/support/videos.html?via=resources#0
in particular there is one labeled "getting started with TotalView" and another at the bottom called "TotalView Technologies TotalView demo".
Don't hesitate to contact us at TotalView tech for usage tips!
support at totalviewtech dot com is a good address for that.
Chris Gottbrath
(Chris dot Gottbrath at totalviewtech dot com)
Product Manager at TotalView Tech