summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/FormatClasses.cpp
diff options
context:
space:
mode:
authorEnrico Granata <granata.enrico@gmail.com>2011-07-22 00:16:08 +0000
committerEnrico Granata <granata.enrico@gmail.com>2011-07-22 00:16:08 +0000
commitd55546b27a90ecc088316a706446c2a293ad94b0 (patch)
treeecf0e9d8c2f243dae418cc779c708a62958b56b3 /lldb/source/Core/FormatClasses.cpp
parent1872173841e85dd061b99b85ad2f1fb24cb23609 (diff)
downloadbcm5719-llvm-d55546b27a90ecc088316a706446c2a293ad94b0.tar.gz
bcm5719-llvm-d55546b27a90ecc088316a706446c2a293ad94b0.zip
when typing a summary string you can use the %S symbol to explicitly indicate that you want the summary to be used to print the target object
(e.g. ${var%S}). this might already be the default if your variable is of an aggregate type new feature: synthetic filters. you can restrict the number of children for your variables to only a meaningful subset - the restricted list of children obeys the typical rules (e.g. summaries prevail over children) - one-line summaries show only the filtered (synthetic) children, if you type an expanded summary string, or you use Python scripts, all the real children are accessible - to provide a synthetic children list use the "type synth add" command, as in: type synth add foo_type --child varA --child varB[0] --child varC->packet->flags[1-4] (you can use ., ->, single-item array operator [N] and bitfield operator [N-M]; array slice access is not supported, giving simplified names to expression paths is not supported) - a new -S option to frame variable and target variable lets you override synthetic children and instead show real ones llvm-svn: 135731
Diffstat (limited to 'lldb/source/Core/FormatClasses.cpp')
-rw-r--r--lldb/source/Core/FormatClasses.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/lldb/source/Core/FormatClasses.cpp b/lldb/source/Core/FormatClasses.cpp
index 8ff237a603a..f301a7bbc3a 100644
--- a/lldb/source/Core/FormatClasses.cpp
+++ b/lldb/source/Core/FormatClasses.cpp
@@ -66,14 +66,15 @@ StringSummaryFormat::FormatObject(lldb::ValueObjectSP object)
if (m_show_members_oneliner)
{
- const uint32_t num_children = object->GetNumChildren();
+ ValueObjectSP synth_vobj = object->GetSyntheticValue(lldb::eUseSyntheticFilter);
+ const uint32_t num_children = synth_vobj->GetNumChildren();
if (num_children)
{
s.PutChar('(');
for (uint32_t idx=0; idx<num_children; ++idx)
{
- lldb::ValueObjectSP child_sp(object->GetChildAtIndex(idx, true));
+ lldb::ValueObjectSP child_sp(synth_vobj->GetChildAtIndex(idx, true));
if (child_sp.get())
{
if (idx)
@@ -137,4 +138,21 @@ ScriptSummaryFormat::GetDescription()
}
-
+std::string
+SyntheticFilter::GetDescription()
+{
+ StreamString sstr;
+ sstr.Printf("%s%s%s {\n",
+ m_cascades ? "" : " (not cascading)",
+ m_skip_pointers ? " (skip pointers)" : "",
+ m_skip_references ? " (skip references)" : "");
+
+ for (int i = 0; i < GetCount(); i++)
+ {
+ sstr.Printf(" %s\n",
+ GetExpressionPathAtIndex(i).c_str());
+ }
+
+ sstr.Printf("}");
+ return sstr.GetString();
+}
OpenPOWER on IntegriCloud