Skip to main content
GameDev.net gamedev.net
🔒 Locked

STL Debug tools

Started by 51mon Nov 25, 2006 at 7:25 AM 11 replies 1.9k views
Original Post
51mon
51mon
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?
raz0r
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.
51mon
51mon
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]
raz0r
raz0r
Quote:
Original post by 51mon
...Is that functionality automatic?

Yes, as far as I can remember; it's like that out of the box.
dhm
dhm
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 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
51mon
51mon
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?
bubu LV
bubu LV
VS 2005 mixes very nicely with DirectX.
51mon
51mon
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?
Kylotan
Kylotan
Could you define what you exactly mean by "doesn't mix"?
51mon
51mon
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?
Zahlman
Zahlman
Have you tried it in release mode? VS likes to add lots of checks to the standard library containers under debug mode.
Kylotan
Kylotan
Quote:
Original post by 51mon
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?


Again, can you say exactly what you mean by "not running like it did"? You need to be more specific with your information if anybody is to help you.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.