summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
diff options
context:
space:
mode:
authorOleksiy Vyalov <ovyalov@google.com>2015-05-29 20:02:07 +0000
committerOleksiy Vyalov <ovyalov@google.com>2015-05-29 20:02:07 +0000
commit291f59c5820cd202fcde0d0633f1316285891428 (patch)
treee6a575b1405a4e1c4fc7cd964d44bc4cd23a1c24 /lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
parent44145d79ccc10520652a098d3c426a2c21821c87 (diff)
downloadbcm5719-llvm-291f59c5820cd202fcde0d0633f1316285891428.tar.gz
bcm5719-llvm-291f59c5820cd202fcde0d0633f1316285891428.zip
Fix PlatformAndroid::GetFile - check for relative source path and concatenate it with current working directory if needed.
llvm-svn: 238606
Diffstat (limited to 'lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp')
-rw-r--r--lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
index 7249fac4d43..34df5a9fcc5 100644
--- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
+++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
@@ -13,6 +13,7 @@
#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
@@ -211,12 +212,19 @@ Error
PlatformAndroid::GetFile (const FileSpec& source,
const FileSpec& destination)
{
- if (!IsHost() && m_remote_platform_sp)
+ 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 ()))
{
- AdbClient adb (m_device_id);
- return adb.PullFile(source, destination);
+ source_spec.SetFile (GetRemoteWorkingDirectory ().AsCString (), false, FileSpec::ePathSyntaxPosix);
+ source_spec.AppendPathComponent (source_path.c_str ());
}
- return PlatformLinux::GetFile(source, destination);
+
+ AdbClient adb (m_device_id);
+ return adb.PullFile (source_spec, destination);
}
Error
OpenPOWER on IntegriCloud