xref: /llvm-project/lldb/test/API/tools/lldb-dap/stackTrace/subtleFrames/TestDAP_subtleFrames.py (revision 9e9e8238df63b9f10c6635d3f16d8a0fbc7f00c4)
1"""
2Test lldb-dap stack trace response
3"""
4
5
6import dap_server
7from lldbsuite.test.decorators import *
8
9import lldbdap_testcase
10from lldbsuite.test.lldbtest import *
11
12
13class TestDAP_subtleFrames(lldbdap_testcase.DAPTestCaseBase):
14    @add_test_categories(["libc++"])
15    def test_subtleFrames(self):
16        """
17        Internal stack frames (such as the ones used by `std::function`) are marked as "subtle".
18        """
19        program = self.getBuildArtifact("a.out")
20        self.build_and_launch(program)
21        source = "main.cpp"
22        self.set_source_breakpoints(source, [line_number(source, "BREAK HERE")])
23        self.continue_to_next_stop()
24
25        frames = self.get_stackFrames()
26        for f in frames:
27            if "__function" in f["name"]:
28                self.assertEqual(f["presentationHint"], "subtle")
29        self.assertTrue(any(f.get("presentationHint") == "subtle" for f in frames))
30