m_forced_summary_format = format;
m_user_id_of_forced_summary = m_update_point.GetModID();
m_summary_str.clear();
- m_trying_summary_already = false;
+ m_is_getting_summary = false;
}
lldb::SummaryFormatSP
{
m_last_summary_format = format;
m_summary_str.clear();
- m_trying_summary_already = false;
+ m_is_getting_summary = false;
}
void
m_is_bitfield_for_scalar:1,
m_is_expression_path_child:1,
m_is_child_at_offset:1,
- m_trying_summary_already:1; // used to prevent endless recursion in printing summaries
+ m_is_getting_summary:1;
friend class ClangExpressionDeclMap; // For GetValue
friend class ClangExpressionVariable; // For SetName
m_is_bitfield_for_scalar(false),
m_is_expression_path_child(false),
m_is_child_at_offset(false),
- m_trying_summary_already(false)
+ m_is_getting_summary(false)
{
m_manager->ManageObject(this);
}
m_is_bitfield_for_scalar(false),
m_is_expression_path_child(false),
m_is_child_at_offset(false),
- m_trying_summary_already(false)
+ m_is_getting_summary(false)
{
m_manager = new ValueObjectManager();
m_manager->ManageObject (this);
const char *
ValueObject::GetSummaryAsCString ()
{
+ // Watch for recursion which can happen with summary strings and other
+ // variable formatting options.
+ if (m_is_getting_summary)
+ return NULL;
+
+ m_is_getting_summary = true;
+
if (UpdateValueIfNeeded (true))
{
if (m_summary_str.empty())
}
}
}
+ m_is_getting_summary = false;
if (m_summary_str.empty())
return NULL;
return m_summary_str.c_str();
case eDisplayValue:
return_value = GetValueAsCString();
break;
+
case eDisplaySummary:
- if (m_trying_summary_already)
- return_value = NULL;
- else
- {
- m_trying_summary_already = true;
- return_value = GetSummaryAsCString();
- m_trying_summary_already = false;
- break;
- }
+ return_value = GetSummaryAsCString();
+ break;
+
case eDisplayLanguageSpecific:
return_value = GetObjectDescription();
break;
+
case eDisplayLocation:
return_value = GetLocationAsCString();
break;
+
case eDisplayChildrenCount:
- {
- alloc_mem.resize(512);
- return_value = &alloc_mem[0];
- int count = GetNumChildren();
- snprintf((char*)return_value, 512, "%d", count);
+ {
+ alloc_mem.resize(512);
+ return_value = &alloc_mem[0];
+ int count = GetNumChildren();
+ snprintf((char*)return_value, 512, "%d", count);
+ }
break;
- }
+
case eDisplayType:
return_value = GetTypeName().AsCString();
break;
+
default:
break;
}
m_value_str.clear();
m_summary_str.clear();
m_object_desc_str.clear();
- m_trying_summary_already = false;
+ m_is_getting_summary = false;
}
SymbolContextScope *