authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-12-06 21:35:27+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-12-09 09:24:25+01:00
log6ec34edb9a2e45226bcedbae896ba2aa11b4ed7b
treebd99d358be06a2fe01272061d091398b0a4937dd
parentf5c764d8923d301bb7e46b50cb034285640fcca2

dwarf: fully resolve each path to each file source


1 files changed, 5 insertions(+), 3 deletions(-)

src/link/Dwarf.zig+5-3
......@@ -59,8 +59,10 @@ const DIFile = struct {
5959 file_source: *const Module.File,
6060 ref_count: u32,
6161
62 fn getFullPath(dif: DIFile, allocator: Allocator) ![]const u8 {
63 return dif.file_source.fullPath(allocator);
62 fn getFullyResolvedPath(dif: DIFile, allocator: Allocator) ![]const u8 {
63 const path = try dif.file_source.fullPath(allocator);
64 defer allocator.free(path);
65 return fs.realpathAlloc(allocator, path);
6466 }
6567};
6668
......@@ -2358,7 +2360,7 @@ pub fn writeDbgLineHeader(self: *Dwarf, module: *Module) !void {
23582360 });
23592361
23602362 for (self.di_files.items) |dif, i| {
2361 const full_path = try dif.getFullPath(self.allocator);
2363 const full_path = try dif.getFullyResolvedPath(self.allocator);
23622364 defer self.allocator.free(full_path);
23632365 log.debug("adding new file name at {d} of '{s}'", .{ i + 1, full_path });
23642366 di_buf.appendSliceAssumeCapacity(full_path);