[Lldb-commits] [lldb] [lldb][sbdebugger] Match progress category enum bit in Debugger.h (PR #87409)

Chelsea Cassanova via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 8 16:41:33 PDT 2024


https://github.com/chelcassanova updated https://github.com/llvm/llvm-project/pull/87409

>From 7561d03d775822f789a61a5b827dfa04b29b57b2 Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova <chelsea_cassanova at apple.com>
Date: Tue, 2 Apr 2024 13:22:15 -0700
Subject: [PATCH 1/2] [lldb][sbdebugger] Match progress category enum bit in
 Debugger.h

When the `eBroadcastBitProgressCategory` bit was originally added to
Debugger.h and SBDebugger.h, each corresponding bit was added in order
of the other bits that were previously there. Since `Debugger.h` has an
enum bit that `SBDebugger.h` does not, this meant that their offsets did
not match. This commit changes it so that the bit offsets match each other.
---
 lldb/include/lldb/API/SBDebugger.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lldb/include/lldb/API/SBDebugger.h b/lldb/include/lldb/API/SBDebugger.h
index 62b2f91f5076d5..a994874dde6d4a 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -42,11 +42,13 @@ class LLDB_API SBInputReader {
 
 class LLDB_API SBDebugger {
 public:
+  // The enum values here need to match their corresponding values in
+  // Debugger.h.
   FLAGS_ANONYMOUS_ENUM(){
       eBroadcastBitProgress = (1 << 0),
       eBroadcastBitWarning = (1 << 1),
       eBroadcastBitError = (1 << 2),
-      eBroadcastBitProgressCategory = (1 << 3),
+      eBroadcastBitProgressCategory = (1 << 4),
   };
 
   SBDebugger();

>From a37c65dea5794e474e554f4b1762f0f630965afe Mon Sep 17 00:00:00 2001
From: Chelsea Cassanova <chelsea_cassanova at apple.com>
Date: Mon, 8 Apr 2024 16:39:41 -0700
Subject: [PATCH 2/2] Add SBDebugger broadcast bits to lldb-enumerations

Per Alex's suggestions, adds the broadcast bits from SBDebugger
into lldb-enumerations.
---
 lldb/include/lldb/lldb-enumerations.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h
index 646f7bfda98475..17f4125c50cced 100644
--- a/lldb/include/lldb/lldb-enumerations.h
+++ b/lldb/include/lldb/lldb-enumerations.h
@@ -1339,6 +1339,14 @@ enum AddressMaskRange {
   eAddressMaskRangeAll = eAddressMaskRangeAny,
 };
 
+/// Used by the debugger to indicate which events are being broadcasted.
+enum DebuggerBroadcast {
+  eBroadcastBitProgress = (1 << 0),
+  eBroadcastBitWarning = (1 << 1),
+  eBroadcastBitError = (1 << 2),
+  eBroadcastBitProgressCategory = (1 << 4),
+};
+
 } // namespace lldb
 
 #endif // LLDB_LLDB_ENUMERATIONS_H



More information about the lldb-commits mailing list