Skip to content

Commit af7c196

Browse files
[lldb][sbdebugger] Move SBDebugger Broadcast bit enum into lldb-enumerations.h (#87409)
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. Instead of trying to keep the bit offsets in sync between the two, it's preferable to just move SBDebugger's enum into the main enumerations header and use the bits from there. This also requires that API tests using the bits from SBDebugger update their usage.
1 parent fb771fe commit af7c196

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

lldb/include/lldb/API/SBDebugger.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@ class LLDB_API SBInputReader {
4242

4343
class LLDB_API SBDebugger {
4444
public:
45-
FLAGS_ANONYMOUS_ENUM(){
46-
eBroadcastBitProgress = (1 << 0),
47-
eBroadcastBitWarning = (1 << 1),
48-
eBroadcastBitError = (1 << 2),
49-
eBroadcastBitProgressCategory = (1 << 3),
50-
};
51-
5245
SBDebugger();
5346

5447
SBDebugger(const lldb::SBDebugger &rhs);

lldb/include/lldb/lldb-enumerations.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,14 @@ enum AddressMaskRange {
13391339
eAddressMaskRangeAll = eAddressMaskRangeAny,
13401340
};
13411341

1342+
/// Used by the debugger to indicate which events are being broadcasted.
1343+
enum DebuggerBroadcastBit {
1344+
eBroadcastBitProgress = (1 << 0),
1345+
eBroadcastBitWarning = (1 << 1),
1346+
eBroadcastBitError = (1 << 2),
1347+
eBroadcastBitProgressCategory = (1 << 3),
1348+
};
1349+
13421350
} // namespace lldb
13431351

13441352
#endif // LLDB_LLDB_ENUMERATIONS_H

lldb/test/API/functionalities/diagnostic_reporting/TestDiagnosticReporting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def setUp(self):
1515
self.broadcaster = self.dbg.GetBroadcaster()
1616
self.listener = lldbutil.start_listening_from(
1717
self.broadcaster,
18-
lldb.SBDebugger.eBroadcastBitWarning | lldb.SBDebugger.eBroadcastBitError,
18+
lldb.eBroadcastBitWarning | lldb.eBroadcastBitError,
1919
)
2020

2121
def test_dwarf_symbol_loading_diagnostic_report(self):

lldb/test/API/functionalities/progress_reporting/TestProgressReporting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def setUp(self):
1313
TestBase.setUp(self)
1414
self.broadcaster = self.dbg.GetBroadcaster()
1515
self.listener = lldbutil.start_listening_from(
16-
self.broadcaster, lldb.SBDebugger.eBroadcastBitProgress
16+
self.broadcaster, lldb.eBroadcastBitProgress
1717
)
1818

1919
def test_dwarf_symbol_loading_progress_report(self):

lldb/test/API/functionalities/progress_reporting/clang_modules/TestClangModuleBuildProgress.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_clang_module_build_progress_report(self):
3434
# other unrelated progress events.
3535
broadcaster = self.dbg.GetBroadcaster()
3636
listener = lldbutil.start_listening_from(
37-
broadcaster, lldb.SBDebugger.eBroadcastBitProgress
37+
broadcaster, lldb.eBroadcastBitProgress
3838
)
3939

4040
# Trigger module builds.

lldb/test/API/macosx/rosetta/TestRosetta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_rosetta(self):
4949
if rosetta_debugserver_installed():
5050
broadcaster = self.dbg.GetBroadcaster()
5151
listener = lldbutil.start_listening_from(
52-
broadcaster, lldb.SBDebugger.eBroadcastBitWarning
52+
broadcaster, lldb.eBroadcastBitWarning
5353
)
5454

5555
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(

0 commit comments

Comments
 (0)