diff options
author | Oleksiy Vyalov <ovyalov@google.com> | 2015-05-28 17:42:48 +0000 |
---|---|---|
committer | Oleksiy Vyalov <ovyalov@google.com> | 2015-05-28 17:42:48 +0000 |
commit | 0b5ebef7cdf5b4812a3ceb09a8e4a59359019d3d (patch) | |
tree | 47d32bf3bbc44d41fa0c2a68ba7134e42ac3fd22 /lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp | |
parent | 5f5b1e99aa09b020ff3929207ba3c88aed2d755a (diff) | |
download | bcm5719-llvm-0b5ebef7cdf5b4812a3ceb09a8e4a59359019d3d.tar.gz bcm5719-llvm-0b5ebef7cdf5b4812a3ceb09a8e4a59359019d3d.zip |
Refactor AdbClient and make PlatformAndroid::GetFile to use "adb pull".
http://reviews.llvm.org/D10082
llvm-svn: 238442
Diffstat (limited to 'lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp')
-rw-r--r-- | lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp index 7a6e85cc333..7249fac4d43 100644 --- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp @@ -207,9 +207,21 @@ PlatformAndroid::ConnectRemote(Args& args) return error; } -lldb_private::Error -PlatformAndroid::PutFile (const lldb_private::FileSpec& source, - const lldb_private::FileSpec& destination, +Error +PlatformAndroid::GetFile (const FileSpec& source, + const FileSpec& destination) +{ + if (!IsHost() && m_remote_platform_sp) + { + AdbClient adb (m_device_id); + return adb.PullFile(source, destination); + } + return PlatformLinux::GetFile(source, destination); +} + +Error +PlatformAndroid::PutFile (const FileSpec& source, + const FileSpec& destination, uint32_t uid, uint32_t gid) { @@ -237,6 +249,5 @@ PlatformAndroid::DownloadModuleSlice (const FileSpec &src_file_spec, if (src_offset != 0) return Error ("Invalid offset - %" PRIu64, src_offset); - AdbClient adb (m_device_id); - return adb.PullFile (src_file_spec.GetPath (false).c_str (), dst_file_spec.GetPath ().c_str ()); + return GetFile (src_file_spec, dst_file_spec); } |