Hi,
I wanna view the object value of some STL data when gdb debugging.
I download a script via goold, which discripted "STL GDB evaluators/views/utilities - 1.03", and then copy its content into .gdbinit.
However, some error occurs:
(gdb) pmap
Invalid type combination in equality test.
(gdb) help pmap
Prints std::map<TLeft and TRight> or std::multimap<TLeft and TRight> information. Works for std::multimap as well.
Syntax: pmap <map> <TtypeLeft> <TypeRight> <valLeft> <valRight>: Prints map size, if T defined all elements or just element(s) with val(s)
Examples:
pmap m - prints map size and definition
pmap m int int - prints all elements and map size
pmap m int int 20 - prints the element(s) with left-value = 20 (if any) and map size
pmap m int int 20 200 - prints the element(s) with left-value = 20 and right-value = 200 (if any) and map size
(gdb) pmap
Invalid type combination in equality test.
(gdb) pmap softportList
Invalid type combination in equality test.
(gdb) p softportList
$1 = {
_M_t = {
_M_impl = {
<std::allocator<std::_Rb_tree_node<std:
air<const portNo_t, softportInfo_t> > >> = {
<__gnu_cxx::new_allocator<std::_Rb_tree_node<std:
air<const portNo_t, softportInfo_t> > >> = {<No data fields>}, <No data fields>},
members of std::_Rb_tree<portNo_t,std:
air<const portNo_t, softportInfo_t>,std::_Select1st<std:
air<const portNo_t, softportInfo_t> >,std::less<portNo_t>,std::allocator<std:
air<const portNo_t, softportInfo_t> > >::_Rb_tree_impl<std::less<portNo_t>, false>:
_M_key_compare = {
<std::binary_function<portNo_t,portNo_t,bool>> = {<No data fields>}, <No data fields>},
_M_header = {
_M_color = std::_S_red,
_M_parent = 0x0,
_M_left = 0x8097738,
_M_right = 0x8097738
},
_M_node_count = 0
}
}
}
I don't understand this, later I check its script and found gdb fail to analyse the "$argc", e.g. if $argc is 0, then gdb will execute "help pmap".
Is there anyone met the same case? How to resolve it?
As always, your experience and hints are most welcome.
Thanks in advance.