-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Reapply "Fix error in unrecognized register name handling for "SBFram…e.register"" (#88468)" #88535
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,10 +73,12 @@ def test_get_arg_vals_for_call_stack(self): | |
gpr_reg_set = lldbutil.get_GPRs(frame) | ||
pc_value = gpr_reg_set.GetChildMemberWithName("pc") | ||
self.assertTrue(pc_value, "We should have a valid PC.") | ||
pc_value_int = int(pc_value.GetValue(), 0) | ||
|
||
|
||
# Make sure on arm targets we dont mismatch PC value on the basis of thumb bit. | ||
# Frame PC will not have thumb bit set in case of a thumb | ||
# instruction as PC. | ||
pc_value_int = int(pc_value.GetValue(), 0) | ||
if self.getArchitecture() in ["arm", "armv7", "armv7k"]: | ||
pc_value_int &= ~1 | ||
self.assertEqual( | ||
|
@@ -91,7 +93,17 @@ def test_get_arg_vals_for_call_stack(self): | |
frame.GetSP(), | ||
"SP gotten as a value should equal frame's GetSP", | ||
) | ||
|
||
# Test that the "register" property's flat list matches the list from | ||
# the "registers" property that returns register sets: | ||
register_regs = set() | ||
flattened_regs = set() | ||
for reg_set in frame.registers: | ||
for reg in reg_set: | ||
flattened_regs.add(reg.name) | ||
for reg in frame.register: | ||
register_regs.add(reg.name) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of iterating over it twice, why not combine into one loop? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Iterating over what twice? One is iterating over the elements of the list that is the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I see now. I definitely did not notice the difference between There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This PR is about fixing Adding |
||
self.assertEqual(register_regs, flattened_regs, "register matches registers") | ||
|
||
print("---", file=session) | ||
process.Continue() | ||
|
||
|
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.
The
range
expressions in this function can be simplified. Dropping the 0 means the list of numbers automatically starts at 0: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.
Unless there's some difference in behavior, I don't mind burning a few characters to make the range explicit.
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.
Fair, explicit is good. I meant it as a suggestion originally.