Sign in to follow this  
51mon

STL Debug tools

Recommended Posts

51mon    342
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?

Share this post


Link to post
Share on other sites
raz0r    586
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.

Share this post


Link to post
Share on other sites
51mon    342
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]

Share this post


Link to post
Share on other sites
dhm    202
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

Share this post


Link to post
Share on other sites
51mon    342
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?

Share this post


Link to post
Share on other sites
51mon    342
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?

Share this post


Link to post
Share on other sites
51mon    342
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?

Share this post


Link to post
Share on other sites
Kylotan    9860
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this