aboutsummaryrefslogtreecommitdiffstats
path: root/source/Core/ValueObjectSyntheticFilter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Core/ValueObjectSyntheticFilter.cpp')
-rw-r--r--source/Core/ValueObjectSyntheticFilter.cpp118
1 files changed, 58 insertions, 60 deletions
diff --git a/source/Core/ValueObjectSyntheticFilter.cpp b/source/Core/ValueObjectSyntheticFilter.cpp
index 400473235759..a6bf35eac70a 100644
--- a/source/Core/ValueObjectSyntheticFilter.cpp
+++ b/source/Core/ValueObjectSyntheticFilter.cpp
@@ -87,20 +87,18 @@ size_t ValueObjectSynthetic::CalculateNumChildren(uint32_t max) {
if (max < UINT32_MAX) {
size_t num_children = m_synth_filter_up->CalculateNumChildren(max);
- if (log)
- log->Printf("[ValueObjectSynthetic::CalculateNumChildren] for VO of name "
- "%s and type %s, the filter returned %zu child values",
- GetName().AsCString(), GetTypeName().AsCString(),
- num_children);
+ LLDB_LOGF(log,
+ "[ValueObjectSynthetic::CalculateNumChildren] for VO of name "
+ "%s and type %s, the filter returned %zu child values",
+ GetName().AsCString(), GetTypeName().AsCString(), num_children);
return num_children;
} else {
size_t num_children = (m_synthetic_children_count =
m_synth_filter_up->CalculateNumChildren(max));
- if (log)
- log->Printf("[ValueObjectSynthetic::CalculateNumChildren] for VO of name "
- "%s and type %s, the filter returned %zu child values",
- GetName().AsCString(), GetTypeName().AsCString(),
- num_children);
+ LLDB_LOGF(log,
+ "[ValueObjectSynthetic::CalculateNumChildren] for VO of name "
+ "%s and type %s, the filter returned %zu child values",
+ GetName().AsCString(), GetTypeName().AsCString(), num_children);
return num_children;
}
}
@@ -142,7 +140,7 @@ void ValueObjectSynthetic::CreateSynthFilter() {
}
m_synth_filter_up = (m_synth_sp->GetFrontEnd(*valobj_for_frontend));
if (!m_synth_filter_up)
- m_synth_filter_up = llvm::make_unique<DummySyntheticFrontEnd>(*m_parent);
+ m_synth_filter_up = std::make_unique<DummySyntheticFrontEnd>(*m_parent);
}
bool ValueObjectSynthetic::UpdateValue() {
@@ -163,21 +161,21 @@ bool ValueObjectSynthetic::UpdateValue() {
// <rdar://problem/12424824>
ConstString new_parent_type_name = m_parent->GetTypeName();
if (new_parent_type_name != m_parent_type_name) {
- if (log)
- log->Printf("[ValueObjectSynthetic::UpdateValue] name=%s, type changed "
- "from %s to %s, recomputing synthetic filter",
- GetName().AsCString(), m_parent_type_name.AsCString(),
- new_parent_type_name.AsCString());
+ LLDB_LOGF(log,
+ "[ValueObjectSynthetic::UpdateValue] name=%s, type changed "
+ "from %s to %s, recomputing synthetic filter",
+ GetName().AsCString(), m_parent_type_name.AsCString(),
+ new_parent_type_name.AsCString());
m_parent_type_name = new_parent_type_name;
CreateSynthFilter();
}
// let our backend do its update
if (!m_synth_filter_up->Update()) {
- if (log)
- log->Printf("[ValueObjectSynthetic::UpdateValue] name=%s, synthetic "
- "filter said caches are stale - clearing",
- GetName().AsCString());
+ LLDB_LOGF(log,
+ "[ValueObjectSynthetic::UpdateValue] name=%s, synthetic "
+ "filter said caches are stale - clearing",
+ GetName().AsCString());
// filter said that cached values are stale
m_children_byindex.Clear();
m_name_toindex.Clear();
@@ -190,10 +188,10 @@ bool ValueObjectSynthetic::UpdateValue() {
m_synthetic_children_count = UINT32_MAX;
m_might_have_children = eLazyBoolCalculate;
} else {
- if (log)
- log->Printf("[ValueObjectSynthetic::UpdateValue] name=%s, synthetic "
- "filter said caches are still valid",
- GetName().AsCString());
+ LLDB_LOGF(log,
+ "[ValueObjectSynthetic::UpdateValue] name=%s, synthetic "
+ "filter said caches are still valid",
+ GetName().AsCString());
}
m_provides_value = eLazyBoolCalculate;
@@ -201,18 +199,18 @@ bool ValueObjectSynthetic::UpdateValue() {
lldb::ValueObjectSP synth_val(m_synth_filter_up->GetSyntheticValue());
if (synth_val && synth_val->CanProvideValue()) {
- if (log)
- log->Printf("[ValueObjectSynthetic::UpdateValue] name=%s, synthetic "
- "filter said it can provide a value",
- GetName().AsCString());
+ LLDB_LOGF(log,
+ "[ValueObjectSynthetic::UpdateValue] name=%s, synthetic "
+ "filter said it can provide a value",
+ GetName().AsCString());
m_provides_value = eLazyBoolYes;
CopyValueData(synth_val.get());
} else {
- if (log)
- log->Printf("[ValueObjectSynthetic::UpdateValue] name=%s, synthetic "
- "filter said it will not provide a value",
- GetName().AsCString());
+ LLDB_LOGF(log,
+ "[ValueObjectSynthetic::UpdateValue] name=%s, synthetic "
+ "filter said it will not provide a value",
+ GetName().AsCString());
m_provides_value = eLazyBoolNo;
CopyValueData(m_parent);
@@ -226,32 +224,32 @@ lldb::ValueObjectSP ValueObjectSynthetic::GetChildAtIndex(size_t idx,
bool can_create) {
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS);
- if (log)
- log->Printf("[ValueObjectSynthetic::GetChildAtIndex] name=%s, retrieving "
- "child at index %zu",
- GetName().AsCString(), idx);
+ LLDB_LOGF(log,
+ "[ValueObjectSynthetic::GetChildAtIndex] name=%s, retrieving "
+ "child at index %zu",
+ GetName().AsCString(), idx);
UpdateValueIfNeeded();
ValueObject *valobj;
if (!m_children_byindex.GetValueForKey(idx, valobj)) {
if (can_create && m_synth_filter_up != nullptr) {
- if (log)
- log->Printf("[ValueObjectSynthetic::GetChildAtIndex] name=%s, child at "
- "index %zu not cached and will be created",
- GetName().AsCString(), idx);
+ LLDB_LOGF(log,
+ "[ValueObjectSynthetic::GetChildAtIndex] name=%s, child at "
+ "index %zu not cached and will be created",
+ GetName().AsCString(), idx);
lldb::ValueObjectSP synth_guy = m_synth_filter_up->GetChildAtIndex(idx);
- if (log)
- log->Printf(
- "[ValueObjectSynthetic::GetChildAtIndex] name=%s, child at index "
- "%zu created as %p (is "
- "synthetic: %s)",
- GetName().AsCString(), idx, static_cast<void *>(synth_guy.get()),
- synth_guy.get()
- ? (synth_guy->IsSyntheticChildrenGenerated() ? "yes" : "no")
- : "no");
+ LLDB_LOGF(
+ log,
+ "[ValueObjectSynthetic::GetChildAtIndex] name=%s, child at index "
+ "%zu created as %p (is "
+ "synthetic: %s)",
+ GetName().AsCString(), idx, static_cast<void *>(synth_guy.get()),
+ synth_guy.get()
+ ? (synth_guy->IsSyntheticChildrenGenerated() ? "yes" : "no")
+ : "no");
if (!synth_guy)
return synth_guy;
@@ -263,20 +261,20 @@ lldb::ValueObjectSP ValueObjectSynthetic::GetChildAtIndex(size_t idx,
GetPreferredDisplayLanguage());
return synth_guy;
} else {
- if (log)
- log->Printf("[ValueObjectSynthetic::GetChildAtIndex] name=%s, child at "
- "index %zu not cached and cannot "
- "be created (can_create = %s, synth_filter = %p)",
- GetName().AsCString(), idx, can_create ? "yes" : "no",
- static_cast<void *>(m_synth_filter_up.get()));
+ LLDB_LOGF(log,
+ "[ValueObjectSynthetic::GetChildAtIndex] name=%s, child at "
+ "index %zu not cached and cannot "
+ "be created (can_create = %s, synth_filter = %p)",
+ GetName().AsCString(), idx, can_create ? "yes" : "no",
+ static_cast<void *>(m_synth_filter_up.get()));
return lldb::ValueObjectSP();
}
} else {
- if (log)
- log->Printf("[ValueObjectSynthetic::GetChildAtIndex] name=%s, child at "
- "index %zu cached as %p",
- GetName().AsCString(), idx, static_cast<void *>(valobj));
+ LLDB_LOGF(log,
+ "[ValueObjectSynthetic::GetChildAtIndex] name=%s, child at "
+ "index %zu cached as %p",
+ GetName().AsCString(), idx, static_cast<void *>(valobj));
return valobj->GetSP();
}
@@ -322,7 +320,7 @@ lldb::ValueObjectSP ValueObjectSynthetic::GetNonSyntheticValue() {
void ValueObjectSynthetic::CopyValueData(ValueObject *source) {
m_value = (source->UpdateValueIfNeeded(), source->GetValue());
ExecutionContext exe_ctx(GetExecutionContextRef());
- m_error = m_value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
+ m_error = m_value.GetValueAsData(&exe_ctx, m_data, GetModule().get());
}
bool ValueObjectSynthetic::CanProvideValue() {