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>