Skip to content
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

Fix flake in TestZerothFrame.py #96685

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,28 @@ def test(self):
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)

bp1_line = line_number("main.c", "// Set breakpoint 1 here")
bp2_line = line_number("main.c", "// Set breakpoint 2 here")

lldbutil.run_break_set_by_file_and_line(
self, "main.c", bp1_line, num_expected_locations=1
main_dot_c = lldb.SBFileSpec("main.c")
bp1 = target.BreakpointCreateBySourceRegex(
"// Set breakpoint 1 here", main_dot_c
)
lldbutil.run_break_set_by_file_and_line(
self, "main.c", bp2_line, num_expected_locations=1
bp2 = target.BreakpointCreateBySourceRegex(
"// Set breakpoint 2 here", main_dot_c
)

process = target.LaunchSimple(None, None, self.get_process_working_directory())
self.assertTrue(process, VALID_PROCESS)

thread = process.GetThreadAtIndex(0)
thread = self.thread()

if self.TraceOn():
print("Backtrace at the first breakpoint:")
for f in thread.frames:
print(f)

# Check that we have stopped at correct breakpoint.
self.assertEqual(
process.GetThreadAtIndex(0).frame[0].GetLineEntry().GetLine(),
bp1_line,
thread.frame[0].GetLineEntry().GetLine(),
bp1.GetLocationAtIndex(0).GetAddress().GetLineEntry().GetLine(),
"LLDB reported incorrect line number.",
)

Expand All @@ -70,15 +70,14 @@ def test(self):
# 'continue' command.
process.Continue()

thread = process.GetThreadAtIndex(0)
if self.TraceOn():
print("Backtrace at the second breakpoint:")
for f in thread.frames:
print(f)
# Check that we have stopped at the breakpoint
self.assertEqual(
thread.frame[0].GetLineEntry().GetLine(),
bp2_line,
bp2.GetLocationAtIndex(0).GetAddress().GetLineEntry().GetLine(),
"LLDB reported incorrect line number.",
)
# Double-check with GetPCAddress()
Expand Down
Loading