Skip to content

Commit a4dbdf4

Browse files
author
walter erquinigo
committed
[LLDB] Allow expression evaluators to set arbitrary timeouts
llvm@59237bb changed the behavior of the `SetTimeout` and `GetTimeout` methods of `EvaluateExpressionOptions`, which broke the Mojo REPL and related services (https://docs.modular.com/mojo/) because it relies on having infinite timeouts. That's a necessity because developers often use the REPL for executing extremely long-running numeric jobs. Having said that, `EvaluateExpressionOptions` shouldn't be that opinionated on this matter anyway. Instead, it should be the responsibility of the evaluator to define which timeout to use for each specific case. Differential Revision: https://reviews.llvm.org/D157764
1 parent a1c736e commit a4dbdf4

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

lldb/include/lldb/Target/Target.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -346,16 +346,9 @@ class EvaluateExpressionOptions {
346346
m_use_dynamic = dynamic;
347347
}
348348

349-
const Timeout<std::micro> &GetTimeout() const {
350-
assert(m_timeout && m_timeout->count() > 0);
351-
return m_timeout;
352-
}
349+
const Timeout<std::micro> &GetTimeout() const { return m_timeout; }
353350

354-
void SetTimeout(const Timeout<std::micro> &timeout) {
355-
// Disallow setting a non-zero timeout.
356-
if (timeout && timeout->count() > 0)
357-
m_timeout = timeout;
358-
}
351+
void SetTimeout(const Timeout<std::micro> &timeout) { m_timeout = timeout; }
359352

360353
const Timeout<std::micro> &GetOneThreadTimeout() const {
361354
return m_one_thread_timeout;

0 commit comments

Comments
 (0)