Wednesday, 11 September 2013

gdb: Cast memory address to an STL object

gdb: Cast memory address to an STL object

I have a memory address that i know is an STL object. Say the address is
0x603340, and I know there is a map there
How do I display the contents of this memory as said object from gdb?
I tried this:
p ('std::map<std::string, std::string*, std::less<std::string>,
std::allocator<std::pair<std::string const, std::string*> > >'*) 0x603340
which gets me:
No symbol "std::map<std::string, std::string*, std::less<std::string>,
std::allocator<std::pair<std::string const, std::string*> > >" in current
context.
Any idea what am I doing wrong? Thanks.

No comments:

Post a Comment