Skip to content

Commit 5805166

Browse files
Merge pull request #9958 from felipepiovezan/felipe/fix_swift_test
[lldb] Fix check in swift test
2 parents f0a1e84 + c53229d commit 5805166

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lldb/test/API/lang/swift/async/unwind/sayhello/TestSwiftAsyncUnwind.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
import lldbsuite.test.lldbtest as lldbtest
44
import lldbsuite.test.lldbutil as lldbutil
55

6+
def get_num_registers(frame):
7+
general_purpose_regs = frame.GetRegisters()[0]
8+
num_regs = sum(reg.GetError().Success() for reg in general_purpose_regs)
9+
return num_regs
610

711
class TestSwiftAsyncUnwind(lldbtest.TestBase):
812

@@ -29,8 +33,8 @@ def test(self):
2933
# Check that we can only get a limited number of registers for
3034
# frames that unwound with an AsyncContext, as a sanity check
3135
# to see that this is really the async unwinder.
32-
self.assertIn(thread.GetFrameAtIndex(1).GetRegisters().GetSize(), [2,3,4])
33-
self.assertIn(thread.GetFrameAtIndex(2).GetRegisters().GetSize(), [2,3,4])
36+
self.assertIn(get_num_registers(thread.GetFrameAtIndex(1)), [2,3,4])
37+
self.assertIn(get_num_registers(thread.GetFrameAtIndex(2)), [2,3,4])
3438

3539
# Delete the old breakpoint, otherwise it would be reached again.
3640
target.BreakpointDelete(bkpt.GetID())

0 commit comments

Comments
 (0)