summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Debugger.cpp
diff options
context:
space:
mode:
authorEnrico Granata <granata.enrico@gmail.com>2011-07-19 02:34:21 +0000
committerEnrico Granata <granata.enrico@gmail.com>2011-07-19 02:34:21 +0000
commit1490c6fd8fa7a5a2cdfe2d6d0fb4eedf0d601a2d (patch)
treec6c83203e9c9a3e95eabea6fa478559bd24c3e38 /lldb/source/Core/Debugger.cpp
parent8608e6e91385a069dd713506bc19b86d015480ad (diff)
downloadbcm5719-llvm-1490c6fd8fa7a5a2cdfe2d6d0fb4eedf0d601a2d.tar.gz
bcm5719-llvm-1490c6fd8fa7a5a2cdfe2d6d0fb4eedf0d601a2d.zip
Fixed a bug where deleting a regex summary would not immediately reflect in the variables display
The "systemwide summaries" feature has been removed and replaced with a more general and powerful mechanism. Categories: - summaries can now be grouped into buckets, called "categories" (it is expected that categories correspond to libraries and/or runtime environments) - to add a summary to a category, you can use the -w option to type summary add and give a category name (e.g. type summary add -f "foo" foo_t -w foo_category) - categories are by default disabled, which means LLDB will not look into them for summaries, to enable a category use "type category enable". once a category is enabled, LLDB will look into that category for summaries. the rules are quite trivial: every enabled category is searched for an exact match. if an exact match is nowhere to be found, any match is searched for in every enabled category (whether it involves cascading, going to base classes, ...). categories are searched into the order in which they were enabled (the most recently enabled category first, then the second most and so on..) - by default, most commands that deal with summaries, use a category named "default" if no explicit -w parameter is given (the observable behavior of LLDB should not change when categories are not explicitly used) - the systemwide summaries are now part of a "system" category llvm-svn: 135463
Diffstat (limited to 'lldb/source/Core/Debugger.cpp')
-rw-r--r--lldb/source/Core/Debugger.cpp190
1 files changed, 56 insertions, 134 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index cde5da77d05..1c62a8cb46f 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -1714,253 +1714,175 @@ GetFormatManager() {
}
bool
-Debugger::ValueFormats::Get(ValueObject& vobj, ValueFormat::SharedPointer &entry)
+Debugger::Formatting::ValueFormats::Get(ValueObject& vobj, ValueFormat::SharedPointer &entry)
{
return GetFormatManager().Value().Get(vobj,entry);
}
void
-Debugger::ValueFormats::Add(const ConstString &type, const ValueFormat::SharedPointer &entry)
+Debugger::Formatting::ValueFormats::Add(const ConstString &type, const ValueFormat::SharedPointer &entry)
{
GetFormatManager().Value().Add(type.AsCString(),entry);
}
bool
-Debugger::ValueFormats::Delete(const ConstString &type)
+Debugger::Formatting::ValueFormats::Delete(const ConstString &type)
{
return GetFormatManager().Value().Delete(type.AsCString());
}
void
-Debugger::ValueFormats::Clear()
+Debugger::Formatting::ValueFormats::Clear()
{
GetFormatManager().Value().Clear();
}
void
-Debugger::ValueFormats::LoopThrough(ValueFormat::ValueCallback callback, void* callback_baton)
+Debugger::Formatting::ValueFormats::LoopThrough(ValueFormat::ValueCallback callback, void* callback_baton)
{
GetFormatManager().Value().LoopThrough(callback, callback_baton);
}
uint32_t
-Debugger::ValueFormats::GetCurrentRevision()
+Debugger::Formatting::ValueFormats::GetCurrentRevision()
{
return GetFormatManager().GetCurrentRevision();
}
uint32_t
-Debugger::ValueFormats::GetCount()
+Debugger::Formatting::ValueFormats::GetCount()
{
return GetFormatManager().Value().GetCount();
}
-bool
-Debugger::SummaryFormats::Get(ValueObject& vobj, SummaryFormat::SharedPointer &entry)
-{
- return GetFormatManager().Summary().Get(vobj,entry);
-}
-
-void
-Debugger::SummaryFormats::Add(const ConstString &type, const SummaryFormat::SharedPointer &entry)
-{
- GetFormatManager().Summary().Add(type.AsCString(),entry);
-}
-
-bool
-Debugger::SummaryFormats::Delete(const ConstString &type)
-{
- return GetFormatManager().Summary().Delete(type.AsCString());
-}
-
-void
-Debugger::SummaryFormats::Clear()
-{
- GetFormatManager().Summary().Clear();
-}
-
-void
-Debugger::SummaryFormats::LoopThrough(SummaryFormat::SummaryCallback callback, void* callback_baton)
-{
- GetFormatManager().Summary().LoopThrough(callback, callback_baton);
-}
-
-uint32_t
-Debugger::SummaryFormats::GetCurrentRevision()
-{
- return GetFormatManager().GetCurrentRevision();
-}
-
-uint32_t
-Debugger::SummaryFormats::GetCount()
+lldb::FormatCategorySP
+Debugger::Formatting::SummaryFormats(const char* category_name)
{
- return GetFormatManager().Summary().GetCount();
+ return GetFormatManager().Category(category_name);
}
bool
-Debugger::SystemSummaryFormats::Get(ValueObject& vobj, SummaryFormat::SharedPointer &entry)
-{
- return GetFormatManager().SystemSummary().Get(vobj,entry);
-}
-
-void
-Debugger::SystemSummaryFormats::Add(const ConstString &type, const SummaryFormat::SharedPointer &entry)
-{
- GetFormatManager().SystemSummary().Add(type.AsCString(),entry);
-}
-
-bool
-Debugger::SystemSummaryFormats::Delete(const ConstString &type)
-{
- return GetFormatManager().SystemSummary().Delete(type.AsCString());
-}
-
-void
-Debugger::SystemSummaryFormats::Clear()
+Debugger::Formatting::GetSummaryFormat(ValueObject& vobj,
+ lldb::SummaryFormatSP& entry)
{
- GetFormatManager().SystemSummary().Clear();
-}
-
-void
-Debugger::SystemSummaryFormats::LoopThrough(SummaryFormat::SummaryCallback callback, void* callback_baton)
-{
- GetFormatManager().SystemSummary().LoopThrough(callback, callback_baton);
-}
-
-uint32_t
-Debugger::SystemSummaryFormats::GetCurrentRevision()
-{
- return GetFormatManager().GetCurrentRevision();
-}
-
-uint32_t
-Debugger::SystemSummaryFormats::GetCount()
-{
- return GetFormatManager().SystemSummary().GetCount();
+ return GetFormatManager().Get(vobj, entry);
}
bool
-Debugger::RegexSummaryFormats::Get(ValueObject& vobj, SummaryFormat::SharedPointer &entry)
+Debugger::Formatting::Categories::Get(const ConstString &category, lldb::FormatCategorySP &entry)
{
- return GetFormatManager().RegexSummary().Get(vobj,entry);
+ entry = GetFormatManager().Category(category.GetCString());
+ return true;
}
void
-Debugger::RegexSummaryFormats::Add(const lldb::RegularExpressionSP &type, const SummaryFormat::SharedPointer &entry)
+Debugger::Formatting::Categories::Add(const ConstString &category)
{
- GetFormatManager().RegexSummary().Add(type,entry);
+ GetFormatManager().Category(category.GetCString());
}
bool
-Debugger::RegexSummaryFormats::Delete(const ConstString &type)
+Debugger::Formatting::Categories::Delete(const ConstString &category)
{
- return GetFormatManager().RegexSummary().Delete(type.AsCString());
+ GetFormatManager().DisableCategory(category.GetCString());
+ return GetFormatManager().Categories().Delete(category.GetCString());
}
void
-Debugger::RegexSummaryFormats::Clear()
+Debugger::Formatting::Categories::Clear()
{
- GetFormatManager().RegexSummary().Clear();
+ GetFormatManager().Categories().Clear();
}
void
-Debugger::RegexSummaryFormats::LoopThrough(SummaryFormat::RegexSummaryCallback callback, void* callback_baton)
-{
- GetFormatManager().RegexSummary().LoopThrough(callback, callback_baton);
-}
-
-uint32_t
-Debugger::RegexSummaryFormats::GetCurrentRevision()
-{
- return GetFormatManager().GetCurrentRevision();
-}
-
-uint32_t
-Debugger::RegexSummaryFormats::GetCount()
-{
- return GetFormatManager().RegexSummary().GetCount();
-}
-
-bool
-Debugger::SystemRegexSummaryFormats::Get(ValueObject& vobj, SummaryFormat::SharedPointer &entry)
+Debugger::Formatting::Categories::Clear(ConstString &category)
{
- return GetFormatManager().SystemRegexSummary().Get(vobj,entry);
+ GetFormatManager().Category(category.GetCString())->Clear();
}
void
-Debugger::SystemRegexSummaryFormats::Add(const lldb::RegularExpressionSP &type, const SummaryFormat::SharedPointer &entry)
+Debugger::Formatting::Categories::Enable(ConstString& category)
{
- GetFormatManager().SystemRegexSummary().Add(type,entry);
-}
-
-bool
-Debugger::SystemRegexSummaryFormats::Delete(const ConstString &type)
-{
- return GetFormatManager().SystemRegexSummary().Delete(type.AsCString());
+ if (GetFormatManager().Category(category.GetCString())->IsEnabled() == false)
+ {
+ //GetFormatManager().Category(category.GetCString())->Enable();
+ GetFormatManager().EnableCategory(category.GetCString());
+ }
+ else
+ {
+ //GetFormatManager().Category(category.GetCString())->Disable();
+ GetFormatManager().DisableCategory(category.GetCString());
+ //GetFormatManager().Category(category.GetCString())->Enable();
+ GetFormatManager().EnableCategory(category.GetCString());
+ }
}
void
-Debugger::SystemRegexSummaryFormats::Clear()
+Debugger::Formatting::Categories::Disable(ConstString& category)
{
- GetFormatManager().SystemRegexSummary().Clear();
+ if (GetFormatManager().Category(category.GetCString())->IsEnabled() == true)
+ {
+ //GetFormatManager().Category(category.GetCString())->Disable();
+ GetFormatManager().DisableCategory(category.GetCString());
+ }
}
void
-Debugger::SystemRegexSummaryFormats::LoopThrough(SummaryFormat::RegexSummaryCallback callback, void* callback_baton)
+Debugger::Formatting::Categories::LoopThrough(FormatManager::CategoryCallback callback, void* callback_baton)
{
- GetFormatManager().SystemRegexSummary().LoopThrough(callback, callback_baton);
+ GetFormatManager().LoopThroughCategories(callback, callback_baton);
}
uint32_t
-Debugger::SystemRegexSummaryFormats::GetCurrentRevision()
+Debugger::Formatting::Categories::GetCurrentRevision()
{
return GetFormatManager().GetCurrentRevision();
}
uint32_t
-Debugger::SystemRegexSummaryFormats::GetCount()
+Debugger::Formatting::Categories::GetCount()
{
- return GetFormatManager().SystemRegexSummary().GetCount();
+ return GetFormatManager().Categories().GetCount();
}
bool
-Debugger::NamedSummaryFormats::Get(const ConstString &type, SummaryFormat::SharedPointer &entry)
+Debugger::Formatting::NamedSummaryFormats::Get(const ConstString &type, SummaryFormat::SharedPointer &entry)
{
return GetFormatManager().NamedSummary().Get(type.AsCString(),entry);
}
void
-Debugger::NamedSummaryFormats::Add(const ConstString &type, const SummaryFormat::SharedPointer &entry)
+Debugger::Formatting::NamedSummaryFormats::Add(const ConstString &type, const SummaryFormat::SharedPointer &entry)
{
GetFormatManager().NamedSummary().Add(type.AsCString(),entry);
}
bool
-Debugger::NamedSummaryFormats::Delete(const ConstString &type)
+Debugger::Formatting::NamedSummaryFormats::Delete(const ConstString &type)
{
return GetFormatManager().NamedSummary().Delete(type.AsCString());
}
void
-Debugger::NamedSummaryFormats::Clear()
+Debugger::Formatting::NamedSummaryFormats::Clear()
{
GetFormatManager().NamedSummary().Clear();
}
void
-Debugger::NamedSummaryFormats::LoopThrough(SummaryFormat::SummaryCallback callback, void* callback_baton)
+Debugger::Formatting::NamedSummaryFormats::LoopThrough(SummaryFormat::SummaryCallback callback, void* callback_baton)
{
GetFormatManager().NamedSummary().LoopThrough(callback, callback_baton);
}
uint32_t
-Debugger::NamedSummaryFormats::GetCurrentRevision()
+Debugger::Formatting::NamedSummaryFormats::GetCurrentRevision()
{
return GetFormatManager().GetCurrentRevision();
}
uint32_t
-Debugger::NamedSummaryFormats::GetCount()
+Debugger::Formatting::NamedSummaryFormats::GetCount()
{
return GetFormatManager().NamedSummary().GetCount();
}
OpenPOWER on IntegriCloud