diff options
author | Pavel Labath <labath@google.com> | 2018-05-10 10:46:03 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2018-05-10 10:46:03 +0000 |
commit | 19dd1a0ea6fed11b40cb9f83adbce17c04d569f3 (patch) | |
tree | 9684b6fe9398b094dbc917e225c1f4f887d58db9 /lldb/source/Commands/CommandObjectPlatform.cpp | |
parent | ce6ada41513eeff22e04b52d7965cdf02d8fe6fe (diff) | |
download | bcm5719-llvm-19dd1a0ea6fed11b40cb9f83adbce17c04d569f3.tar.gz bcm5719-llvm-19dd1a0ea6fed11b40cb9f83adbce17c04d569f3.zip |
Convert all RunShellCommand functions to use the Timeout class
this completes the Timeout migration started in r331880 with the
Predicate class.
llvm-svn: 331970
Diffstat (limited to 'lldb/source/Commands/CommandObjectPlatform.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectPlatform.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp index 379e8507f4e..0c979032708 100644 --- a/lldb/source/Commands/CommandObjectPlatform.cpp +++ b/lldb/source/Commands/CommandObjectPlatform.cpp @@ -1692,7 +1692,7 @@ class CommandObjectPlatformShell : public CommandObjectRaw { public: class CommandOptions : public Options { public: - CommandOptions() : Options(), timeout(10) {} + CommandOptions() : Options() {} ~CommandOptions() override = default; @@ -1708,11 +1708,13 @@ public: switch (short_option) { case 't': - timeout = 10; - if (option_arg.getAsInteger(10, timeout)) + uint32_t timeout_sec; + if (option_arg.getAsInteger(10, timeout_sec)) error.SetErrorStringWithFormat( "could not convert \"%s\" to a numeric value.", option_arg.str().c_str()); + else + timeout = std::chrono::seconds(timeout_sec); break; default: error.SetErrorStringWithFormat("invalid short option character '%c'", @@ -1725,7 +1727,7 @@ public: void OptionParsingStarting(ExecutionContext *execution_context) override {} - uint32_t timeout; + Timeout<std::micro> timeout = std::chrono::seconds(10); }; CommandObjectPlatformShell(CommandInterpreter &interpreter) |