summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.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/Platform/MacOSX/PlatformRemoteDarwinDevice.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/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp')
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp67
1 files changed, 40 insertions, 27 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
index 439ca8fcf05..e9bb2929318 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
@@ -150,17 +150,21 @@ bool PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded() {
const SDKDirectoryInfo sdk_sysroot_directory_info(sdk_sysroot_fspec);
m_sdk_directory_infos.push_back(sdk_sysroot_directory_info);
if (log) {
- log->Printf("PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded added "
- "--sysroot SDK directory %s",
- m_sdk_sysroot.GetCString());
+ LLDB_LOGF(
+ log,
+ "PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded added "
+ "--sysroot SDK directory %s",
+ m_sdk_sysroot.GetCString());
}
return true;
}
const char *device_support_dir = GetDeviceSupportDirectory();
if (log) {
- log->Printf("PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded Got "
- "DeviceSupport directory %s",
- device_support_dir);
+ LLDB_LOGF(
+ log,
+ "PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded Got "
+ "DeviceSupport directory %s",
+ device_support_dir);
}
if (device_support_dir) {
const bool find_directories = true;
@@ -183,9 +187,11 @@ bool PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded() {
if (FileSystem::Instance().Exists(sdk_symbols_symlink_fspec)) {
m_sdk_directory_infos.push_back(sdk_directory_info);
if (log) {
- log->Printf("PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded "
- "added builtin SDK directory %s",
- sdk_symbols_symlink_fspec.GetPath().c_str());
+ LLDB_LOGF(
+ log,
+ "PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded "
+ "added builtin SDK directory %s",
+ sdk_symbols_symlink_fspec.GetPath().c_str());
}
}
}
@@ -202,9 +208,11 @@ bool PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded() {
FileSystem::Instance().Resolve(local_sdk_cache);
if (FileSystem::Instance().Exists(local_sdk_cache)) {
if (log) {
- log->Printf("PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded "
- "searching %s for additional SDKs",
- local_sdk_cache.GetPath().c_str());
+ LLDB_LOGF(
+ log,
+ "PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded "
+ "searching %s for additional SDKs",
+ local_sdk_cache.GetPath().c_str());
}
char path[PATH_MAX];
if (local_sdk_cache.GetPath(path, sizeof(path))) {
@@ -217,9 +225,12 @@ bool PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded() {
for (uint32_t i = num_installed; i < num_sdk_infos; ++i) {
m_sdk_directory_infos[i].user_cached = true;
if (log) {
- log->Printf("PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded "
- "user SDK directory %s",
- m_sdk_directory_infos[i].directory.GetPath().c_str());
+ LLDB_LOGF(
+ log,
+ "PlatformRemoteDarwinDevice::"
+ "UpdateSDKDirectoryInfosIfNeeded "
+ "user SDK directory %s",
+ m_sdk_directory_infos[i].directory.GetPath().c_str());
}
}
}
@@ -240,9 +251,11 @@ bool PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded() {
if (FileSystem::Instance().Exists(sdk_symbols_symlink_fspec)) {
m_sdk_directory_infos.push_back(sdk_directory_info);
if (log) {
- log->Printf("PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded "
- "added env var SDK directory %s",
- sdk_symbols_symlink_fspec.GetPath().c_str());
+ LLDB_LOGF(
+ log,
+ "PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded "
+ "added env var SDK directory %s",
+ sdk_symbols_symlink_fspec.GetPath().c_str());
}
}
}
@@ -418,10 +431,8 @@ bool PlatformRemoteDarwinDevice::GetFileInSDK(const char *platform_file_path,
local_file.AppendPathComponent(platform_file_path);
FileSystem::Instance().Resolve(local_file);
if (FileSystem::Instance().Exists(local_file)) {
- if (log)
- log->Printf("Found a copy of %s in the SDK dir %s/%s",
- platform_file_path, sdkroot_path.c_str(),
- paths_to_try[i]);
+ LLDB_LOGF(log, "Found a copy of %s in the SDK dir %s/%s",
+ platform_file_path, sdkroot_path.c_str(), paths_to_try[i]);
return true;
}
local_file.Clear();
@@ -449,8 +460,8 @@ Status PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file,
FileSystem::Instance().Resolve(local_file);
if (FileSystem::Instance().Exists(local_file)) {
if (log) {
- log->Printf("Found a copy of %s in the DeviceSupport dir %s",
- platform_file_path, os_version_dir);
+ LLDB_LOGF(log, "Found a copy of %s in the DeviceSupport dir %s",
+ platform_file_path, os_version_dir);
}
return error;
}
@@ -462,7 +473,8 @@ Status PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file,
FileSystem::Instance().Resolve(local_file);
if (FileSystem::Instance().Exists(local_file)) {
if (log) {
- log->Printf(
+ LLDB_LOGF(
+ log,
"Found a copy of %s in the DeviceSupport dir %s/Symbols.Internal",
platform_file_path, os_version_dir);
}
@@ -475,8 +487,9 @@ Status PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file,
FileSystem::Instance().Resolve(local_file);
if (FileSystem::Instance().Exists(local_file)) {
if (log) {
- log->Printf("Found a copy of %s in the DeviceSupport dir %s/Symbols",
- platform_file_path, os_version_dir);
+ LLDB_LOGF(log,
+ "Found a copy of %s in the DeviceSupport dir %s/Symbols",
+ platform_file_path, os_version_dir);
}
return error;
}
OpenPOWER on IntegriCloud