Dave Lee 8fa4b3d601
[lldb] Simplify some tests to run_to_source_breakpoint (NFC) (#190082)
Many tests have ad hoc forms of the launch & break steps done by
`lldbutil.run_to_source_breakpoint`. This changes some of those tests to
use `run_to_source_breakpoint` instead.

Assisted-by: claude
2026-04-02 15:20:49 -07:00

30 lines
895 B
Python

"""
Test to ensure SBFrame::Disassemble produces SOME output
"""
import lldb
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.lldbtest import *
class FrameDisassembleTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
def test_frame_disassemble(self):
"""Sample test to ensure SBFrame::Disassemble produces SOME output."""
self.build()
self.frame_disassemble_test()
def frame_disassemble_test(self):
"""Sample test to ensure SBFrame::Disassemble produces SOME output"""
_, _, thread, _ = lldbutil.run_to_source_breakpoint(
self, "Set a breakpoint here", lldb.SBFileSpec("main.cpp")
)
frame = thread.GetFrameAtIndex(0)
disassembly = frame.Disassemble()
self.assertNotEqual(disassembly, "")
self.assertNotIn("error", disassembly)
self.assertIn(": nop", disassembly)