English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

OK. I'm at a breakpoint in the debugger and now I want to examine the values stored in my arrays. How do I get Visual Studio debugger to show me the data in the arrays? I don't want to see just one value at a time; I want to see the values contained in array indices [100] to [199] for example.

Surely there has to be an easy way to do this. I've been doing it since the 90's in the Borland IDE and since the 80's on VAXs.

And while I'm at it, is there any way that I can plot data from arrays while in the debugger like you can in Matlab?

2007-10-05 03:59:48 · 4 answers · asked by dogsafire 7 in Computers & Internet Programming & Design

When I call up a QuickWatch it shows me only the first element in the array. Is there a way to ask for more elements, specifically, a particular range of array elements?

2007-10-05 04:47:40 · update #1

I'm using Visual Studio 2005 Version 8, SP 1

2007-10-05 04:49:24 · update #2

I forgot an important piece of info - These are float pointers that I'm trying to dereference, not fixed-length arrays.

The way it worked in the Borland debugger is that you clicked on an variable name and provided an index and range. The debugger would go to the address of the variable, offset by the index (based on the size of the variable type being examined) and interpret the next [range] values in the format of the type of the variable being examined.

It didn't care what was in memory there, it simply interpreted the contents of the addresses as the same type as your variable. If you got garbage, it was because 1) your array contained garbage or 2) you had asked for data beyond the end of your array. Even garbage provided useful feedback.

You could even cast the variable to a different type and the debugger would reinterpret the memory addresses in the desired type.

Doesn't Microsoft use array pointers? Surely they do some level of debugging

... don't they?????

2007-10-05 05:05:26 · update #3

4 answers

I don't know about other versions, but right now I'm using VS2005, and I can see the values in an array while stopped in debug mode by right clicking on the variable and selecting "Quick Watch..."

That will produce a nice little window listing all the values in the array. I'm not sure if that's exactly what you want, but that's the closest thing that I'm aware of.

Personally, I have to use VS everyday, and I'm convinced it's the biggest piece of trash IDE that I've ever used.

2007-10-05 04:17:35 · answer #1 · answered by limaxray 3 · 0 0

One way is to specify the index in your debugger. Like arrayname[105] - that should give you the exact value at that index.

If yours were fixed length arrays, getting the value of a range would not be difficult. The debugger would then provide a small + sign beside your array object in the quick watch, and you could expand it to see all the elements.

But with free pointers, the debugger cannot do that. Becasue it does not know the length of the array. And Microsoft has taken a very tight fisted approach towards accessing out of bounds values, even in read only mode by the debugger - so it does not take any risk.

If you are so hell bent on seeing the values of a range, you have to do some little extra work dude:

Option A: Use the managed framework and declare an arraylist object, load it using your native array specifying the length. Your debugger will instantly show all the elements of the array list object expandable/ collapsible with a + sign

Option B: Write them down to a file on the hard disk ([index]:[value] format), open and inspect the file while debugging.

Option C: Declare a test only fixed length array (that you can comment later on), copy the contents of the native pointer array to it, and let the debugger do the rest.

Option D, E, F, ...: Give it up. There are better things to do in life.

2007-10-05 06:23:47 · answer #2 · answered by Koushik Biswas 3 · 0 1

Visual Studio Arrays

2016-12-17 07:28:34 · answer #3 · answered by plyler 4 · 0 0

i will bypass away you to settle on your guy or woman identify, it incredibly is a poem which speaks for many, hits a nerve in the reader and as they have expressed i understand this to be actual, I in basic terms desire to scoop it up the youngster interior and nurture it. 0.33 verse desires punctuation, perchance? yet laughter chanced on - her emotions mend yet laughter chanced on; her emotions mend yet laughter, chanced on - her emotions mend... i don't understand yet without harm it journeys me.

2016-10-21 03:10:03 · answer #4 · answered by Anonymous · 0 0

fedest.com, questions and answers