Add line-level debug info (#4247)

Seems to work with lldb ( https://pastebin.com/igKkNECm ), though gdb
has /some/ trouble with the paths (they aren't complete - just using the
filename directly, not providing the working directory - might be some
quick hacks that can help there).
This commit is contained in:
David Blaikie
2024-08-26 15:49:31 +00:00
committed by GitHub
parent 5d73743971
commit 0ae2a3907e
104 changed files with 1586 additions and 1009 deletions
+8 -5
View File
@@ -31,13 +31,13 @@ fn Call(a: A*) -> A* {
// CHECK:STDOUT:
// CHECK:STDOUT: define ptr @Get(ptr %self) !dbg !4 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: ret ptr %self
// CHECK:STDOUT: ret ptr %self, !dbg !7
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: define ptr @Call(ptr %a) !dbg !7 {
// CHECK:STDOUT: define ptr @Call(ptr %a) !dbg !8 {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %Get.call = call ptr @Get(ptr %a)
// CHECK:STDOUT: ret ptr %Get.call
// CHECK:STDOUT: %Get.call = call ptr @Get(ptr %a), !dbg !9
// CHECK:STDOUT: ret ptr %Get.call, !dbg !10
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1}
@@ -50,4 +50,7 @@ fn Call(a: A*) -> A* {
// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "Get", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !5 = !DISubroutineType(types: !6)
// CHECK:STDOUT: !6 = !{}
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "Call", scope: null, file: !3, line: 25, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !7 = !DILocation(line: 20, column: 7, scope: !4)
// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "Call", scope: null, file: !3, line: 25, type: !5, spFlags: DISPFlagDefinition, unit: !2)
// CHECK:STDOUT: !9 = !DILocation(line: 26, column: 10, scope: !8)
// CHECK:STDOUT: !10 = !DILocation(line: 26, column: 3, scope: !8)