File tree 4 files changed +48
-0
lines changed
test/API/tools/lldb-dap/stackTrace/subtleFrames 4 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ CXX_SOURCES := main.c
2
+
3
+ include Makefile.rules
Original file line number Diff line number Diff line change
1
+ """
2
+ Test lldb-dap stack trace response
3
+ """
4
+
5
+
6
+ import dap_server
7
+ from lldbsuite .test .decorators import *
8
+ import os
9
+
10
+ import lldbdap_testcase
11
+ from lldbsuite .test import lldbtest , lldbutil
12
+
13
+
14
+ class TestDAP_subtleFrames (lldbdap_testcase .DAPTestCaseBase ):
15
+ def test_subtleFrames (self ):
16
+ """
17
+ Test that internal stack frames (such as the ones used by `std::function`)
18
+ are marked as "subtle".
19
+ """
20
+ program = self .getBuildArtifact ("a.out" )
21
+ self .build_and_launch (program )
22
+ source = "main.cpp"
23
+ self .set_source_breakpoints (source , [line_number (source , "BREAK HERE" )])
24
+ self .continue_to_next_stop ()
25
+
26
+ backtrace = self .get_stackFrames ()[0 ]
27
+ for f in backtrace :
28
+ if "__function" in f ["name" ]:
29
+ self .assertEqual (f ["presentationHint" ], "subtle" )
Original file line number Diff line number Diff line change
1
+ #include < functional>
2
+ #include < iostream>
3
+
4
+ void greet () {
5
+ // BREAK HERE
6
+ std::cout << " Hello\n " ;
7
+ }
8
+
9
+ int main () {
10
+ std::function<void ()> func{greet};
11
+ func ();
12
+ return 0 ;
13
+ }
Original file line number Diff line number Diff line change @@ -763,6 +763,9 @@ llvm::json::Value CreateStackFrame(lldb::SBFrame &frame) {
763
763
object.try_emplace (" instructionPointerReference" , formatted_addr);
764
764
}
765
765
766
+ if (frame.IsArtificial () || frame.IsHidden ())
767
+ object.try_emplace (" presentationHint" , " subtle" );
768
+
766
769
return llvm::json::Value (std::move (object));
767
770
}
768
771
You can’t perform that action at this time.
0 commit comments