Skip to content

Commit de0fac2

Browse files
author
Jeffrey Tan
committed
Address review feedback
1 parent 6f7f37f commit de0fac2

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

lldb/test/API/tools/lldb-dap/stackTraceCompilerGeneratedCode/TestDAP_stackTraceCompilerGeneratedCode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
class 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()

lldb/test/API/tools/lldb-dap/stackTraceCompilerGeneratedCode/main.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ void bar() {
44

55
void at_line_zero() {}
66

7+
int foo();
8+
9+
int main(int argc, char const *argv[]) {
10+
foo();
11+
return 0;
12+
}
13+
714
int 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-
}

lldb/tools/lldb-dap/DAP.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)