diff options
-rw-r--r-- | lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp index e9bb2929318..0aa129c808d 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp @@ -449,12 +449,10 @@ Status PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file, Status error; char platform_file_path[PATH_MAX]; if (platform_file.GetPath(platform_file_path, sizeof(platform_file_path))) { - char resolved_path[PATH_MAX]; - const char *os_version_dir = GetDeviceSupportDirectoryForOSVersion(); if (os_version_dir) { - ::snprintf(resolved_path, sizeof(resolved_path), "%s/%s", os_version_dir, - platform_file_path); + std::string resolved_path = + (llvm::Twine(os_version_dir) + "/" + platform_file_path).str(); local_file.SetFile(resolved_path, FileSpec::Style::native); FileSystem::Instance().Resolve(local_file); @@ -466,31 +464,28 @@ Status PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file, return error; } - ::snprintf(resolved_path, sizeof(resolved_path), "%s/Symbols.Internal/%s", - os_version_dir, platform_file_path); + resolved_path = (llvm::Twine(os_version_dir) + "/Symbols.Internal/" + + platform_file_path) + .str(); local_file.SetFile(resolved_path, FileSpec::Style::native); FileSystem::Instance().Resolve(local_file); if (FileSystem::Instance().Exists(local_file)) { - if (log) { - LLDB_LOGF( - log, - "Found a copy of %s in the DeviceSupport dir %s/Symbols.Internal", - platform_file_path, os_version_dir); - } + LLDB_LOGF( + log, + "Found a copy of %s in the DeviceSupport dir %s/Symbols.Internal", + platform_file_path, os_version_dir); return error; } - ::snprintf(resolved_path, sizeof(resolved_path), "%s/Symbols/%s", - os_version_dir, platform_file_path); + resolved_path = + (llvm::Twine(os_version_dir) + "/Symbols/" + platform_file_path) + .str(); local_file.SetFile(resolved_path, FileSpec::Style::native); FileSystem::Instance().Resolve(local_file); if (FileSystem::Instance().Exists(local_file)) { - if (log) { - LLDB_LOGF(log, - "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; } } |