1 """Test breaking inside functions defined within a BSD archive file libfoo.a."""
6 from lldbsuite.test.decorators import *
7 from lldbsuite.test.lldbtest import *
8 from lldbsuite.test import lldbutil
11 class BSDArchivesTestCase(TestBase):
13 mydir = TestBase.compute_mydir(__file__)
17 bugnumber="llvm.org/pr24527. Makefile.rules doesn't know how to build static libs on Windows")
19 """Break inside a() and b() defined within libfoo.a."""
22 exe = self.getBuildArtifact("a.out")
23 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
25 # Break on a() and b() symbols
26 lldbutil.run_break_set_by_symbol(
27 self, "a", sym_exact=True)
28 lldbutil.run_break_set_by_symbol(
29 self, "b", sym_exact=True)
31 self.runCmd("run", RUN_SUCCEEDED)
33 # The stop reason of the thread should be breakpoint.
34 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
36 'stop reason = breakpoint'])
38 # Break at a(int) first.
39 self.expect("frame variable", VARIABLES_DISPLAYED_CORRECTLY,
40 substrs=['(int) arg = 1'])
41 self.expect("frame variable __a_global", VARIABLES_DISPLAYED_CORRECTLY,
42 substrs=['(int) __a_global = 1'])
44 # Continue the program, we should break at b(int) next.
45 self.runCmd("continue")
46 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
48 'stop reason = breakpoint'])
49 self.expect("frame variable", VARIABLES_DISPLAYED_CORRECTLY,
50 substrs=['(int) arg = 2'])
51 self.expect("frame variable __b_global", VARIABLES_DISPLAYED_CORRECTLY,
52 substrs=['(int) __b_global = 2'])