From ef5d0b5e97ec8e6fa395d377b09aa7755e345b4f Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 18 Dec 2017 20:12:36 +0000 Subject: Vendor import of lldb trunk r321017: https://llvm.org/svn/llvm-project/lldb/trunk@321017 --- examples/synthetic/libcxx.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'examples/synthetic/libcxx.py') diff --git a/examples/synthetic/libcxx.py b/examples/synthetic/libcxx.py index e6f8223e2dad..97593725a246 100644 --- a/examples/synthetic/libcxx.py +++ b/examples/synthetic/libcxx.py @@ -693,6 +693,13 @@ class stddeque_SynthProvider: except: return None + def _get_value_of_compressed_pair(self, pair): + value = pair.GetChildMemberWithName("__value_") + if not value.IsValid(): + # pre-r300140 member name + value = pair.GetChildMemberWithName("__first_") + return value.GetValueAsUnsigned(0) + def update(self): logger = lldb.formatters.Logger.Logger() try: @@ -709,8 +716,8 @@ class stddeque_SynthProvider: # variable tells which element in this NxM array is the 0th # one, and the 'size' element gives the number of elements # in the deque. - count = self.valobj.GetChildMemberWithName( - '__size_').GetChildMemberWithName('__first_').GetValueAsUnsigned(0) + count = self._get_value_of_compressed_pair( + self.valobj.GetChildMemberWithName('__size_')) # give up now if we cant access memory reliably if self.block_size < 0: logger.write("block_size < 0") @@ -724,8 +731,8 @@ class stddeque_SynthProvider: '__begin_').GetValueAsUnsigned(0) map_end = map_.GetChildMemberWithName( '__end_').GetValueAsUnsigned(0) - map_endcap = map_.GetChildMemberWithName( - '__end_cap_').GetChildMemberWithName('__first_').GetValueAsUnsigned(0) + map_endcap = self._get_value_of_compressed_pair( + map_.GetChildMemberWithName( '__end_cap_')) # check consistency if not map_first <= map_begin <= map_end <= map_endcap: logger.write("map pointers are not monotonic") -- cgit v1.2.3