diff options
Diffstat (limited to 'source/Plugins/Platform/Android/PlatformAndroid.cpp')
-rw-r--r-- | source/Plugins/Platform/Android/PlatformAndroid.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/source/Plugins/Platform/Android/PlatformAndroid.cpp b/source/Plugins/Platform/Android/PlatformAndroid.cpp index ad3918d4e202b..d896a9f99e638 100644 --- a/source/Plugins/Platform/Android/PlatformAndroid.cpp +++ b/source/Plugins/Platform/Android/PlatformAndroid.cpp @@ -154,12 +154,12 @@ ConstString PlatformAndroid::GetPluginName() { return GetPluginNameStatic(IsHost()); } -Error PlatformAndroid::ConnectRemote(Args &args) { +Status PlatformAndroid::ConnectRemote(Args &args) { m_device_id.clear(); if (IsHost()) { - return Error("can't connect to the host platform '%s', always connected", - GetPluginName().GetCString()); + return Status("can't connect to the host platform '%s', always connected", + GetPluginName().GetCString()); } if (!m_remote_platform_sp) @@ -169,9 +169,9 @@ Error PlatformAndroid::ConnectRemote(Args &args) { llvm::StringRef scheme, host, path; const char *url = args.GetArgumentAtIndex(0); if (!url) - return Error("URL is null."); + return Status("URL is null."); if (!UriParser::Parse(url, scheme, host, port, path)) - return Error("Invalid URL: %s", url); + return Status("Invalid URL: %s", url); if (host != "localhost") m_device_id = host; @@ -187,8 +187,8 @@ Error PlatformAndroid::ConnectRemote(Args &args) { return error; } -Error PlatformAndroid::GetFile(const FileSpec &source, - const FileSpec &destination) { +Status PlatformAndroid::GetFile(const FileSpec &source, + const FileSpec &destination) { if (IsHost() || !m_remote_platform_sp) return PlatformLinux::GetFile(source, destination); @@ -198,7 +198,7 @@ Error PlatformAndroid::GetFile(const FileSpec &source, source_spec = GetRemoteWorkingDirectory().CopyByAppendingPathComponent( source_spec.GetCString(false)); - Error error; + Status error; auto sync_service = GetSyncService(error); if (error.Fail()) return error; @@ -219,7 +219,7 @@ Error PlatformAndroid::GetFile(const FileSpec &source, source_file); if (strchr(source_file, '\'') != nullptr) - return Error("Doesn't support single-quotes in filenames"); + return Status("Doesn't support single-quotes in filenames"); // mode == 0 can signify that adbd cannot access the file // due security constraints - try "cat ..." as a fallback. @@ -231,9 +231,9 @@ Error PlatformAndroid::GetFile(const FileSpec &source, return adb.ShellToFile(cmd, minutes(1), destination); } -Error PlatformAndroid::PutFile(const FileSpec &source, - const FileSpec &destination, uint32_t uid, - uint32_t gid) { +Status PlatformAndroid::PutFile(const FileSpec &source, + const FileSpec &destination, uint32_t uid, + uint32_t gid) { if (IsHost() || !m_remote_platform_sp) return PlatformLinux::PutFile(source, destination, uid, gid); @@ -244,7 +244,7 @@ Error PlatformAndroid::PutFile(const FileSpec &source, destination_spec.GetCString(false)); // TODO: Set correct uid and gid on remote file. - Error error; + Status error; auto sync_service = GetSyncService(error); if (error.Fail()) return error; @@ -253,18 +253,18 @@ Error PlatformAndroid::PutFile(const FileSpec &source, const char *PlatformAndroid::GetCacheHostname() { return m_device_id.c_str(); } -Error PlatformAndroid::DownloadModuleSlice(const FileSpec &src_file_spec, - const uint64_t src_offset, - const uint64_t src_size, - const FileSpec &dst_file_spec) { +Status PlatformAndroid::DownloadModuleSlice(const FileSpec &src_file_spec, + const uint64_t src_offset, + const uint64_t src_size, + const FileSpec &dst_file_spec) { if (src_offset != 0) - return Error("Invalid offset - %" PRIu64, src_offset); + return Status("Invalid offset - %" PRIu64, src_offset); return GetFile(src_file_spec, dst_file_spec); } -Error PlatformAndroid::DisconnectRemote() { - Error error = PlatformLinux::DisconnectRemote(); +Status PlatformAndroid::DisconnectRemote() { + Status error = PlatformLinux::DisconnectRemote(); if (error.Success()) { m_device_id.clear(); m_sdk_version = 0; @@ -285,7 +285,7 @@ uint32_t PlatformAndroid::GetSdkVersion() { std::string version_string; AdbClient adb(m_device_id); - Error error = + Status error = adb.Shell("getprop ro.build.version.sdk", seconds(5), &version_string); version_string = llvm::StringRef(version_string).trim().str(); @@ -301,34 +301,34 @@ uint32_t PlatformAndroid::GetSdkVersion() { return m_sdk_version; } -Error PlatformAndroid::DownloadSymbolFile(const lldb::ModuleSP &module_sp, - const FileSpec &dst_file_spec) { +Status PlatformAndroid::DownloadSymbolFile(const lldb::ModuleSP &module_sp, + const FileSpec &dst_file_spec) { // For oat file we can try to fetch additional debug info from the device ConstString extension = module_sp->GetFileSpec().GetFileNameExtension(); if (extension != ConstString("oat") && extension != ConstString("odex")) - return Error( + return Status( "Symbol file downloading only supported for oat and odex files"); // If we have no information about the platform file we can't execute oatdump if (!module_sp->GetPlatformFileSpec()) - return Error("No platform file specified"); + return Status("No platform file specified"); // Symbolizer isn't available before SDK version 23 if (GetSdkVersion() < 23) - return Error("Symbol file generation only supported on SDK 23+"); + return Status("Symbol file generation only supported on SDK 23+"); // If we already have symtab then we don't have to try and generate one if (module_sp->GetSectionList()->FindSectionByName(ConstString(".symtab")) != nullptr) - return Error("Symtab already available in the module"); + return Status("Symtab already available in the module"); AdbClient adb(m_device_id); std::string tmpdir; - Error error = adb.Shell("mktemp --directory --tmpdir /data/local/tmp", - seconds(5), &tmpdir); + Status error = adb.Shell("mktemp --directory --tmpdir /data/local/tmp", + seconds(5), &tmpdir); if (error.Fail() || tmpdir.empty()) - return Error("Failed to generate temporary directory on the device (%s)", - error.AsCString()); + return Status("Failed to generate temporary directory on the device (%s)", + error.AsCString()); tmpdir = llvm::StringRef(tmpdir).trim().str(); // Create file remover for the temporary directory created on the device @@ -336,7 +336,7 @@ Error PlatformAndroid::DownloadSymbolFile(const lldb::ModuleSP &module_sp, tmpdir_remover(&tmpdir, [&adb](std::string *s) { StreamString command; command.Printf("rm -rf %s", s->c_str()); - Error error = adb.Shell(command.GetData(), seconds(5), nullptr); + Status error = adb.Shell(command.GetData(), seconds(5), nullptr); Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); if (log && error.Fail()) @@ -353,7 +353,7 @@ Error PlatformAndroid::DownloadSymbolFile(const lldb::ModuleSP &module_sp, symfile_platform_filespec.GetCString(false)); error = adb.Shell(command.GetData(), minutes(1), nullptr); if (error.Fail()) - return Error("Oatdump failed: %s", error.AsCString()); + return Status("Oatdump failed: %s", error.AsCString()); // Download the symbolfile from the remote device return GetFile(symfile_platform_filespec, dst_file_spec); @@ -375,7 +375,7 @@ const char *PlatformAndroid::GetLibdlFunctionDeclarations() const { )"; } -AdbClient::SyncService *PlatformAndroid::GetSyncService(Error &error) { +AdbClient::SyncService *PlatformAndroid::GetSyncService(Status &error) { if (m_adb_sync_svc && m_adb_sync_svc->IsConnected()) return m_adb_sync_svc.get(); |