I have a structure that wraps a std::map
, whcih gdb knows how to pretty-print.
I want to write a custom pretty-printer (with python), that delegates to the inner std:::map
and maybe shows the count of existing entries in the map (and hoping that python does not have to traverse the tree for that).
EDIT:
my current wrapper prints ingdb as MyMap<unsigned long, std::__cxx11::basic_string<...>> = {std::map with 2 elements = {[0] = "", [5] = "55555"}}
There is on indirection in there that I would like to remove to:
MyMap<...> with 2 elements = {[0] = "", [5] = "55555"}
the ...
is just me snipping the generic parameter
The display hint im using currently is also "array" and not "map", since I was not able to properly delegate it. The current delegation looks like this:
def children(self):
return [("", self.val['inner'])] # val is the gdb.Value of inner