diff options
| -rw-r--r-- | lldb/examples/synthetic/gnu_libstdcpp.py | 12 | ||||
| -rw-r--r-- | lldb/examples/synthetic/libcxx.py | 10 |
2 files changed, 20 insertions, 2 deletions
diff --git a/lldb/examples/synthetic/gnu_libstdcpp.py b/lldb/examples/synthetic/gnu_libstdcpp.py index 07e25c321a9..88ef55a1d92 100644 --- a/lldb/examples/synthetic/gnu_libstdcpp.py +++ b/lldb/examples/synthetic/gnu_libstdcpp.py @@ -89,6 +89,7 @@ class StdListSynthProvider: def get_child_at_index(self,index): logger = Logger.Logger() + logger >> "Fetching child " + str(index) if index < 0: return None; if index >= self.num_children(): @@ -190,6 +191,7 @@ class StdVectorSynthProvider: def get_child_at_index(self,index): logger = Logger.Logger() + logger >> "Retrieving child " + str(index) if index < 0: return None; if index >= self.num_children(): @@ -257,14 +259,20 @@ class StdMapSynthProvider: map_type = self.valobj.GetType() if map_type.IsReferenceType(): + logger >> "Dereferencing type" map_type = map_type.GetDereferencedType() map_arg_0 = str(map_type.GetTemplateArgumentType(0).GetName()) map_arg_1 = str(map_type.GetTemplateArgumentType(1).GetName()) + logger >> "map has args " + str(map_arg_0) + " and " + str(map_arg_1) + map_arg_0,fixed_0 = self.fixup_class_name(map_arg_0) map_arg_1,fixed_1 = self.fixup_class_name(map_arg_1) + logger >> "arg_0 has become: " + str(map_arg_0) + " (fixed: " + str(fixed_0) + ")" + logger >> "arg_1 has become: " + str(map_arg_1) + " (fixed: " + str(fixed_1) + ")" + # HACK: this is related to the above issue with the typename for std::string # being shortened by clang - the changes to typename display and searching to honor # namespaces make it so that we go looking for std::pair<const std::basic_string<char>, ...> @@ -281,8 +289,12 @@ class StdMapSynthProvider: else: map_arg_type = map_arg_type + ">" + logger >> "final contents datatype is: " + str(map_arg_type) + self.data_type = self.valobj.GetTarget().FindFirstType(map_arg_type) + logger >> "and the SBType is: " + str(self.data_type) + # from libstdc++ implementation of _M_root for rbtree self.Mroot = self.Mheader.GetChildMemberWithName('_M_parent') self.data_size = self.data_type.GetByteSize() diff --git a/lldb/examples/synthetic/libcxx.py b/lldb/examples/synthetic/libcxx.py index 30128f6d32d..94ebb19b391 100644 --- a/lldb/examples/synthetic/libcxx.py +++ b/lldb/examples/synthetic/libcxx.py @@ -97,6 +97,7 @@ class stdvector_SynthProvider: def get_child_at_index(self,index): logger = Logger.Logger() + logger >> "Retrieving child " + str(index) if index < 0: return None; if index >= self.num_children(): @@ -272,6 +273,7 @@ class stdlist_SynthProvider: def get_child_at_index(self,index): logger = Logger.Logger() + logger >> "Fetching child " + str(index) if index < 0: return None; if index >= self.num_children(): @@ -509,11 +511,13 @@ class stdmap_SynthProvider: def get_child_at_index(self,index): logger = Logger.Logger() + logger >> "Retrieving child " + str(index) if index < 0: return None if index >= self.num_children(): return None; if self.garbage: + logger >> "Returning None since this tree is garbage" return None try: iterator = stdmap_iterator(self.root_node,max_count=self.num_children()) @@ -524,6 +528,7 @@ class stdmap_SynthProvider: need_to_skip = (index > 0) current = iterator.advance(index) if current == None: + logger >> "Tree is garbage - returning None" self.garbage = True return None if self.get_data_type(): @@ -538,13 +543,14 @@ class stdmap_SynthProvider: else: # FIXME we need to have accessed item 0 before accessing any other item! if self.skip_size == None: + logger >> "You asked for item > 0 before asking for item == 0, too bad - I have no clue" return None return current.CreateChildAtOffset('[' + str(index) + ']',self.skip_size,self.data_type) else: - print "foo" + logger >> "Unable to infer data-type - returning None (should mark tree as garbage here?)" return None except Exception as err: - print err + logger >> "Hit an exception: " + str(err) return None # Just an example: the actual summary is produced by a summary string: size=${svar%#} |

