[Lldb-commits] [lldb] [lldb] Override Should{Select, Show} in StopReasonBreakpoint (PR #135637)

Felipe de Azevedo Piovezan via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 14 09:01:30 PDT 2025


https://github.com/felipepiovezan created https://github.com/llvm/llvm-project/pull/135637

This is necessary so that LLDB does not select (or show the stop reason for) a thread which stopped at an internal breakpoint.

Other than manual testing/inspection, which I've done, this does not seem to lend itself to API testing, as we cannot set internal breakpoints through the SBAPI.

>From 2252ae2496656eae6c76861d665320ba1941ec1c Mon Sep 17 00:00:00 2001
From: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
Date: Mon, 14 Apr 2025 08:56:55 -0700
Subject: [PATCH] [lldb] Override Should{Select,Show} in StopReasonBreakpoint

This is necessary so that LLDB does not select (or show the stop reason
for) a thread which stopped at an internal breakpoint.

Other than manual testing/inspection, which I've done, this does not
seem to lend itself to API testing, as we cannot set internal
breakpoints through the SBAPI.
---
 lldb/source/Target/StopInfo.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lldb/source/Target/StopInfo.cpp b/lldb/source/Target/StopInfo.cpp
index f1272a723a8cb..6bdc467af6746 100644
--- a/lldb/source/Target/StopInfo.cpp
+++ b/lldb/source/Target/StopInfo.cpp
@@ -263,6 +263,14 @@ class StopInfoBreakpoint : public StopInfo {
     return bp_site_sp->GetSuggestedStackFrameIndex();
   }
 
+  bool ShouldShow() const override {
+    return !m_was_all_internal;
+  }
+
+  bool ShouldSelect() const override {
+    return !m_was_all_internal;
+  }
+
 protected:
   bool ShouldStop(Event *event_ptr) override {
     // This just reports the work done by PerformAction or the synchronous



More information about the lldb-commits mailing list