From 2cc2eb1ec095d3ec210d780566977b3966412c03 Mon Sep 17 00:00:00 2001 From: lachsinc Date: Tue, 18 Sep 2018 18:10:03 +1000 Subject: [PATCH] Fix stepping/jumping between procedures/files. --- src/ir_print.cpp | 9 +++++++-- 1 file 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})");