summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.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/Plugins/ABI/SysV-mips/ABISysV_mips.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/Plugins/ABI/SysV-mips/ABISysV_mips.cpp')
-rw-r--r--lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp b/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
index 9d15cb57bd0..df63a31d198 100644
--- a/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
+++ b/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
@@ -600,9 +600,8 @@ bool ABISysV_mips::PrepareTrivialCall(Thread &thread, addr_t sp,
reg_info = reg_ctx->GetRegisterInfo(eRegisterKindGeneric,
LLDB_REGNUM_GENERIC_ARG1 + i);
- if (log)
- log->Printf("About to write arg%zd (0x%" PRIx64 ") into %s", i + 1,
- args[i], reg_info->name);
+ LLDB_LOGF(log, "About to write arg%zd (0x%" PRIx64 ") into %s", i + 1,
+ args[i], reg_info->name);
if (!reg_ctx->WriteRegisterFromUnsigned(reg_info, args[i]))
return false;
@@ -630,9 +629,8 @@ bool ABISysV_mips::PrepareTrivialCall(Thread &thread, addr_t sp,
size_t i = 4;
for (; ai != ae; ++ai) {
reg_value.SetUInt32(*ai);
- if (log)
- log->Printf("About to write arg%zd (0x%" PRIx64 ") at 0x%" PRIx64 "",
- i + 1, args[i], arg_pos);
+ LLDB_LOGF(log, "About to write arg%zd (0x%" PRIx64 ") at 0x%" PRIx64 "",
+ i + 1, args[i], arg_pos);
if (reg_ctx
->WriteRegisterValueToMemory(reg_info, arg_pos,
@@ -654,8 +652,7 @@ bool ABISysV_mips::PrepareTrivialCall(Thread &thread, addr_t sp,
const RegisterInfo *r25_info = reg_ctx->GetRegisterInfoByName("r25", 0);
const RegisterInfo *r0_info = reg_ctx->GetRegisterInfoByName("zero", 0);
- if (log)
- log->Printf("Writing R0: 0x%" PRIx64, (uint64_t)0);
+ LLDB_LOGF(log, "Writing R0: 0x%" PRIx64, (uint64_t)0);
/* Write r0 with 0, in case we are stopped in syscall,
* such setting prevents automatic decrement of the PC.
@@ -664,29 +661,25 @@ bool ABISysV_mips::PrepareTrivialCall(Thread &thread, addr_t sp,
if (!reg_ctx->WriteRegisterFromUnsigned(r0_info, (uint64_t)0))
return false;
- if (log)
- log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp);
+ LLDB_LOGF(log, "Writing SP: 0x%" PRIx64, (uint64_t)sp);
// Set "sp" to the requested value
if (!reg_ctx->WriteRegisterFromUnsigned(sp_reg_info, sp))
return false;
- if (log)
- log->Printf("Writing RA: 0x%" PRIx64, (uint64_t)return_addr);
+ LLDB_LOGF(log, "Writing RA: 0x%" PRIx64, (uint64_t)return_addr);
// Set "ra" to the return address
if (!reg_ctx->WriteRegisterFromUnsigned(ra_reg_info, return_addr))
return false;
- if (log)
- log->Printf("Writing PC: 0x%" PRIx64, (uint64_t)func_addr);
+ LLDB_LOGF(log, "Writing PC: 0x%" PRIx64, (uint64_t)func_addr);
// Set pc to the address of the called function.
if (!reg_ctx->WriteRegisterFromUnsigned(pc_reg_info, func_addr))
return false;
- if (log)
- log->Printf("Writing r25: 0x%" PRIx64, (uint64_t)func_addr);
+ LLDB_LOGF(log, "Writing r25: 0x%" PRIx64, (uint64_t)func_addr);
// All callers of position independent functions must place the address of
// the called function in t9 (r25)
OpenPOWER on IntegriCloud