aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorlachsinc <lachlansinclair@gmail.com>2018-09-18 18:10:03 +1000
committerlachsinc <lachlansinclair@gmail.com>2018-09-18 18:10:03 +1000
commit2cc2eb1ec095d3ec210d780566977b3966412c03 (patch)
tree87da324611e1fcc805d25c487c1cbe66d70c0612 /src/ir_print.cpp
parent8a789e33b03e7842f36205cbb5a41c3a87134c77 (diff)
Fix stepping/jumping between procedures/files.
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index d77657222..54b60e510 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -1951,31 +1951,36 @@ void print_llvm_ir(irGen *ir) {
", globals: !0"
")",
file->id, LIT(build_context.ODIN_VERSION));
-
break;
}
case irDebugInfo_File:
+ // TODO(lachsinc): Does windows debug info expect '/' or '\5C' path separators ??
ir_fprintf(f, "!DIFile(filename: \""); ir_print_escape_path(f, di->File.filename);
ir_fprintf(f, "\", directory: \""); ir_print_escape_path(f, di->File.directory);
ir_fprintf(f, "\"");
ir_fprintf(f, ")");
break;
case irDebugInfo_Proc:
+ // TODO(lach): We need to store scope info inside di, not just file info, for procs.
ir_fprintf(f, "distinct !DISubprogram("
"name: \"%.*s\""
", linkageName: \"%.*s\""
+ ", scope: !%d"
", file: !%d"
", line: %td"
+ ", scopeLine: %td"
", isDefinition: true"
- ", isLocal: true"
+ ", isLocal: false" // TODO(lach): This used to be always set to true, pretend no local for now. We need to check if scope == file.
", flags: DIFlagPrototyped"
", isOptimized: false"
", unit: !%d"
", type: !DISubroutineType(types: !{",
LIT(di->Proc.entity->token.string),
LIT(di->Proc.name),
+ di->Proc.file->id, // TODO(lachsinc): HACK For now lets pretend all procs scope's == file.
di->Proc.file->id,
di->Proc.pos.line,
+ di->Proc.pos.line, // NOTE(lachsinc): Assume scopeLine always same as line.
m->debug_compile_unit->id);
if (di->Proc.return_types.count == 0) {
ir_fprintf(f, "null})");