diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-07-31 23:34:45 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-07-31 23:34:45 +0000 |
commit | 70df51b8a9e20db3cba59437d1d9cdd4c98b0eee (patch) | |
tree | ef59abe388f329d169a3cca3c4d9e8f1211d3e07 | |
parent | 45ff4868c443a5e98c2db97b7d64a3ed92784db5 (diff) | |
download | bcm5719-llvm-70df51b8a9e20db3cba59437d1d9cdd4c98b0eee.tar.gz bcm5719-llvm-70df51b8a9e20db3cba59437d1d9cdd4c98b0eee.zip |
[Reproducers] Force replay in synchronous mode.
Replaying a reproducer in asynchronous mode never makes sense. This
patch disables asynchronous mode during replay.
Differential revision: https://reviews.llvm.org/D65547
llvm-svn: 367494
-rw-r--r-- | lldb/lit/Reproducer/TestSynchronous.test | 13 | ||||
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 6 |
2 files changed, 18 insertions, 1 deletions
diff --git a/lldb/lit/Reproducer/TestSynchronous.test b/lldb/lit/Reproducer/TestSynchronous.test new file mode 100644 index 00000000000..a2ff189bfc7 --- /dev/null +++ b/lldb/lit/Reproducer/TestSynchronous.test @@ -0,0 +1,13 @@ +# Ensure that replay happens in synchronous mode. + +# RUN: rm -rf %t.repro +# RUN: %lldb -x -b --capture --capture-path %t.repro -o 'script lldb.debugger.SetAsync(True)' -o 'script lldb.debugger.GetAsync()' -o 'reproducer generate' | FileCheck %s --check-prefix CAPTURE +# RUN: %lldb --replay %t.repro | FileCheck %s --check-prefix REPLAY + +# CAPTURE: script lldb.debugger.SetAsync(True) +# CAPTURE-NEXT: script lldb.debugger.GetAsync() +# CAPTURE-NEXT: True + +# REPLAY: script lldb.debugger.SetAsync(True) +# REPLAY-NEXT: script lldb.debugger.GetAsync() +# REPLAY-NEXT: False diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 8af8cc42e28..114316ab264 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -109,7 +109,7 @@ CommandInterpreter::CommandInterpreter(Debugger &debugger, Properties(OptionValuePropertiesSP( new OptionValueProperties(ConstString("interpreter")))), IOHandlerDelegate(IOHandlerDelegate::Completion::LLDBCommand), - m_debugger(debugger), m_synchronous_execution(synchronous_execution), + m_debugger(debugger), m_synchronous_execution(true), m_skip_lldbinit_files(false), m_skip_app_init_files(false), m_command_io_handler_sp(), m_comment_char('#'), m_batch_command_mode(false), m_truncation_warning(eNoTruncation), @@ -118,6 +118,7 @@ CommandInterpreter::CommandInterpreter(Debugger &debugger, SetEventName(eBroadcastBitThreadShouldExit, "thread-should-exit"); SetEventName(eBroadcastBitResetPrompt, "reset-prompt"); SetEventName(eBroadcastBitQuitCommandReceived, "quit"); + SetSynchronous(synchronous_execution); CheckInWithManager(); m_collection_sp->Initialize(g_interpreter_properties); } @@ -2504,6 +2505,9 @@ void CommandInterpreter::HandleCommandsFromFile( bool CommandInterpreter::GetSynchronous() { return m_synchronous_execution; } void CommandInterpreter::SetSynchronous(bool value) { + // Asynchronous mode is not supported during reproducer replay. + if (repro::Reproducer::Instance().GetLoader()) + return; m_synchronous_execution = value; } |