summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/AddressResolverFileLine.cpp14
-rw-r--r--lldb/source/Core/Communication.cpp5
-rw-r--r--lldb/source/Core/FormatEntity.cpp120
-rw-r--r--lldb/source/Core/Mangled.cpp8
-rw-r--r--lldb/source/Core/Module.cpp39
-rw-r--r--lldb/source/Core/ModuleList.cpp15
-rw-r--r--lldb/source/Core/ValueObject.cpp12
-rw-r--r--lldb/source/Core/ValueObjectDynamicValue.cpp4
-rw-r--r--lldb/source/Core/ValueObjectSyntheticFilter.cpp114
9 files changed, 161 insertions, 170 deletions
diff --git a/lldb/source/Core/AddressResolverFileLine.cpp b/lldb/source/Core/AddressResolverFileLine.cpp
index 24c0222d6ec..33a7bb186eb 100644
--- a/lldb/source/Core/AddressResolverFileLine.cpp
+++ b/lldb/source/Core/AddressResolverFileLine.cpp
@@ -60,15 +60,15 @@ AddressResolverFileLine::SearchCallback(SearchFilter &filter,
if (log) {
StreamString s;
// new_bp_loc->GetDescription (&s, lldb::eDescriptionLevelVerbose);
- // log->Printf ("Added address: %s\n", s.GetData());
+ // LLDB_LOGF(log, "Added address: %s\n", s.GetData());
}
} else {
- if (log)
- log->Printf(
- "error: Unable to resolve address at file address 0x%" PRIx64
- " for %s:%d\n",
- line_start.GetFileAddress(),
- m_file_spec.GetFilename().AsCString("<Unknown>"), m_line_number);
+ LLDB_LOGF(log,
+ "error: Unable to resolve address at file address 0x%" PRIx64
+ " for %s:%d\n",
+ line_start.GetFileAddress(),
+ m_file_spec.GetFilename().AsCString("<Unknown>"),
+ m_line_number);
}
}
}
diff --git a/lldb/source/Core/Communication.cpp b/lldb/source/Core/Communication.cpp
index effa9ed1ead..0afd897a209 100644
--- a/lldb/source/Core/Communication.cpp
+++ b/lldb/source/Core/Communication.cpp
@@ -308,8 +308,7 @@ lldb::thread_result_t Communication::ReadThread(lldb::thread_arg_t p) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_COMMUNICATION));
- if (log)
- log->Printf("%p Communication::ReadThread () thread starting...", p);
+ LLDB_LOGF(log, "%p Communication::ReadThread () thread starting...", p);
uint8_t buf[1024];
@@ -364,7 +363,7 @@ lldb::thread_result_t Communication::ReadThread(lldb::thread_arg_t p) {
}
log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_COMMUNICATION);
if (log)
- log->Printf("%p Communication::ReadThread () thread exiting...", p);
+ LLDB_LOGF(log, "%p Communication::ReadThread () thread exiting...", p);
comm->m_read_thread_did_exit = true;
// Let clients know that this thread is exiting
diff --git a/lldb/source/Core/FormatEntity.cpp b/lldb/source/Core/FormatEntity.cpp
index 1ffbed2cd64..52a85aa78c6 100644
--- a/lldb/source/Core/FormatEntity.cpp
+++ b/lldb/source/Core/FormatEntity.cpp
@@ -514,24 +514,24 @@ static bool ScanBracketedRange(llvm::StringRef subpath,
close_bracket_index = llvm::StringRef::npos;
const size_t open_bracket_index = subpath.find('[');
if (open_bracket_index == llvm::StringRef::npos) {
- if (log)
- log->Printf("[ScanBracketedRange] no bracketed range, skipping entirely");
+ LLDB_LOGF(log,
+ "[ScanBracketedRange] no bracketed range, skipping entirely");
return false;
}
close_bracket_index = subpath.find(']', open_bracket_index + 1);
if (close_bracket_index == llvm::StringRef::npos) {
- if (log)
- log->Printf("[ScanBracketedRange] no bracketed range, skipping entirely");
+ LLDB_LOGF(log,
+ "[ScanBracketedRange] no bracketed range, skipping entirely");
return false;
} else {
var_name_final_if_array_range = subpath.data() + open_bracket_index;
if (close_bracket_index - open_bracket_index == 1) {
- if (log)
- log->Printf(
- "[ScanBracketedRange] '[]' detected.. going from 0 to end of data");
+ LLDB_LOGF(
+ log,
+ "[ScanBracketedRange] '[]' detected.. going from 0 to end of data");
index_lower = 0;
} else {
const size_t separator_index = subpath.find('-', open_bracket_index + 1);
@@ -540,22 +540,21 @@ static bool ScanBracketedRange(llvm::StringRef subpath,
const char *index_lower_cstr = subpath.data() + open_bracket_index + 1;
index_lower = ::strtoul(index_lower_cstr, nullptr, 0);
index_higher = index_lower;
- if (log)
- log->Printf("[ScanBracketedRange] [%" PRId64
- "] detected, high index is same",
- index_lower);
+ LLDB_LOGF(log,
+ "[ScanBracketedRange] [%" PRId64
+ "] detected, high index is same",
+ index_lower);
} else {
const char *index_lower_cstr = subpath.data() + open_bracket_index + 1;
const char *index_higher_cstr = subpath.data() + separator_index + 1;
index_lower = ::strtoul(index_lower_cstr, nullptr, 0);
index_higher = ::strtoul(index_higher_cstr, nullptr, 0);
- if (log)
- log->Printf("[ScanBracketedRange] [%" PRId64 "-%" PRId64 "] detected",
- index_lower, index_higher);
+ LLDB_LOGF(log,
+ "[ScanBracketedRange] [%" PRId64 "-%" PRId64 "] detected",
+ index_lower, index_higher);
}
if (index_lower > index_higher && index_higher > 0) {
- if (log)
- log->Printf("[ScanBracketedRange] swapping indices");
+ LLDB_LOGF(log, "[ScanBracketedRange] swapping indices");
const int64_t temp = index_lower;
index_lower = index_higher;
index_higher = temp;
@@ -627,9 +626,8 @@ static ValueObjectSP ExpandIndexedExpression(ValueObject *valobj, size_t index,
const char *ptr_deref_format = "[%d]";
std::string ptr_deref_buffer(10, 0);
::sprintf(&ptr_deref_buffer[0], ptr_deref_format, index);
- if (log)
- log->Printf("[ExpandIndexedExpression] name to deref: %s",
- ptr_deref_buffer.c_str());
+ LLDB_LOGF(log, "[ExpandIndexedExpression] name to deref: %s",
+ ptr_deref_buffer.c_str());
ValueObject::GetValueForExpressionPathOptions options;
ValueObject::ExpressionPathEndResultType final_value_type;
ValueObject::ExpressionPathScanEndReason reason_to_stop;
@@ -640,15 +638,15 @@ static ValueObjectSP ExpandIndexedExpression(ValueObject *valobj, size_t index,
ptr_deref_buffer.c_str(), &reason_to_stop, &final_value_type, options,
&what_next);
if (!item) {
- if (log)
- log->Printf("[ExpandIndexedExpression] ERROR: why stopping = %d,"
- " final_value_type %d",
- reason_to_stop, final_value_type);
+ LLDB_LOGF(log,
+ "[ExpandIndexedExpression] ERROR: why stopping = %d,"
+ " final_value_type %d",
+ reason_to_stop, final_value_type);
} else {
- if (log)
- log->Printf("[ExpandIndexedExpression] ALL RIGHT: why stopping = %d,"
- " final_value_type %d",
- reason_to_stop, final_value_type);
+ LLDB_LOGF(log,
+ "[ExpandIndexedExpression] ALL RIGHT: why stopping = %d,"
+ " final_value_type %d",
+ reason_to_stop, final_value_type);
}
return item;
}
@@ -770,9 +768,8 @@ static bool DumpValue(Stream &s, const SymbolContext *sc,
const std::string &expr_path = entry.string;
- if (log)
- log->Printf("[Debugger::FormatPrompt] symbol to expand: %s",
- expr_path.c_str());
+ LLDB_LOGF(log, "[Debugger::FormatPrompt] symbol to expand: %s",
+ expr_path.c_str());
target =
valobj
@@ -781,16 +778,16 @@ static bool DumpValue(Stream &s, const SymbolContext *sc,
.get();
if (!target) {
- if (log)
- log->Printf("[Debugger::FormatPrompt] ERROR: why stopping = %d,"
- " final_value_type %d",
- reason_to_stop, final_value_type);
+ LLDB_LOGF(log,
+ "[Debugger::FormatPrompt] ERROR: why stopping = %d,"
+ " final_value_type %d",
+ reason_to_stop, final_value_type);
return false;
} else {
- if (log)
- log->Printf("[Debugger::FormatPrompt] ALL RIGHT: why stopping = %d,"
- " final_value_type %d",
- reason_to_stop, final_value_type);
+ LLDB_LOGF(log,
+ "[Debugger::FormatPrompt] ALL RIGHT: why stopping = %d,"
+ " final_value_type %d",
+ reason_to_stop, final_value_type);
target = target
->GetQualifiedRepresentationIfAvailable(
target->GetDynamicValueType(), true)
@@ -814,18 +811,16 @@ static bool DumpValue(Stream &s, const SymbolContext *sc,
Status error;
target = target->Dereference(error).get();
if (error.Fail()) {
- if (log)
- log->Printf("[Debugger::FormatPrompt] ERROR: %s\n",
- error.AsCString("unknown"));
+ LLDB_LOGF(log, "[Debugger::FormatPrompt] ERROR: %s\n",
+ error.AsCString("unknown"));
return false;
}
do_deref_pointer = false;
}
if (!target) {
- if (log)
- log->Printf("[Debugger::FormatPrompt] could not calculate target for "
- "prompt expression");
+ LLDB_LOGF(log, "[Debugger::FormatPrompt] could not calculate target for "
+ "prompt expression");
return false;
}
@@ -860,18 +855,16 @@ static bool DumpValue(Stream &s, const SymbolContext *sc,
// exceptions
{
StreamString str_temp;
- if (log)
- log->Printf(
- "[Debugger::FormatPrompt] I am into array || pointer && !range");
+ LLDB_LOGF(log,
+ "[Debugger::FormatPrompt] I am into array || pointer && !range");
if (target->HasSpecialPrintableRepresentation(val_obj_display,
custom_format)) {
// try to use the special cases
bool success = target->DumpPrintableRepresentation(
str_temp, val_obj_display, custom_format);
- if (log)
- log->Printf("[Debugger::FormatPrompt] special cases did%s match",
- success ? "" : "n't");
+ LLDB_LOGF(log, "[Debugger::FormatPrompt] special cases did%s match",
+ success ? "" : "n't");
// should not happen
if (success)
@@ -909,17 +902,16 @@ static bool DumpValue(Stream &s, const SymbolContext *sc,
}
if (!is_array_range) {
- if (log)
- log->Printf("[Debugger::FormatPrompt] dumping ordinary printable output");
+ LLDB_LOGF(log,
+ "[Debugger::FormatPrompt] dumping ordinary printable output");
return target->DumpPrintableRepresentation(s, val_obj_display,
custom_format);
} else {
- if (log)
- log->Printf("[Debugger::FormatPrompt] checking if I can handle as array");
+ LLDB_LOGF(log,
+ "[Debugger::FormatPrompt] checking if I can handle as array");
if (!is_array && !is_pointer)
return false;
- if (log)
- log->Printf("[Debugger::FormatPrompt] handle as array");
+ LLDB_LOGF(log, "[Debugger::FormatPrompt] handle as array");
StreamString special_directions_stream;
llvm::StringRef special_directions;
if (close_bracket_index != llvm::StringRef::npos &&
@@ -965,15 +957,15 @@ static bool DumpValue(Stream &s, const SymbolContext *sc,
.get();
if (!item) {
- if (log)
- log->Printf("[Debugger::FormatPrompt] ERROR in getting child item at "
- "index %" PRId64,
- index);
+ LLDB_LOGF(log,
+ "[Debugger::FormatPrompt] ERROR in getting child item at "
+ "index %" PRId64,
+ index);
} else {
- if (log)
- log->Printf(
- "[Debugger::FormatPrompt] special_directions for child item: %s",
- special_directions.data() ? special_directions.data() : "");
+ LLDB_LOGF(
+ log,
+ "[Debugger::FormatPrompt] special_directions for child item: %s",
+ special_directions.data() ? special_directions.data() : "");
}
if (special_directions.empty()) {
diff --git a/lldb/source/Core/Mangled.cpp b/lldb/source/Core/Mangled.cpp
index c6759cc944c..944c7b0bcfe 100644
--- a/lldb/source/Core/Mangled.cpp
+++ b/lldb/source/Core/Mangled.cpp
@@ -226,9 +226,9 @@ static char *GetMSVCDemangledStr(const char *M) {
if (Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DEMANGLE)) {
if (demangled_cstr && demangled_cstr[0])
- log->Printf("demangled msvc: %s -> \"%s\"", M, demangled_cstr);
+ LLDB_LOGF(log, "demangled msvc: %s -> \"%s\"", M, demangled_cstr);
else
- log->Printf("demangled msvc: %s -> error: 0x%lu", M, result);
+ LLDB_LOGF(log, "demangled msvc: %s -> error: 0x%lu", M, result);
}
if (result != 0) {
@@ -261,9 +261,9 @@ static char *GetItaniumDemangledStr(const char *M) {
if (Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DEMANGLE)) {
if (demangled_cstr)
- log->Printf("demangled itanium: %s -> \"%s\"", M, demangled_cstr);
+ LLDB_LOGF(log, "demangled itanium: %s -> \"%s\"", M, demangled_cstr);
else
- log->Printf("demangled itanium: %s -> error: failed to demangle", M);
+ LLDB_LOGF(log, "demangled itanium: %s -> error: failed to demangle", M);
}
return demangled_cstr;
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 153d5a74093..d17596ecbcd 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -137,14 +137,15 @@ Module::Module(const ModuleSpec &module_spec)
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_OBJECT |
LIBLLDB_LOG_MODULES));
if (log != nullptr)
- log->Printf("%p Module::Module((%s) '%s%s%s%s')", static_cast<void *>(this),
- module_spec.GetArchitecture().GetArchitectureName(),
- module_spec.GetFileSpec().GetPath().c_str(),
- module_spec.GetObjectName().IsEmpty() ? "" : "(",
- module_spec.GetObjectName().IsEmpty()
- ? ""
- : module_spec.GetObjectName().AsCString(""),
- module_spec.GetObjectName().IsEmpty() ? "" : ")");
+ LLDB_LOGF(log, "%p Module::Module((%s) '%s%s%s%s')",
+ static_cast<void *>(this),
+ module_spec.GetArchitecture().GetArchitectureName(),
+ module_spec.GetFileSpec().GetPath().c_str(),
+ module_spec.GetObjectName().IsEmpty() ? "" : "(",
+ module_spec.GetObjectName().IsEmpty()
+ ? ""
+ : module_spec.GetObjectName().AsCString(""),
+ module_spec.GetObjectName().IsEmpty() ? "" : ")");
// First extract all module specifications from the file using the local file
// path. If there are no specifications, then don't fill anything in
@@ -164,7 +165,7 @@ Module::Module(const ModuleSpec &module_spec)
if (!modules_specs.FindMatchingModuleSpec(module_spec,
matching_module_spec)) {
if (log) {
- log->Printf("Found local object file but the specs didn't match");
+ LLDB_LOGF(log, "Found local object file but the specs didn't match");
}
return;
}
@@ -235,11 +236,11 @@ Module::Module(const FileSpec &file_spec, const ArchSpec &arch,
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_OBJECT |
LIBLLDB_LOG_MODULES));
if (log != nullptr)
- log->Printf("%p Module::Module((%s) '%s%s%s%s')", static_cast<void *>(this),
- m_arch.GetArchitectureName(), m_file.GetPath().c_str(),
- m_object_name.IsEmpty() ? "" : "(",
- m_object_name.IsEmpty() ? "" : m_object_name.AsCString(""),
- m_object_name.IsEmpty() ? "" : ")");
+ LLDB_LOGF(log, "%p Module::Module((%s) '%s%s%s%s')",
+ static_cast<void *>(this), m_arch.GetArchitectureName(),
+ m_file.GetPath().c_str(), m_object_name.IsEmpty() ? "" : "(",
+ m_object_name.IsEmpty() ? "" : m_object_name.AsCString(""),
+ m_object_name.IsEmpty() ? "" : ")");
}
Module::Module()
@@ -267,11 +268,11 @@ Module::~Module() {
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_OBJECT |
LIBLLDB_LOG_MODULES));
if (log != nullptr)
- log->Printf("%p Module::~Module((%s) '%s%s%s%s')",
- static_cast<void *>(this), m_arch.GetArchitectureName(),
- m_file.GetPath().c_str(), m_object_name.IsEmpty() ? "" : "(",
- m_object_name.IsEmpty() ? "" : m_object_name.AsCString(""),
- m_object_name.IsEmpty() ? "" : ")");
+ LLDB_LOGF(log, "%p Module::~Module((%s) '%s%s%s%s')",
+ static_cast<void *>(this), m_arch.GetArchitectureName(),
+ m_file.GetPath().c_str(), m_object_name.IsEmpty() ? "" : "(",
+ m_object_name.IsEmpty() ? "" : m_object_name.AsCString(""),
+ m_object_name.IsEmpty() ? "" : ")");
// Release any auto pointers before we start tearing down our member
// variables since the object file and symbol files might need to make
// function calls back into this module object. The ordering is important
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp
index 9d795f9e558..b9b155cfd5f 100644
--- a/lldb/source/Core/ModuleList.cpp
+++ b/lldb/source/Core/ModuleList.cpp
@@ -641,11 +641,11 @@ void ModuleList::LogUUIDAndPaths(Log *log, const char *prefix_cstr) {
for (pos = begin; pos != end; ++pos) {
Module *module = pos->get();
const FileSpec &module_file_spec = module->GetFileSpec();
- log->Printf("%s[%u] %s (%s) \"%s\"", prefix_cstr ? prefix_cstr : "",
- (uint32_t)std::distance(begin, pos),
- module->GetUUID().GetAsString().c_str(),
- module->GetArchitecture().GetArchitectureName(),
- module_file_spec.GetPath().c_str());
+ LLDB_LOGF(log, "%s[%u] %s (%s) \"%s\"", prefix_cstr ? prefix_cstr : "",
+ (uint32_t)std::distance(begin, pos),
+ module->GetUUID().GetAsString().c_str(),
+ module->GetArchitecture().GetArchitectureName(),
+ module_file_spec.GetPath().c_str());
}
}
}
@@ -808,8 +808,9 @@ Status ModuleList::GetSharedModule(const ModuleSpec &module_spec,
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_MODULES));
if (log != nullptr)
- log->Printf("module changed: %p, removing from global module list",
- static_cast<void *>(module_sp.get()));
+ LLDB_LOGF(log,
+ "module changed: %p, removing from global module list",
+ static_cast<void *>(module_sp.get()));
shared_module_list.Remove(module_sp);
module_sp.reset();
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 57bc8aebc8b..d72e52f85b9 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -226,12 +226,12 @@ bool ValueObject::UpdateValueIfNeeded(bool update_format) {
bool ValueObject::UpdateFormatsIfNeeded() {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS));
- if (log)
- log->Printf("[%s %p] checking for FormatManager revisions. ValueObject "
- "rev: %d - Global rev: %d",
- GetName().GetCString(), static_cast<void *>(this),
- m_last_format_mgr_revision,
- DataVisualization::GetCurrentRevision());
+ LLDB_LOGF(log,
+ "[%s %p] checking for FormatManager revisions. ValueObject "
+ "rev: %d - Global rev: %d",
+ GetName().GetCString(), static_cast<void *>(this),
+ m_last_format_mgr_revision,
+ DataVisualization::GetCurrentRevision());
bool any_change = false;
diff --git a/lldb/source/Core/ValueObjectDynamicValue.cpp b/lldb/source/Core/ValueObjectDynamicValue.cpp
index 90b46d1f170..97dc70be5b2 100644
--- a/lldb/source/Core/ValueObjectDynamicValue.cpp
+++ b/lldb/source/Core/ValueObjectDynamicValue.cpp
@@ -243,8 +243,8 @@ bool ValueObjectDynamicValue::UpdateValue() {
m_value.SetValueType(value_type);
if (has_changed_type && log)
- log->Printf("[%s %p] has a new dynamic type %s", GetName().GetCString(),
- static_cast<void *>(this), GetTypeName().GetCString());
+ LLDB_LOGF(log, "[%s %p] has a new dynamic type %s", GetName().GetCString(),
+ static_cast<void *>(this), GetTypeName().GetCString());
if (m_address.IsValid() && m_dynamic_type_info) {
// The variable value is in the Scalar value inside the m_value. We can
diff --git a/lldb/source/Core/ValueObjectSyntheticFilter.cpp b/lldb/source/Core/ValueObjectSyntheticFilter.cpp
index 40047323575..38c8bb67c27 100644
--- a/lldb/source/Core/ValueObjectSyntheticFilter.cpp
+++ b/lldb/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;
}
}
@@ -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();
}
OpenPOWER on IntegriCloud