[Lldb-commits] [lldb] [lldb] Gate `PolicyStack::Current()` log behind verbose (PR #209527)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 14 09:48:06 PDT 2026


================
@@ -25,10 +25,14 @@ PolicyStack &PolicyStack::Get() {
 
 Policy PolicyStack::Current() const {
   Policy p = m_stack.back();
-  if (Log *log = GetLog(LLDBLog::Process)) {
+  // `Current()` is called on every read of the current policy (e.g. every
+  // `Process::GetState()`, itself called on every prompt redraw), so log
+  // only when verbose is set to avoid drowning out the process log.
+  Log *log = GetLog(LLDBLog::Process);
+  if (log && log->GetVerbose()) {
----------------
JDevlieghere wrote:

```suggestion
  if (Log *log = GetLog(LLDBLog::Process)) {
    if (log->GetVerbose()) {
```

https://github.com/llvm/llvm-project/pull/209527


More information about the lldb-commits mailing list