1"""
2Test SBprocess and SBThread APIs with printing of the stack traces using lldbutil.
3"""
4
5
6
7import lldb
8from lldbsuite.test.decorators import *
9from lldbsuite.test.lldbtest import *
10from lldbsuite.test import lldbutil
11
12
13class ThreadsStackTracesTestCase(TestBase):
14
15    def test_stack_traces(self):
16        """Test SBprocess and SBThread APIs with printing of the stack traces."""
17        self.build()
18        (_, process, _, _) = lldbutil.run_to_source_breakpoint(self,
19                "// BREAK HERE", lldb.SBFileSpec("main.cpp"))
20        stacktraces = lldbutil.print_stacktraces(process, string_buffer=True)
21        self.expect(stacktraces, exe=False,
22                    substrs=['(int)x=4', '(int)y=6', '(int)x=3', '(int)argc=1'])
23