Index: lldb/include/lldb/Expression/REPL.h =================================================================== --- lldb/include/lldb/Expression/REPL.h +++ lldb/include/lldb/Expression/REPL.h @@ -16,7 +16,7 @@ // Other libraries and framework includes // Project includes -#include "lldb/../../source/Commands/CommandObjectExpression.h" +#include "lldb/Core/IOHandler.h" #include "lldb/Interpreter/OptionGroupFormat.h" #include "lldb/Interpreter/OptionGroupValueObjectDisplay.h" @@ -24,6 +24,12 @@ class REPL : public IOHandlerDelegate { public: + struct CommandOptions { + bool UnwindOnError = false; + bool IgnoreBreakpoints = false; + bool TryAllThreads = true; + uint32_t Timeout = 0; + }; //---------------------------------------------------------------------- // See TypeSystem.h for how to add subclasses to this. //---------------------------------------------------------------------- @@ -73,8 +79,7 @@ m_varobj_options = options; } - void - SetCommandOptions(const CommandObjectExpression::CommandOptions &options) { + void SetCommandOptions(const CommandOptions &options) { m_command_options = options; } @@ -150,7 +155,7 @@ OptionGroupFormat m_format_options = OptionGroupFormat(lldb::eFormatDefault); OptionGroupValueObjectDisplay m_varobj_options; - CommandObjectExpression::CommandOptions m_command_options; + CommandOptions m_command_options; std::string m_compiler_options; bool m_enable_auto_indent = true; Index: lldb/source/Commands/CommandObjectExpression.cpp =================================================================== --- lldb/source/Commands/CommandObjectExpression.cpp +++ lldb/source/Commands/CommandObjectExpression.cpp @@ -588,7 +588,13 @@ if (repl_sp) { if (initialize) { - repl_sp->SetCommandOptions(m_command_options); + REPL::CommandOptions Options; + Options.IgnoreBreakpoints = + m_command_options.ignore_breakpoints; + Options.Timeout = m_command_options.timeout; + Options.TryAllThreads = m_command_options.try_all_threads; + Options.UnwindOnError = m_command_options.unwind_on_error; + repl_sp->SetCommandOptions(Options); repl_sp->SetFormatOptions(m_format_options); repl_sp->SetValueObjectDisplayOptions(m_varobj_options); } Index: lldb/source/Expression/REPL.cpp =================================================================== --- lldb/source/Expression/REPL.cpp +++ lldb/source/Expression/REPL.cpp @@ -32,12 +32,6 @@ auto exe_ctx = debugger.GetCommandInterpreter().GetExecutionContext(); m_format_options.OptionParsingStarting(&exe_ctx); m_varobj_options.OptionParsingStarting(&exe_ctx); - m_command_options.OptionParsingStarting(&exe_ctx); - - // Default certain settings for REPL regardless of the global settings. - m_command_options.unwind_on_error = false; - m_command_options.ignore_breakpoints = false; - m_command_options.debug = false; } REPL::~REPL() = default; @@ -283,18 +277,19 @@ EvaluateExpressionOptions expr_options; expr_options.SetCoerceToId(m_varobj_options.use_objc); - expr_options.SetUnwindOnError(m_command_options.unwind_on_error); - expr_options.SetIgnoreBreakpoints(m_command_options.ignore_breakpoints); + expr_options.SetUnwindOnError(m_command_options.UnwindOnError); + expr_options.SetIgnoreBreakpoints(m_command_options.IgnoreBreakpoints); expr_options.SetKeepInMemory(true); expr_options.SetUseDynamic(m_varobj_options.use_dynamic); - expr_options.SetTryAllThreads(m_command_options.try_all_threads); + expr_options.SetTryAllThreads(m_command_options.TryAllThreads); expr_options.SetGenerateDebugInfo(true); expr_options.SetREPLEnabled(true); expr_options.SetColorizeErrors(colorize_err); expr_options.SetPoundLine(m_repl_source_path.c_str(), m_code.GetSize() + 1); - if (m_command_options.timeout > 0) - expr_options.SetTimeout(std::chrono::microseconds(m_command_options.timeout)); + if (m_command_options.Timeout > 0) + expr_options.SetTimeout( + std::chrono::microseconds(m_command_options.Timeout)); else expr_options.SetTimeout(llvm::None);