summaryrefslogtreecommitdiff
path: root/lldb/examples
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-11-07 22:17:29 +0000
committerPavel Labath <labath@google.com>2017-11-07 22:17:29 +0000
commit0e0f4be79a00cfbdd51142b7db1198382ec104f2 (patch)
tree3a8df3772ecea4bbcf8ba292e3a68896ac2edfdc /lldb/examples
parentbaab49bd79c37796f34c4f00658f142ed164b008 (diff)
Update tuple/list/deque data formatters to work with newest libc++
Summary: A couple of members of these data structures have been renamed in recent months. This makes sure they still work with the latest libc++ version. Reviewers: jingham, EricWF Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D39602
Diffstat (limited to 'lldb/examples')
-rw-r--r--lldb/examples/synthetic/libcxx.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/lldb/examples/synthetic/libcxx.py b/lldb/examples/synthetic/libcxx.py
index e6f8223e2da..97593725a24 100644
--- a/lldb/examples/synthetic/libcxx.py
+++ b/lldb/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")