| ... | @@ -976,11 +976,7 @@ pub fn initDeclState(self: *Dwarf, mod: *Module, decl_index: Module.Decl.Index) | ... | @@ -976,11 +976,7 @@ pub fn initDeclState(self: *Dwarf, mod: *Module, decl_index: Module.Decl.Index) |
| 976 | // Once we support more than one source file, this will have the ability to be more | 976 | // Once we support more than one source file, this will have the ability to be more |
| 977 | // than one possible value. | 977 | // than one possible value. |
| 978 | const file_index = try self.addDIFile(mod, decl_index); | 978 | const file_index = try self.addDIFile(mod, decl_index); |
| 979 | leb128.writeUnsignedFixed( | 979 | leb128.writeUnsignedFixed(4, dbg_line_buffer.addManyAsArrayAssumeCapacity(4), file_index); |
| 980 | 4, | | |
| 981 | dbg_line_buffer.addManyAsArrayAssumeCapacity(4), | | |
| 982 | file_index + 1, | | |
| 983 | ); | | |
| 984 | | 980 | |
| 985 | // Emit a line for the begin curly with prologue_end=false. The codegen will | 981 | // Emit a line for the begin curly with prologue_end=false. The codegen will |
| 986 | // do the work of setting prologue_end=true and epilogue_begin=true. | 982 | // do the work of setting prologue_end=true and epilogue_begin=true. |
| ... | @@ -2370,7 +2366,7 @@ pub fn writeDbgLineHeader(self: *Dwarf, module: *Module) !void { | ... | @@ -2370,7 +2366,7 @@ pub fn writeDbgLineHeader(self: *Dwarf, module: *Module) !void { |
| 2370 | di_buf.appendSliceAssumeCapacity(file); | 2366 | di_buf.appendSliceAssumeCapacity(file); |
| 2371 | di_buf.appendSliceAssumeCapacity(&[_]u8{ | 2367 | di_buf.appendSliceAssumeCapacity(&[_]u8{ |
| 2372 | 0, // null byte for the relative path name | 2368 | 0, // null byte for the relative path name |
| 2373 | @intCast(u8, dir_index + 1), // directory_index | 2369 | @intCast(u8, dir_index), // directory_index |
| 2374 | 0, // mtime (TODO supply this) | 2370 | 0, // mtime (TODO supply this) |
| 2375 | 0, // file size bytes (TODO supply this) | 2371 | 0, // file size bytes (TODO supply this) |
| 2376 | }); | 2372 | }); |
| ... | @@ -2596,7 +2592,7 @@ fn addDIFile(self: *Dwarf, mod: *Module, decl_index: Module.Decl.Index) !u28 { | ... | @@ -2596,7 +2592,7 @@ fn addDIFile(self: *Dwarf, mod: *Module, decl_index: Module.Decl.Index) !u28 { |
| 2596 | else => unreachable, | 2592 | else => unreachable, |
| 2597 | } | 2593 | } |
| 2598 | } | 2594 | } |
| 2599 | return @intCast(u28, gop.index); | 2595 | return @intCast(u28, gop.index + 1); |
| 2600 | } | 2596 | } |
| 2601 | | 2597 | |
| 2602 | fn genIncludeDirsAndFileNames(self: *Dwarf, arena: Allocator, module: *Module) !struct { | 2598 | fn genIncludeDirsAndFileNames(self: *Dwarf, arena: Allocator, module: *Module) !struct { |
| ... | @@ -2626,7 +2622,7 @@ fn genIncludeDirsAndFileNames(self: *Dwarf, arena: Allocator, module: *Module) ! | ... | @@ -2626,7 +2622,7 @@ fn genIncludeDirsAndFileNames(self: *Dwarf, arena: Allocator, module: *Module) ! |
| 2626 | break :inner dir_path[comp_dir.len + 1 ..]; | 2622 | break :inner dir_path[comp_dir.len + 1 ..]; |
| 2627 | } else dir_path; | 2623 | } else dir_path; |
| 2628 | const dirs_gop = dirs.getOrPutAssumeCapacity(actual_dir_path); | 2624 | const dirs_gop = dirs.getOrPutAssumeCapacity(actual_dir_path); |
| 2629 | break :blk @intCast(u28, dirs_gop.index); | 2625 | break :blk @intCast(u28, dirs_gop.index + 1); |
| 2630 | }; | 2626 | }; |
| 2631 | | 2627 | |
| 2632 | files_dir_indexes.appendAssumeCapacity(dir_index); | 2628 | files_dir_indexes.appendAssumeCapacity(dir_index); |