Debian Codegraph @

lldb/test/API/symbol_ondemand/breakpoint_source_regex/TestSourceTextRegexBreakpoint.py

raw
1 """
2 Test source text regex breakpoint hydrates module debug info
3 in symbol on-demand mode.
4 """
5
6
7 import lldb
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
11
12
13 class TestSourceTextRegexBreakpoint(TestBase):
14 @skipIfWindows
15 def test_with_run_command(self):
16 self.build()
17
18 # Load symbols on-demand
19 self.runCmd("settings set symbols.load-on-demand true")
20
21 self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
22
23 lldbutil.run_break_set_by_source_regexp(
24 self, "Set break point at this line.", extra_options="-f main.cpp"
25 )
26 self.runCmd("run", RUN_SUCCEEDED)
27
28 # The stop reason of the thread should be breakpoint.
29 self.expect(
30 "thread list",
31 STOPPED_DUE_TO_BREAKPOINT,
32 substrs=["stopped", "stop reason = breakpoint"],
33 )
34
35 frame = self.frame()
36 self.assertTrue(frame.IsValid())
37 self.assertEqual(frame.GetLineEntry().GetFileSpec().GetFilename(), "main.cpp")
38 self.assertEqual(frame.GetLineEntry().GetLine(), 4)