I've been using visual studio 6 for a couple of years now, and every programer that I have asked this has said, "geez I dunno how to do that." Basically, my problem is that I can't figure out how to get the debugger to show me the contents of c++ variables. For example, this little code snippet:

if( count(key) == 0 )
	(*this)[key] = v;
else
	(*this)[key] += v;

v is a double, so I can see it's value just fine. But if I want to see what is in (*this)[key] before I add v to it, and I put it in my watch list, I get

(*this)[key]	CXX0058: Error: overloaded operator not found

So I find myself doing crap like this:

if( count(key) == 0 )
{
	(*this)[key] = v;
}
else
{
	double CanISeeYouPlease = (*this)[key];
	(*this)[key] += v;
}

(Which, in fact, was done by a previous programmer before I was hired.) Ok, so the reason that I use a debugger is so that I don't have to modify code and wait 5 minutes for a rebuild every time I want to view the contents of a variable. Is visual studio 6 just totally retarded when it comes to displaying c++ variables of types which are not plain-c variable types? Or is there some arcane way to get it to show you the value?

Thanks for any help!

cathy :-)

Anybody? If the reason that nobody is responding is that it is impossible, what tricks do people have to finding out what is in the variables when using visual studio 6?

-- There is declaring a variable of a simple C type and copying from the c++ structure. This requires a software build, and clutters up the code.

-- For variables of type map and vector, I have found that if I open it up, and find _TR.Head.Left.value.second it will show me the first value of the map or vector, which is often what I want.

Does anybody else have any other tips? I find this to be an enormous productivity black hole for me -- hasn't anybody else had the same problems?

cathy :-)

Hi Cathy,

As I´ve just joined the community today, more than two years later than the time of your post, I wonder are you still out there ?

Anyway, the debugger is telling you that the [], which should be referring to a vector, cannot solve it for (*this), or in other words, (*this) is not a vector (or it thinks it isn´t).

Somehow the compiler does not agree, as I assume you have successfully compiled it.

What is exactly "this" ? Can you send me its declaration and its base class declaration, so I may reproduce the behaviour here ?

I never had any sort of problem displaying my object pointers and referrred contents, such as this, this->x, this->y... So I suppose the issue is specific to your classes.

Regards,
RLevy

I suspect that the difference is that you have always used a microsoft debugger more modern than visual studio 6. A couple of people have claimed that the debugger understands c++ in vstudio.net (not sure about vstudio 7)

This article has been dead for over six months. Start a new discussion instead.