[Lldb-commits] [lldb] r238860 - Fix PlatformAndroid::PutFile to support relative destination paths.
Oleksiy Vyalov
ovyalov at google.com
Tue Jun 2 12:29:48 PDT 2015
Author: ovyalov
Date: Tue Jun 2 14:29:48 2015
New Revision: 238860
URL: http://llvm.org/viewvc/llvm-project?rev=238860&view=rev
Log:
Fix PlatformAndroid::PutFile to support relative destination paths.
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=238860&r1=238859&r2=238860&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp Tue Jun 2 14:29:48 2015
@@ -228,13 +228,16 @@ PlatformAndroid::PutFile (const FileSpec
uint32_t uid,
uint32_t gid)
{
- if (!IsHost() && m_remote_platform_sp)
- {
- AdbClient adb (m_device_id);
- // TODO: Set correct uid and gid on remote file.
- return adb.PushFile(source, destination);
- }
- return PlatformLinux::PutFile(source, destination, uid, gid);
+ if (IsHost() || !m_remote_platform_sp)
+ return PlatformLinux::PutFile (source, destination, uid, gid);
+
+ FileSpec destination_spec (destination.GetPath (false), false, FileSpec::ePathSyntaxPosix);
+ if (destination_spec.IsRelativeToCurrentWorkingDirectory ())
+ destination_spec = GetRemoteWorkingDirectory ().CopyByAppendingPathComponent (destination_spec.GetCString (false));
+
+ AdbClient adb (m_device_id);
+ // TODO: Set correct uid and gid on remote file.
+ return adb.PushFile(source, destination_spec);
}
const char *
More information about the lldb-commits
mailing list