| ... | ... | @@ -2587,12 +2587,17 @@ fn genIncludeDirsAndFileNames(self: *Dwarf, arena: Allocator) !struct { |
| 2587 | 2587 | |
| 2588 | 2588 | for (self.di_files.keys()) |dif| { |
| 2589 | 2589 | const full_path = try dif.mod.root.joinString(arena, dif.sub_file_path); |
| 2590 | | // TODO re-investigate if realpath is needed here |
| 2591 | 2590 | const dir_path = std.fs.path.dirname(full_path) orelse "."; |
| 2592 | 2591 | const sub_file_path = std.fs.path.basename(full_path); |
| 2592 | // TODO re-investigate if realpath is needed here |
| 2593 | var buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined; |
| 2594 | const resolved = if (!std.fs.path.isAbsolute(dir_path)) |
| 2595 | std.os.realpath(dir_path, &buffer) catch dir_path |
| 2596 | else |
| 2597 | dir_path; |
| 2593 | 2598 | |
| 2594 | 2599 | const dir_index: u28 = blk: { |
| 2595 | | const dirs_gop = dirs.getOrPutAssumeCapacity(dir_path); |
| 2600 | const dirs_gop = dirs.getOrPutAssumeCapacity(try arena.dupe(u8, resolved)); |
| 2596 | 2601 | break :blk @as(u28, @intCast(dirs_gop.index + 1)); |
| 2597 | 2602 | }; |
| 2598 | 2603 | |