-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[lldb][sbdebugger] Move SBDebugger Broadcast bit enum into lldb-enumerations.h #87409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lldb][sbdebugger] Move SBDebugger Broadcast bit enum into lldb-enumerations.h #87409
Conversation
efa26c8
to
88c6b49
Compare
✅ With the latest revision this PR passed the C/C++ code formatter. |
lldb/include/lldb/API/SBDebugger.h
Outdated
@@ -46,7 +46,8 @@ class LLDB_API SBDebugger { | |||
eBroadcastBitProgress = (1 << 0), | |||
eBroadcastBitWarning = (1 << 1), | |||
eBroadcastBitError = (1 << 2), | |||
eBroadcastBitProgressCategory = (1 << 3), | |||
eBroadcastBitProgressCategory = | |||
(1 << 4), // This needs to match the corresponding bit in Debugger.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move that comment above the enum.
88c6b49
to
b3ff6c7
Compare
lldb/include/lldb/API/SBDebugger.h
Outdated
@@ -46,7 +46,8 @@ class LLDB_API SBDebugger { | |||
eBroadcastBitProgress = (1 << 0), | |||
eBroadcastBitWarning = (1 << 1), | |||
eBroadcastBitError = (1 << 2), | |||
eBroadcastBitProgressCategory = (1 << 3), | |||
// This needs to match the corresponding bit in Debugger.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this comment apply to the whole enum? My suggestion was to move this above line 45 to convey that, unless that's not the case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake, I was indicating that the progress category bit is skipping (1 << 3)
in this sequence since that bit has to match the one in Debugger.h
. I can change the comment to say that the whole enum needs to match 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.
b3ff6c7
to
7561d03
Compare
@llvm/pr-subscribers-lldb Author: Chelsea Cassanova (chelcassanova) ChangesWhen the Full diff: https://github.com/llvm/llvm-project/pull/87409.diff 1 Files Affected:
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();
|
Why don't we just remove the enum from SBDebugger and use the one from Debugger instead, this will ensure the offsets are always the same. |
SBDebugger is public and Debugger is private, so I'm not sure how you can do this? Maybe I'm misunderstanding your suggestion... It would be nice if we could move the enum into |
Per Alex's suggestions, adds the broadcast bits from SBDebugger into lldb-enumerations.
lldb/include/lldb/API/SBDebugger.h
Outdated
// 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), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one can go now, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, will remove.
@@ -1339,6 +1339,14 @@ enum AddressMaskRange { | |||
eAddressMaskRangeAll = eAddressMaskRangeAny, | |||
}; | |||
|
|||
/// Used by the debugger to indicate which events are being broadcasted. | |||
enum DebuggerBroadcast { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DebuggerBroadcastBit
maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if you address the comment and rewrite the PR description and title :)
eBroadcastBitProgress = (1 << 0), | ||
eBroadcastBitWarning = (1 << 1), | ||
eBroadcastBitError = (1 << 2), | ||
eBroadcastBitProgressCategory = (1 << 4), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo ?
eBroadcastBitProgressCategory = (1 << 4), | |
eBroadcastBitProgressCategory = (1 << 3), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, I guess since this is in lldb-enumerations
it doesn't have to match the ones in Debugger.h anymore.
Removes the enum for broadcast bits from SBDebugger as they're now in lldb-enumerations.h. This also requires uses of these bits to be updated in some API tests.
3dc9c9f
to
39b05ff
Compare
llvm#87409 removed the broadcast bits from SBDebugger and placed them in `lldb-enumerations.h`. This is API-breaking so this commits places the enum back into `SBDebugger.h` and references the bits from `lldb-enumerations.h`.
llvm#87409 removed the broadcast bits from SBDebugger and placed them in `lldb-enumerations.h`. This is API-breaking so this commits places the enum back into `SBDebugger.h` and references the bits from `lldb-enumerations.h`.
#87409 removed the broadcast bits from SBDebugger and placed them in `lldb-enumerations.h`. This is API-breaking so this commits places the enum back into `SBDebugger.h` and references the bits from `lldb-enumerations.h`. rdar://127128536
llvm#87409 removed the broadcast bits from SBDebugger and placed them in `lldb-enumerations.h`. This is API-breaking so this commits places the enum back into `SBDebugger.h` and references the bits from `lldb-enumerations.h`. rdar://127128536 (cherry picked from commit a4c21d1)
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. SinceDebugger.h
has an enum bit thatSBDebugger.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.