Search code examples
c++debuggingstlwindbgdeque

Finding the element count of an stl deque in windbg


How can I find the element count of an STL deque container in windbg?

It appears that the !stl extension doesn't support deques. I've tried looking into the internals of the data structure, but haven't found an obvious member variable for element count.

I have a memory dump of a non-reproducible issue, so logging isn't an option for me.


Solution

  • In recent Visual C++ Standard C++ Library implementations--at least Visual C++ 2008 and Visual C++ 2010--std::deque has a _Mysize data member that holds the number of elements in the container.