[lldb] Don't report progress in the REPL

Don't report progress events in the REPL. Most of the progress events
are debugger specific which are useful when you're debugging, but not so
much when you're waiting for the next line to be executed in the REPL.

This patch disables reporting of progress events when in REPL mode.

rdar://91502950

Differential revision: https://reviews.llvm.org/D123426
This commit is contained in:
Jonas Devlieghere 2022-04-11 10:42:59 -07:00
parent d06fb9045b
commit cbcb3bcee3
No known key found for this signature in database
GPG Key ID: 49CC0BD90FDEED4D
3 changed files with 9 additions and 0 deletions

View File

@ -301,6 +301,8 @@ public:
bool GetShowProgress() const;
bool SetShowProgress(bool show_progress);
llvm::StringRef GetShowProgressAnsiPrefix() const;
llvm::StringRef GetShowProgressAnsiSuffix() const;

View File

@ -385,6 +385,12 @@ bool Debugger::GetShowProgress() const {
nullptr, idx, g_debugger_properties[idx].default_uint_value != 0);
}
bool Debugger::SetShowProgress(bool show_progress) {
const uint32_t idx = ePropertyShowProgress;
return m_collection_sp->SetPropertyAtIndexAsBoolean(nullptr, idx,
show_progress);
}
llvm::StringRef Debugger::GetShowProgressAnsiPrefix() const {
const uint32_t idx = ePropertyShowProgressAnsiPrefix;
return m_collection_sp->GetPropertyAtIndexAsString(nullptr, idx, "");

View File

@ -25,6 +25,7 @@ using namespace lldb_private;
REPL::REPL(LLVMCastKind kind, Target &target) : m_target(target), m_kind(kind) {
// Make sure all option values have sane defaults
Debugger &debugger = m_target.GetDebugger();
debugger.SetShowProgress(false);
auto exe_ctx = debugger.GetCommandInterpreter().GetExecutionContext();
m_format_options.OptionParsingStarting(&exe_ctx);
m_varobj_options.OptionParsingStarting(&exe_ctx);