diff options
Diffstat (limited to 'lldb/examples/synthetic/gnu_libstdcpp.py')
| -rw-r--r-- | lldb/examples/synthetic/gnu_libstdcpp.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lldb/examples/synthetic/gnu_libstdcpp.py b/lldb/examples/synthetic/gnu_libstdcpp.py index c08a42c6063..0d124d75865 100644 --- a/lldb/examples/synthetic/gnu_libstdcpp.py +++ b/lldb/examples/synthetic/gnu_libstdcpp.py @@ -132,6 +132,27 @@ class StdListSynthProvider: except: pass + def has_children(self): + logger = lldb.formatters.Logger.Logger() + if self.count == None: + self.update () + try: + next_val = self.next.GetValueAsUnsigned(0) + prev_val = self.prev.GetValueAsUnsigned(0) + if next_val == 0 or prev_val == 0: + return False + if next_val == self.node_address: + return False + # skip all the advanced logic to detect the exact count of children + # in the interest of speed from this point on, we MIGHT have children + # our loop detection logic will still make nothing show up :) + return True + except: + return False + if self.count == 0: + return False + return True + class StdVectorSynthProvider: def __init__(self, valobj, dict): @@ -225,6 +246,10 @@ class StdVectorSynthProvider: self.count = 0 except: pass + + + def has_children(self): + return self.num_children() > 0 class StdMapSynthProvider: @@ -408,6 +433,8 @@ class StdMapSynthProvider: x = y; return x; + def has_children(self): + return self.num_children() > 0 _map_capping_size = 255 _list_capping_size = 255 |

