1 """Test breaking inside functions defined within a BSD archive file libfoo.a."""
5 from lldbsuite
.test
.decorators
import *
6 from lldbsuite
.test
.lldbtest
import *
7 from lldbsuite
.test
import lldbutil
10 class BSDArchivesTestCase(TestBase
):
12 """Break inside a() and b() defined within libfoo.a."""
15 exe
= self
.getBuildArtifact("a.out")
16 self
.runCmd("file " + exe
, CURRENT_EXECUTABLE_SET
)
18 # Break on a() and b() symbols
19 lldbutil
.run_break_set_by_symbol(self
, "a", sym_exact
=True)
20 lldbutil
.run_break_set_by_symbol(self
, "b", sym_exact
=True)
22 self
.runCmd("run", RUN_SUCCEEDED
)
24 # The stop reason of the thread should be breakpoint.
27 STOPPED_DUE_TO_BREAKPOINT
,
28 substrs
=["stopped", "stop reason = breakpoint"],
31 # Break at a(int) first.
33 "frame variable", VARIABLES_DISPLAYED_CORRECTLY
, substrs
=["(int) arg = 1"]
36 "frame variable __a_global",
37 VARIABLES_DISPLAYED_CORRECTLY
,
38 substrs
=["(int) __a_global = 1"],
41 # Continue the program, we should break at b(int) next.
42 self
.runCmd("continue")
45 STOPPED_DUE_TO_BREAKPOINT
,
46 substrs
=["stopped", "stop reason = breakpoint"],
49 "frame variable", VARIABLES_DISPLAYED_CORRECTLY
, substrs
=["(int) arg = 2"]
52 "frame variable __b_global",
53 VARIABLES_DISPLAYED_CORRECTLY
,
54 substrs
=["(int) __b_global = 2"],