STL Debug tools

Started by
11 comments, last by Kylotan 17 years, 4 months ago
I'm error searching a code that has a STL implementation that I find complicated. Now I wonder if there are some good tools to use when debugging? With Visual C++ I can only watch one element of a container at a time, as far as I know. I'm looking for an approach where I can monitor the whole container. How do I best debug STL?
Advertisement
I don't know which version of Visual Studio you're using, but Microsoft has greatly improved upon their debugger in Visual Studio 2005.
You're now able to do something like this.
Quote:Original post by raz0r
I don't know which version of Visual Studio you're using, but Microsoft has greatly improved upon their debugger in Visual Studio 2005.
You're now able to do something like this.


I'm using 2003. Yeah that looks like what I'm after. I'll change to 2005 and hope for the best. Is that functionality automatic?

[Edited by - 51mon on November 25, 2006 10:54:41 AM]
Quote:Original post by 51mon
...Is that functionality automatic?

Yes, as far as I can remember; it's like that out of the box.
Quote:Original post by 51mon
With Visual C++ I can only watch one element of a container at a time, as far as I know. I'm looking for an approach where I can monitor the whole container. How do I best debug STL?


You can watch more than one element in a container at once because you can use expressions in the debugger watch windows.

E.g. for a std::vector<int> called vValues:

vValues.size() - shows size of vector
vValues._Myfirst,10 -- shows first ten elements

You can do similar things with other containers.

Hope that helps,
dhm
There is a problem thought, I'm developing DirectX graphical applications and on my computer VS 2005 doesn't mix with DirectX, but 2003 does. I have no idea why, it seams to be a fact of life, I got newest drivers, patches, legal software and all that. I have seen people use VS 2003 with VS 2005 debug settings, anyone know how I do that?
VS 2005 mixes very nicely with DirectX.
Quote:Original post by bubu LV
VS 2005 mixes very nicely with DirectX.


I was talking about my computer. I have reinstaled both windows and the software many times. I have used two copies of VS and tried many versions of DirectX. I have all the newest patches and drivers, only legal software. I have common hardware. If you have any idea of how I can make it work feel free to tell me, did you have to do anything different when setting up 2005 from 2003?
Could you define what you exactly mean by "doesn't mix"?
Quote:Original post by Kylotan
Could you define what you exactly mean by "doesn't mix"?


Ok I manage to compile it now, maybe I was too hastefull to judge. But the code is not running like it did in VS 2003, is there a different implementation of STL in 2005?

This topic is closed to new replies.

Advertisement