[Lldb-commits] [lldb] r238624 - Use FileSpec::IsRelativeToCurrentWorkingDirectory instead of llvm::sys::path::is_relative in PlatformAndroid::GetFile.

Oleksiy Vyalov ovyalov at google.com
Fri May 29 15:54:45 PDT 2015


Author: ovyalov
Date: Fri May 29 17:54:45 2015
New Revision: 238624

URL: http://llvm.org/viewvc/llvm-project?rev=238624&view=rev
Log:
Use FileSpec::IsRelativeToCurrentWorkingDirectory instead of llvm::sys::path::is_relative in PlatformAndroid::GetFile.

http://reviews.llvm.org/D10141


Modified:
    lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp

Modified: lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp?rev=238624&r1=238623&r2=238624&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp Fri May 29 17:54:45 2015
@@ -13,7 +13,6 @@
 #include "lldb/Core/Log.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Host/HostInfo.h"
-#include "llvm/Support/Path.h"
 #include "Utility/UriParser.h"
 
 // Project includes
@@ -215,13 +214,9 @@ PlatformAndroid::GetFile (const FileSpec
     if (IsHost() || !m_remote_platform_sp)
         return PlatformLinux::GetFile(source, destination);
 
-    FileSpec source_spec (source);
-    const auto source_path = source_spec.GetPath (false);
-    if (llvm::sys::path::is_relative (source_path.c_str ()))
-    {
-        source_spec = GetRemoteWorkingDirectory ();
-        source_spec.AppendPathComponent (source_path.c_str ());
-    }
+    FileSpec source_spec (source.GetPath (false), false, FileSpec::ePathSyntaxPosix);
+    if (source_spec.IsRelativeToCurrentWorkingDirectory ())
+        source_spec = GetRemoteWorkingDirectory ().CopyByAppendingPathComponent (source_spec.GetCString (false));
 
     AdbClient adb (m_device_id);
     return adb.PullFile (source_spec, destination);





More information about the lldb-commits mailing list