summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/Materializer.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-07-24 17:56:10 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-07-24 17:56:10 +0000
commit63e5fb76ecfed3434252868d8cf07d676f979f2f (patch)
tree349d6bd303f53aa57b988dee284c7f264404a8fc /lldb/source/Expression/Materializer.cpp
parent2bf871be4c35d70db080dde789cf9bb334c04057 (diff)
downloadbcm5719-llvm-63e5fb76ecfed3434252868d8cf07d676f979f2f.tar.gz
bcm5719-llvm-63e5fb76ecfed3434252868d8cf07d676f979f2f.zip
[Logging] Replace Log::Printf with LLDB_LOG macro (NFC)
This patch replaces explicit calls to log::Printf with the new LLDB_LOGF macro. The macro is similar to LLDB_LOG but supports printf-style format strings, instead of formatv-style format strings. So instead of writing: if (log) log->Printf("%s\n", str); You'd write: LLDB_LOG(log, "%s\n", str); This change was done mechanically with the command below. I replaced the spurious if-checks with vim, since I know how to do multi-line replacements with it. find . -type f -name '*.cpp' -exec \ sed -i '' -E 's/log->Printf\(/LLDB_LOGF\(log, /g' "{}" + Differential revision: https://reviews.llvm.org/D65128 llvm-svn: 366936
Diffstat (limited to 'lldb/source/Expression/Materializer.cpp')
-rw-r--r--lldb/source/Expression/Materializer.cpp89
1 files changed, 48 insertions, 41 deletions
diff --git a/lldb/source/Expression/Materializer.cpp b/lldb/source/Expression/Materializer.cpp
index d4e887119c7..e86afb6018a 100644
--- a/lldb/source/Expression/Materializer.cpp
+++ b/lldb/source/Expression/Materializer.cpp
@@ -93,9 +93,8 @@ public:
return;
}
- if (log)
- log->Printf("Allocated %s (0x%" PRIx64 ") successfully",
- m_persistent_variable_sp->GetName().GetCString(), mem);
+ LLDB_LOGF(log, "Allocated %s (0x%" PRIx64 ") successfully",
+ m_persistent_variable_sp->GetName().GetCString(), mem);
// Put the location of the spare memory into the live data of the
// ValueObject.
@@ -157,11 +156,12 @@ public:
const lldb::addr_t load_addr = process_address + m_offset;
if (log) {
- log->Printf("EntityPersistentVariable::Materialize [address = 0x%" PRIx64
- ", m_name = %s, m_flags = 0x%hx]",
- (uint64_t)load_addr,
- m_persistent_variable_sp->GetName().AsCString(),
- m_persistent_variable_sp->m_flags);
+ LLDB_LOGF(log,
+ "EntityPersistentVariable::Materialize [address = 0x%" PRIx64
+ ", m_name = %s, m_flags = 0x%hx]",
+ (uint64_t)load_addr,
+ m_persistent_variable_sp->GetName().AsCString(),
+ m_persistent_variable_sp->m_flags);
}
if (m_persistent_variable_sp->m_flags &
@@ -208,12 +208,12 @@ public:
const lldb::addr_t load_addr = process_address + m_offset;
if (log) {
- log->Printf(
- "EntityPersistentVariable::Dematerialize [address = 0x%" PRIx64
- ", m_name = %s, m_flags = 0x%hx]",
- (uint64_t)process_address + m_offset,
- m_persistent_variable_sp->GetName().AsCString(),
- m_persistent_variable_sp->m_flags);
+ LLDB_LOGF(log,
+ "EntityPersistentVariable::Dematerialize [address = 0x%" PRIx64
+ ", m_name = %s, m_flags = 0x%hx]",
+ (uint64_t)process_address + m_offset,
+ m_persistent_variable_sp->GetName().AsCString(),
+ m_persistent_variable_sp->m_flags);
}
if (m_delegate) {
@@ -290,11 +290,10 @@ public:
ExpressionVariable::EVNeedsFreezeDry ||
m_persistent_variable_sp->m_flags &
ExpressionVariable::EVKeepInTarget) {
- if (log)
- log->Printf(
- "Dematerializing %s from 0x%" PRIx64 " (size = %llu)",
- m_persistent_variable_sp->GetName().GetCString(), (uint64_t)mem,
- (unsigned long long)m_persistent_variable_sp->GetByteSize());
+ LLDB_LOGF(log, "Dematerializing %s from 0x%" PRIx64 " (size = %llu)",
+ m_persistent_variable_sp->GetName().GetCString(),
+ (uint64_t)mem,
+ (unsigned long long)m_persistent_variable_sp->GetByteSize());
// Read the contents of the spare memory area
@@ -440,9 +439,10 @@ public:
const lldb::addr_t load_addr = process_address + m_offset;
if (log) {
- log->Printf("EntityVariable::Materialize [address = 0x%" PRIx64
- ", m_variable_sp = %s]",
- (uint64_t)load_addr, m_variable_sp->GetName().AsCString());
+ LLDB_LOGF(log,
+ "EntityVariable::Materialize [address = 0x%" PRIx64
+ ", m_variable_sp = %s]",
+ (uint64_t)load_addr, m_variable_sp->GetName().AsCString());
}
ExecutionContextScope *scope = frame_sp.get();
@@ -605,9 +605,10 @@ public:
const lldb::addr_t load_addr = process_address + m_offset;
if (log) {
- log->Printf("EntityVariable::Dematerialize [address = 0x%" PRIx64
- ", m_variable_sp = %s]",
- (uint64_t)load_addr, m_variable_sp->GetName().AsCString());
+ LLDB_LOGF(log,
+ "EntityVariable::Dematerialize [address = 0x%" PRIx64
+ ", m_variable_sp = %s]",
+ (uint64_t)load_addr, m_variable_sp->GetName().AsCString());
}
if (m_temporary_allocation != LLDB_INVALID_ADDRESS) {
@@ -1063,9 +1064,10 @@ public:
const lldb::addr_t load_addr = process_address + m_offset;
if (log) {
- log->Printf("EntitySymbol::Materialize [address = 0x%" PRIx64
- ", m_symbol = %s]",
- (uint64_t)load_addr, m_symbol.GetName().AsCString());
+ LLDB_LOGF(log,
+ "EntitySymbol::Materialize [address = 0x%" PRIx64
+ ", m_symbol = %s]",
+ (uint64_t)load_addr, m_symbol.GetName().AsCString());
}
const Address sym_address = m_symbol.GetAddress();
@@ -1109,9 +1111,10 @@ public:
const lldb::addr_t load_addr = process_address + m_offset;
if (log) {
- log->Printf("EntitySymbol::Dematerialize [address = 0x%" PRIx64
- ", m_symbol = %s]",
- (uint64_t)load_addr, m_symbol.GetName().AsCString());
+ LLDB_LOGF(log,
+ "EntitySymbol::Dematerialize [address = 0x%" PRIx64
+ ", m_symbol = %s]",
+ (uint64_t)load_addr, m_symbol.GetName().AsCString());
}
// no work needs to be done
@@ -1178,9 +1181,10 @@ public:
const lldb::addr_t load_addr = process_address + m_offset;
if (log) {
- log->Printf("EntityRegister::Materialize [address = 0x%" PRIx64
- ", m_register_info = %s]",
- (uint64_t)load_addr, m_register_info.name);
+ LLDB_LOGF(log,
+ "EntityRegister::Materialize [address = 0x%" PRIx64
+ ", m_register_info = %s]",
+ (uint64_t)load_addr, m_register_info.name);
}
RegisterValue reg_value;
@@ -1240,9 +1244,10 @@ public:
const lldb::addr_t load_addr = process_address + m_offset;
if (log) {
- log->Printf("EntityRegister::Dematerialize [address = 0x%" PRIx64
- ", m_register_info = %s]",
- (uint64_t)load_addr, m_register_info.name);
+ LLDB_LOGF(log,
+ "EntityRegister::Dematerialize [address = 0x%" PRIx64
+ ", m_register_info = %s]",
+ (uint64_t)load_addr, m_register_info.name);
}
Status extract_error;
@@ -1379,7 +1384,8 @@ Materializer::Materialize(lldb::StackFrameSP &frame_sp, IRMemoryMap &map,
if (Log *log =
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)) {
- log->Printf(
+ LLDB_LOGF(
+ log,
"Materializer::Materialize (frame_sp = %p, process_address = 0x%" PRIx64
") materialized:",
static_cast<void *>(frame_sp.get()), process_address);
@@ -1414,9 +1420,10 @@ void Materializer::Dematerializer::Dematerialize(Status &error,
} else {
if (Log *log =
lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)) {
- log->Printf("Materializer::Dematerialize (frame_sp = %p, process_address "
- "= 0x%" PRIx64 ") about to dematerialize:",
- static_cast<void *>(frame_sp.get()), m_process_address);
+ LLDB_LOGF(log,
+ "Materializer::Dematerialize (frame_sp = %p, process_address "
+ "= 0x%" PRIx64 ") about to dematerialize:",
+ static_cast<void *>(frame_sp.get()), m_process_address);
for (EntityUP &entity_up : m_materializer->m_entities)
entity_up->DumpToLog(*m_map, m_process_address, log);
}
OpenPOWER on IntegriCloud