34 lines · python
1"""2Test that breakpoints correctly work in an thumb function in an arbitrary3named codesection.4"""5 6 7import lldb8from lldbsuite.test.decorators import *9from lldbsuite.test.lldbtest import *10from lldbsuite.test import lldbutil11 12 13class TestBreakpointThumbCodesection(TestBase):14 @skipIf(archs=no_match(["arm$"]))15 @skipIf(archs=["arm64"])16 @skipIfDarwinEmbedded # codegen on darwin always defaults to thumb for armv7/armv7k targets17 def test_breakpoint(self):18 self.build()19 exe = self.getBuildArtifact("a.out")20 line = line_number("main.c", "// Set break point at this line.")21 22 self.runCmd("target create %s" % exe)23 bpid = lldbutil.run_break_set_by_file_and_line(self, "main.c", line)24 25 self.runCmd("run")26 27 self.assertIsNotNone(28 lldbutil.get_one_thread_stopped_at_breakpoint_id(self.process(), bpid),29 "Process is not stopped at breakpoint",30 )31 32 self.process().Continue()33 self.assertState(self.process().GetState(), lldb.eStateExited, PROCESS_EXITED)34