how to display the content of STL map strucuture with Windbg

Hi all,

here is a simple program with STL map structure using vs2008. we can see it
as following:

// CheckMap.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include
#include
using namespace std;
bool fncomp (char lhs, char rhs) {return lhsstruct classcomp {
bool operator() (const char& lhs, const char& rhs) const
{return lhs};
int main ()
{
map first;
first['a']=10;
first['b']=30;
first['c']=50;
first['d']=70;
map second (first.begin(),first.end()); //set breakpoint
map third (second);
map fourth;
bool(*fn_pt)(char,char) = fncomp;
map fifth (fn_pt);
return 0;
}
--------------------------------------------------------------------------------------------------------------------------------------------

i tried to display the content of STL map structure using windbg, but it
fails. the version of windbg is Microsoft (R) Windows Debugger Version
6.11.0001.404 X86; the OS of target program is windows xp sp2. My tried
steps are as following:
---------------------------------------------------------------------------------------------------------------------------------------------
0:000> dt -ve CheckMap!std::pair
Enumerating symbols matching CheckMap!std::pair
Address Size Symbol
0:000> dt -ve CheckMap!std::pair
Enumerating symbols matching CheckMap!std::pair
Address Size Symbol
0:000> dt first
Local var @ 0x12ff3c Type
std::map,std::allocator<std::pair const>
> >
+0x000 _Myfirstiter : (null)
+0x004 comp : std::less
+0x008 _Alnod :
std::allocatorstd::_tree_nod,std::allocatorstd::pairconst ,int> >,0> >::_Node>
+0x00c _Alptr :
std::allocatorstd::_tree_nod,std::allocatorstd::pairconst ,int> >,0> >::_Node *>
+0x010 _Alval : std::allocator<std::pair const> >
+0x014 _Myhead : 0x003859c8
std::_Tree_nodstd::_tmap_traits,std::allocatorstd::pairconst ,int> >,0> >::_Node
+0x018 _Mysize : 4
0:000> !stl_map 0x12ff3c
No export stl_map found
--------------------------------------------------------------------------------------------------------------------------------------------------------------

Can anybody has idea about how to display the content of STL map structure
using windbg? Thanks

Best Regards,
Carl Cheng</std::pair></std::_tmap_traits></std::pair></std::pair></std::_tree_nod></std::pair></std::_tree_nod></std::pair>

http://www.nynaeve.net/?p=7

Good luck,

mm

Thank you so much, mobrien.

According to the article, the extension DLL only understands the Visual C++
7.0 / 7.1 STL structure layout at present. But VS2008 uses Visual 9.0.

So Windbg cannot display the content of map structure for the program built
by VS2008.

Am I right?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@evitechnology.com
Sent: 2010??2??1?? 19:33
To: Kernel Debugging Interest List
Subject: RE:[windbg] how to display the content of STL map strucuture with
Windbg

http://www.nynaeve.net/?p=7

Good luck,

mm


WINDBG is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

No need to thank me; thank Ken Johnson (Skywing, the author of sdbgext).

Truthfully, I have no idea; I’ve actually never used this feature of sdbgext. I just recalled that sdbgext did have an extension command that was relevant, and mentioned it for that reason.

However, Ken participates in this list, so I’m sure that he will be along sometime in the not too distant future with an answer.

In the meantime, I’d just give it a try if you haven’t already.

Good luck,

mm