Error Debugging vector and/or Map

Aug 16, 2012 at 1:55 PM

I can't debbug values of vectors and maps (VC6). The intelliSence writes the follow message when I position the cursor above those objects:
 - vector: Recognize two error members, like this:
(error) 0
(error) 0
 - Map: Recognize one error member, like this:
(error) 0

Coordinator
Aug 17, 2012 at 5:31 AM

I think you are confusing Intellisense and Debugger DataTips.

I just did a quick test in a VC6 project built in VS 2010, and the VS 2010 debugger shows the members of std::vector correctly in the debugger. I suspect that you either have a corrupt installation, or your version of Visual Studio is not fully up to date. It's a long shot, but also make sure that you're not linking different versions of the STL libraries into the same executable.

Aug 17, 2012 at 1:46 PM

Thanks for your answer.
I have Visual Studio 6 Service pack 6.
I created a new VC++ Empty Project in VS2010, add the cpp file:
#include <VECTOR>
using namespace std;
void main(){
   vector<int> teste;
   teste.push_back(1);
   teste.push_back(2);
   teste.push_back(3);
}
When I debug the program with default configurations (V100 and all defaults configurations of VS2010), the debugger shows the members correctly. But if I change the Plataform toolset to V60. The debuger don't show the members anymore.
I think I didn't link different versions of the STL because I only did that. I think I don't have a corruption installation because I tried this in 2 different machines. What is your version of VC6?

Coordinator
Aug 17, 2012 at 7:42 PM

I see now the problem. I tested originally on a 64-bit system, where the vector displayed it's actual members instead of the customized inspector defined in autoexp.dat (I'm not sure why my autoexp.dat does not work correctly on the 64-bit machine, but it obviously doesn't). When testing again on a different 32 bit system, I see the same thing you described in your first post. The reason is that the STL container member names have changed, so autoexp.dat uses invalid names in its definition.

You could edit autoexp.dat. I did a quick test by editing the VS 2010 version of autoexp.dat (located at "%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\autoexp.dat"). I changed _Myfirst to _First, _Mylast to _Last, and _Myend to _End in the std::vector definition. This caused the debugger to display the vector as expected for a VC6 module. Unfortunately, the same autoexp.dat is used regardless of the current platform toolset, so making this change causes it to no longer work for later versions of the STL. I don't know of any solution to get things working in all cases.

Aug 17, 2012 at 8:40 PM

Thank you very much!!


It works perfectly.