summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/Android
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/Platform/Android')
-rw-r--r--lldb/source/Plugins/Platform/Android/AdbClient.cpp8
-rw-r--r--lldb/source/Plugins/Platform/Android/AdbClient.h5
-rw-r--r--lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp11
3 files changed, 13 insertions, 11 deletions
diff --git a/lldb/source/Plugins/Platform/Android/AdbClient.cpp b/lldb/source/Plugins/Platform/Android/AdbClient.cpp
index d9e27d94f74..05004406c04 100644
--- a/lldb/source/Plugins/Platform/Android/AdbClient.cpp
+++ b/lldb/source/Plugins/Platform/Android/AdbClient.cpp
@@ -383,10 +383,10 @@ Error AdbClient::internalShell(const char *command, milliseconds timeout,
return Error();
}
-Error AdbClient::Shell(const char *command, uint32_t timeout_ms,
+Error AdbClient::Shell(const char *command, milliseconds timeout,
std::string *output) {
std::vector<char> output_buffer;
- auto error = internalShell(command, milliseconds(timeout_ms), output_buffer);
+ auto error = internalShell(command, timeout, output_buffer);
if (error.Fail())
return error;
@@ -395,10 +395,10 @@ Error AdbClient::Shell(const char *command, uint32_t timeout_ms,
return error;
}
-Error AdbClient::ShellToFile(const char *command, uint32_t timeout_ms,
+Error AdbClient::ShellToFile(const char *command, milliseconds timeout,
const FileSpec &output_file_spec) {
std::vector<char> output_buffer;
- auto error = internalShell(command, milliseconds(timeout_ms), output_buffer);
+ auto error = internalShell(command, timeout, output_buffer);
if (error.Fail())
return error;
diff --git a/lldb/source/Plugins/Platform/Android/AdbClient.h b/lldb/source/Plugins/Platform/Android/AdbClient.h
index f1d72aae8b8..169a0b5a4e3 100644
--- a/lldb/source/Plugins/Platform/Android/AdbClient.h
+++ b/lldb/source/Plugins/Platform/Android/AdbClient.h
@@ -94,9 +94,10 @@ public:
Error DeletePortForwarding(const uint16_t local_port);
- Error Shell(const char *command, uint32_t timeout_ms, std::string *output);
+ Error Shell(const char *command, std::chrono::milliseconds timeout,
+ std::string *output);
- Error ShellToFile(const char *command, uint32_t timeout_ms,
+ Error ShellToFile(const char *command, std::chrono::milliseconds timeout,
const FileSpec &output_file_spec);
std::unique_ptr<SyncService> GetSyncService(Error &error);
diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
index 7d701728635..64a320f8c3f 100644
--- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
+++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
@@ -28,6 +28,7 @@
using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::platform_android;
+using namespace std::chrono;
static uint32_t g_initialize_count = 0;
static const unsigned int g_android_default_cache_size =
@@ -230,7 +231,7 @@ Error PlatformAndroid::GetFile(const FileSpec &source,
char cmd[PATH_MAX];
snprintf(cmd, sizeof(cmd), "cat '%s'", source_file);
- return adb.ShellToFile(cmd, 60000 /* ms */, destination);
+ return adb.ShellToFile(cmd, minutes(1), destination);
}
Error PlatformAndroid::PutFile(const FileSpec &source,
@@ -288,7 +289,7 @@ uint32_t PlatformAndroid::GetSdkVersion() {
std::string version_string;
AdbClient adb(m_device_id);
Error error =
- adb.Shell("getprop ro.build.version.sdk", 5000 /* ms */, &version_string);
+ adb.Shell("getprop ro.build.version.sdk", seconds(5), &version_string);
version_string = llvm::StringRef(version_string).trim().str();
if (error.Fail() || version_string.empty()) {
@@ -327,7 +328,7 @@ Error PlatformAndroid::DownloadSymbolFile(const lldb::ModuleSP &module_sp,
AdbClient adb(m_device_id);
std::string tmpdir;
Error error = adb.Shell("mktemp --directory --tmpdir /data/local/tmp",
- 5000 /* ms */, &tmpdir);
+ seconds(5), &tmpdir);
if (error.Fail() || tmpdir.empty())
return Error("Failed to generate temporary directory on the device (%s)",
error.AsCString());
@@ -338,7 +339,7 @@ Error PlatformAndroid::DownloadSymbolFile(const lldb::ModuleSP &module_sp,
tmpdir_remover(&tmpdir, [this, &adb](std::string *s) {
StreamString command;
command.Printf("rm -rf %s", s->c_str());
- Error error = adb.Shell(command.GetData(), 5000 /* ms */, nullptr);
+ Error error = adb.Shell(command.GetData(), seconds(5), nullptr);
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM));
if (log && error.Fail())
@@ -353,7 +354,7 @@ Error PlatformAndroid::DownloadSymbolFile(const lldb::ModuleSP &module_sp,
command.Printf("oatdump --symbolize=%s --output=%s",
module_sp->GetPlatformFileSpec().GetCString(false),
symfile_platform_filespec.GetCString(false));
- error = adb.Shell(command.GetData(), 60000 /* ms */, nullptr);
+ error = adb.Shell(command.GetData(), minutes(1), nullptr);
if (error.Fail())
return Error("Oatdump failed: %s", error.AsCString());
OpenPOWER on IntegriCloud