summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2014-09-12 00:55:37 +0000
committerEnrico Granata <egranata@apple.com>2014-09-12 00:55:37 +0000
commit340fa53411efe73e4ac00ca305cd79c84d2935be (patch)
tree815bbfcf578c28c26b48f33fc30a540069a3acc0 /lldb/source
parentad0184056f06a32089604402c3d8cf6eabf6956f (diff)
downloadbcm5719-llvm-340fa53411efe73e4ac00ca305cd79c84d2935be.tar.gz
bcm5719-llvm-340fa53411efe73e4ac00ca305cd79c84d2935be.zip
Recent builds of libcxx actually wrap an std::map's children values in a union containing either a member named __cc, or either of __cc and __nc (const vs. non-const). This level of wrapping is quite useless for LLDB to show to people, so try to detect it, and filter it out
llvm-svn: 217651
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/DataFormatters/LibCxxMap.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/lldb/source/DataFormatters/LibCxxMap.cpp b/lldb/source/DataFormatters/LibCxxMap.cpp
index e665f29622d..9a231ad6d11 100644
--- a/lldb/source/DataFormatters/LibCxxMap.cpp
+++ b/lldb/source/DataFormatters/LibCxxMap.cpp
@@ -302,6 +302,10 @@ lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetValueOffset (const l
lldb::ValueObjectSP
lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetChildAtIndex (size_t idx)
{
+ static ConstString g___cc("__cc");
+ static ConstString g___nc("__nc");
+
+
if (idx >= CalculateNumChildren())
return lldb::ValueObjectSP();
if (m_tree == NULL || m_root_node == NULL)
@@ -375,7 +379,31 @@ lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetChildAtIndex (size_t
}
StreamString name;
name.Printf("[%" PRIu64 "]", (uint64_t)idx);
- return (m_children[idx] = ValueObject::CreateValueObjectFromData(name.GetData(), data, m_backend.GetExecutionContextRef(), m_element_type));
+ auto potential_child_sp = ValueObject::CreateValueObjectFromData(name.GetData(), data, m_backend.GetExecutionContextRef(), m_element_type);
+ if (potential_child_sp)
+ {
+ switch (potential_child_sp->GetNumChildren())
+ {
+ case 1:
+ {
+ auto child0_sp = potential_child_sp->GetChildAtIndex(0, true);
+ if (child0_sp && child0_sp->GetName() == g___cc)
+ potential_child_sp = child0_sp;
+ break;
+ }
+ case 2:
+ {
+ auto child0_sp = potential_child_sp->GetChildAtIndex(0, true);
+ auto child1_sp = potential_child_sp->GetChildAtIndex(1, true);
+ if (child0_sp && child0_sp->GetName() == g___cc &&
+ child1_sp && child1_sp->GetName() == g___nc)
+ potential_child_sp = child0_sp;
+ break;
+ }
+ }
+ potential_child_sp->SetName(ConstString(name.GetData()));
+ }
+ return (m_children[idx] = potential_child_sp);
}
bool
OpenPOWER on IntegriCloud