30 lines · python
1"""2Test lldb-dap stack trace response3"""4 5 6import dap_server7from lldbsuite.test.decorators import *8 9import lldbdap_testcase10from 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