summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/OperatingSystem/Python
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/Plugins/OperatingSystem/Python
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/Plugins/OperatingSystem/Python')
-rw-r--r--lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
index c1fe0cc8ddd..94cc5182776 100644
--- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
+++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
@@ -120,10 +120,10 @@ DynamicRegisterInfo *OperatingSystemPython::GetDynamicRegisterInfo() {
return nullptr;
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_OS));
- if (log)
- log->Printf("OperatingSystemPython::GetDynamicRegisterInfo() fetching "
- "thread register definitions from python for pid %" PRIu64,
- m_process->GetID());
+ LLDB_LOGF(log,
+ "OperatingSystemPython::GetDynamicRegisterInfo() fetching "
+ "thread register definitions from python for pid %" PRIu64,
+ m_process->GetID());
StructuredData::DictionarySP dictionary =
m_interpreter->OSPlugin_RegisterInfo(m_python_object_sp);
@@ -169,10 +169,10 @@ bool OperatingSystemPython::UpdateThreadList(ThreadList &old_thread_list,
api_lock.try_lock();
auto interpreter_lock = m_interpreter->AcquireInterpreterLock();
- if (log)
- log->Printf("OperatingSystemPython::UpdateThreadList() fetching thread "
- "data from python for pid %" PRIu64,
- m_process->GetID());
+ LLDB_LOGF(log,
+ "OperatingSystemPython::UpdateThreadList() fetching thread "
+ "data from python for pid %" PRIu64,
+ m_process->GetID());
// The threads that are in "new_thread_list" upon entry are the threads from
// the lldb_private::Process subclass, no memory threads will be in this
@@ -190,7 +190,7 @@ bool OperatingSystemPython::UpdateThreadList(ThreadList &old_thread_list,
if (log) {
StreamString strm;
threads_list->Dump(strm);
- log->Printf("threads_list = %s", strm.GetData());
+ LLDB_LOGF(log, "threads_list = %s", strm.GetData());
}
const uint32_t num_threads = threads_list->GetSize();
@@ -316,21 +316,21 @@ OperatingSystemPython::CreateRegisterContextForThread(Thread *thread,
if (reg_data_addr != LLDB_INVALID_ADDRESS) {
// The registers data is in contiguous memory, just create the register
// context using the address provided
- if (log)
- log->Printf("OperatingSystemPython::CreateRegisterContextForThread (tid "
- "= 0x%" PRIx64 ", 0x%" PRIx64 ", reg_data_addr = 0x%" PRIx64
- ") creating memory register context",
- thread->GetID(), thread->GetProtocolID(), reg_data_addr);
+ LLDB_LOGF(log,
+ "OperatingSystemPython::CreateRegisterContextForThread (tid "
+ "= 0x%" PRIx64 ", 0x%" PRIx64 ", reg_data_addr = 0x%" PRIx64
+ ") creating memory register context",
+ thread->GetID(), thread->GetProtocolID(), reg_data_addr);
reg_ctx_sp = std::make_shared<RegisterContextMemory>(
*thread, 0, *GetDynamicRegisterInfo(), reg_data_addr);
} else {
// No register data address is provided, query the python plug-in to let it
// make up the data as it sees fit
- if (log)
- log->Printf("OperatingSystemPython::CreateRegisterContextForThread (tid "
- "= 0x%" PRIx64 ", 0x%" PRIx64
- ") fetching register data from python",
- thread->GetID(), thread->GetProtocolID());
+ LLDB_LOGF(log,
+ "OperatingSystemPython::CreateRegisterContextForThread (tid "
+ "= 0x%" PRIx64 ", 0x%" PRIx64
+ ") fetching register data from python",
+ thread->GetID(), thread->GetProtocolID());
StructuredData::StringSP reg_context_data =
m_interpreter->OSPlugin_RegisterContextData(m_python_object_sp,
@@ -351,10 +351,10 @@ OperatingSystemPython::CreateRegisterContextForThread(Thread *thread,
// if we still have no register data, fallback on a dummy context to avoid
// crashing
if (!reg_ctx_sp) {
- if (log)
- log->Printf("OperatingSystemPython::CreateRegisterContextForThread (tid "
- "= 0x%" PRIx64 ") forcing a dummy register context",
- thread->GetID());
+ LLDB_LOGF(log,
+ "OperatingSystemPython::CreateRegisterContextForThread (tid "
+ "= 0x%" PRIx64 ") forcing a dummy register context",
+ thread->GetID());
reg_ctx_sp = std::make_shared<RegisterContextDummy>(
*thread, 0, target.GetArchitecture().GetAddressByteSize());
}
@@ -375,10 +375,10 @@ lldb::ThreadSP OperatingSystemPython::CreateThread(lldb::tid_t tid,
addr_t context) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
- if (log)
- log->Printf("OperatingSystemPython::CreateThread (tid = 0x%" PRIx64
- ", context = 0x%" PRIx64 ") fetching register data from python",
- tid, context);
+ LLDB_LOGF(log,
+ "OperatingSystemPython::CreateThread (tid = 0x%" PRIx64
+ ", context = 0x%" PRIx64 ") fetching register data from python",
+ tid, context);
if (m_interpreter && m_python_object_sp) {
// First thing we have to do is to try to get the API lock, and the
OpenPOWER on IntegriCloud