summaryrefslogtreecommitdiffstats
path: root/lldb/source/DataFormatters
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-10-30 23:46:27 +0000
committerEnrico Granata <egranata@apple.com>2013-10-30 23:46:27 +0000
commit686f3deb446b6b6a62d9f4a4611859fab0c8a78c (patch)
tree437367f96e2158b7c7790ff15ad955980df5ddda /lldb/source/DataFormatters
parent909d0c063f54ac10d01dcd0c80199e0c826e4ab7 (diff)
downloadbcm5719-llvm-686f3deb446b6b6a62d9f4a4611859fab0c8a78c.tar.gz
bcm5719-llvm-686f3deb446b6b6a62d9f4a4611859fab0c8a78c.zip
This checkin introduces the notion of hardcoded formatters, which LLDB can bind to a ValueObject internally depending on any criteria
User-vended by-type formatters still would prevail on these hardcoded ones For the time being, while the infrastructure is there, no such formatters exist This can be useful for cases such as expanding vtables for C++ class pointers, when there is no clear cut notion of a typename matching, and the feature is low-level enough that it makes sense for the debugger core to be vending it llvm-svn: 193724
Diffstat (limited to 'lldb/source/DataFormatters')
-rw-r--r--lldb/source/DataFormatters/FormatManager.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp
index 15d40b69d65..d4bb0a1c365 100644
--- a/lldb/source/DataFormatters/FormatManager.cpp
+++ b/lldb/source/DataFormatters/FormatManager.cpp
@@ -420,6 +420,13 @@ GetTypeForCache (ValueObject& valobj,
return ConstString();
}
+static lldb::TypeFormatImplSP
+GetHardcodedFormat (ValueObject& valobj,
+ lldb::DynamicValueType use_dynamic)
+{
+ return lldb::TypeFormatImplSP();
+}
+
lldb::TypeFormatImplSP
FormatManager::GetFormat (ValueObject& valobj,
lldb::DynamicValueType use_dynamic)
@@ -445,6 +452,12 @@ FormatManager::GetFormat (ValueObject& valobj,
log->Printf("[FormatManager::GetFormat] Cache search failed. Going normal route");
}
retval = m_categories_map.GetFormat(valobj, use_dynamic);
+ if (!retval)
+ {
+ if (log)
+ log->Printf("[FormatManager::GetFormat] Search failed. Giving hardcoded a chance.");
+ retval = GetHardcodedFormat(valobj, use_dynamic);
+ }
if (valobj_type)
{
if (log)
@@ -456,6 +469,13 @@ FormatManager::GetFormat (ValueObject& valobj,
return retval;
}
+static lldb::TypeSummaryImplSP
+GetHardcodedSummaryFormat (ValueObject& valobj,
+ lldb::DynamicValueType use_dynamic)
+{
+ return lldb::TypeSummaryImplSP();
+}
+
lldb::TypeSummaryImplSP
FormatManager::GetSummaryFormat (ValueObject& valobj,
lldb::DynamicValueType use_dynamic)
@@ -481,6 +501,12 @@ FormatManager::GetSummaryFormat (ValueObject& valobj,
log->Printf("[FormatManager::GetSummaryFormat] Cache search failed. Going normal route");
}
retval = m_categories_map.GetSummaryFormat(valobj, use_dynamic);
+ if (!retval)
+ {
+ if (log)
+ log->Printf("[FormatManager::GetSummaryFormat] Search failed. Giving hardcoded a chance.");
+ retval = GetHardcodedSummaryFormat(valobj, use_dynamic);
+ }
if (valobj_type)
{
if (log)
@@ -493,6 +519,13 @@ FormatManager::GetSummaryFormat (ValueObject& valobj,
}
#ifndef LLDB_DISABLE_PYTHON
+static lldb::SyntheticChildrenSP
+GetHardcodedSyntheticChildren (ValueObject& valobj,
+ lldb::DynamicValueType use_dynamic)
+{
+ return lldb::SyntheticChildrenSP();
+}
+
lldb::SyntheticChildrenSP
FormatManager::GetSyntheticChildren (ValueObject& valobj,
lldb::DynamicValueType use_dynamic)
@@ -518,6 +551,12 @@ FormatManager::GetSyntheticChildren (ValueObject& valobj,
log->Printf("[FormatManager::GetSyntheticChildren] Cache search failed. Going normal route");
}
retval = m_categories_map.GetSyntheticChildren(valobj, use_dynamic);
+ if (!retval)
+ {
+ if (log)
+ log->Printf("[FormatManager::GetSyntheticChildren] Search failed. Giving hardcoded a chance.");
+ retval = GetHardcodedSyntheticChildren(valobj, use_dynamic);
+ }
if (valobj_type)
{
if (log)
OpenPOWER on IntegriCloud