File tree Expand file tree Collapse file tree 3 files changed +8
-15
lines changed
test/API/tools/lldb-dap/stackTraceCompilerGeneratedCode Expand file tree Collapse file tree 3 files changed +8
-15
lines changed Original file line number Diff line number Diff line change 1010
1111
1212class TestDAP_stackTraceCompilerGeneratedCode (lldbdap_testcase .DAPTestCaseBase ):
13- @skipIfWindows
1413 def test_non_leaf_frame_compiler_generate_code (self ):
1514 """
1615 Test that non-leaf frames with compiler-generated code are properly resolved.
@@ -65,3 +64,4 @@ def test_non_leaf_frame_compiler_generate_code(self):
6564 # Verify that this didn't happen - the path should be a real file path.
6665 foo_path = foo_frame .get ("source" , {}).get ("path" )
6766 self .assertNotIn ("`" , foo_path , "Expected foo source path to not contain `" )
67+ self .continue_to_exit ()
Original file line number Diff line number Diff line change @@ -4,14 +4,16 @@ void bar() {
44
55void at_line_zero () {}
66
7+ int foo ();
8+
9+ int main (int argc , char const * argv []) {
10+ foo ();
11+ return 0 ;
12+ }
13+
714int foo () {
815 bar (); // foo call bar
916#line 0 "test.cpp"
1017 at_line_zero ();
1118 return 0 ;
1219}
13-
14- int main (int argc , char const * argv []) {
15- foo ();
16- return 0 ;
17- }
Original file line number Diff line number Diff line change @@ -657,15 +657,6 @@ std::optional<protocol::Source> DAP::ResolveSource(const lldb::SBFrame &frame) {
657657 if (!frame.IsValid ())
658658 return std::nullopt ;
659659
660- // IMPORTANT: Get line entry from symbol context, NOT from PC address.
661- // When a frame's PC points to a return address (the instruction
662- // after a call), that address may have line number 0 for compiler generated
663- // code.
664- //
665- // EXAMPLE: If PC is at 0x1004 (frame return address after the call
666- // instruction) with no line info, but 0x1003 (in the middle of previous call
667- // instruction) is at line 42, symbol context returns line 42.
668-
669660 const lldb::SBLineEntry frame_line_entry = frame.GetLineEntry ();
670661 if (DisplayAssemblySource (debugger, frame_line_entry)) {
671662 const lldb::SBAddress frame_pc = frame.GetPCAddress ();
You can’t perform that action at this time.
0 commit comments