[Lldb-commits] [lldb] cbcb3bc - [lldb] Don't report progress in the REPL

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 11 13:06:50 PDT 2022


Author: Jonas Devlieghere
Date: 2022-04-11T13:06:40-07:00
New Revision: cbcb3bcee3efc8ea4e72bc36ae5cbaf946804b58

URL: https://github.com/llvm/llvm-project/commit/cbcb3bcee3efc8ea4e72bc36ae5cbaf946804b58
DIFF: https://github.com/llvm/llvm-project/commit/cbcb3bcee3efc8ea4e72bc36ae5cbaf946804b58.diff

LOG: [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

Added: 
    

Modified: 
    lldb/include/lldb/Core/Debugger.h
    lldb/source/Core/Debugger.cpp
    lldb/source/Expression/REPL.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Core/Debugger.h b/lldb/include/lldb/Core/Debugger.h
index 6b6ad22d23511..354230b7a88a3 100644
--- a/lldb/include/lldb/Core/Debugger.h
+++ b/lldb/include/lldb/Core/Debugger.h
@@ -301,6 +301,8 @@ class Debugger : public std::enable_shared_from_this<Debugger>,
 
   bool GetShowProgress() const;
 
+  bool SetShowProgress(bool show_progress);
+
   llvm::StringRef GetShowProgressAnsiPrefix() const;
 
   llvm::StringRef GetShowProgressAnsiSuffix() const;

diff  --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 37e54a9abefaa..a812848c7e8b1 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -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, "");

diff  --git a/lldb/source/Expression/REPL.cpp b/lldb/source/Expression/REPL.cpp
index be41c60ebb5ff..d7582af9b2eab 100644
--- a/lldb/source/Expression/REPL.cpp
+++ b/lldb/source/Expression/REPL.cpp
@@ -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);


        


More information about the lldb-commits mailing list