aboutsummaryrefslogtreecommitdiff
path: root/src/link/Wasm.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2022-12-06 19:29:23 +0100
committerJakub Konka <kubkon@jakubkonka.com>2022-12-09 09:24:25 +0100
commitf5c764d8923d301bb7e46b50cb034285640fcca2 (patch)
treee573f5faca2995d766b56e1e001989a343ff08b3 /src/link/Wasm.zig
parent4c4821d9939447d65966b897a5780e39eb22334b (diff)
downloadzig-f5c764d8923d301bb7e46b50cb034285640fcca2.tar.gz
zig-f5c764d8923d301bb7e46b50cb034285640fcca2.zip
dwarf: track source files via *const Module.File pointers
Diffstat (limited to 'src/link/Wasm.zig')
-rw-r--r--src/link/Wasm.zig15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/link/Wasm.zig b/src/link/Wasm.zig
index 4a9db75c98..f8821d796f 100644
--- a/src/link/Wasm.zig
+++ b/src/link/Wasm.zig
@@ -361,7 +361,7 @@ pub fn openPath(allocator: Allocator, sub_path: []const u8, options: link.Option
}
if (!options.strip and options.module != null) {
- wasm_bin.dwarf = Dwarf.init(allocator, .wasm, options.target);
+ wasm_bin.dwarf = Dwarf.init(allocator, &wasm_bin.base, options.target);
try wasm_bin.initDebugSections();
}
@@ -910,7 +910,6 @@ pub fn updateFunc(wasm: *Wasm, mod: *Module, func: *Module.Fn, air: Air, livenes
if (wasm.dwarf) |*dwarf| {
try dwarf.commitDeclState(
- &wasm.base,
mod,
decl_index,
// Actual value will be written after relocation.
@@ -990,7 +989,7 @@ pub fn updateDeclLineNumber(wasm: *Wasm, mod: *Module, decl: *const Module.Decl)
defer wasm.base.allocator.free(decl_name);
log.debug("updateDeclLineNumber {s}{*}", .{ decl_name, decl });
- try dw.updateDeclLineNumber(&wasm.base, decl);
+ try dw.updateDeclLineNumber(decl);
}
}
@@ -2299,7 +2298,7 @@ pub fn flushModule(wasm: *Wasm, comp: *Compilation, prog_node: *std.Progress.Nod
}
if (wasm.dwarf) |*dwarf| {
- try dwarf.flushModule(&wasm.base, wasm.base.options.module.?);
+ try dwarf.flushModule(wasm.base.options.module.?);
}
}
@@ -2668,12 +2667,12 @@ pub fn flushModule(wasm: *Wasm, comp: *Compilation, prog_node: *std.Progress.Nod
if (!wasm.base.options.strip) {
if (wasm.dwarf) |*dwarf| {
const mod = wasm.base.options.module.?;
- try dwarf.writeDbgAbbrev(&wasm.base);
+ try dwarf.writeDbgAbbrev();
// for debug info and ranges, the address is always 0,
// as locations are always offsets relative to 'code' section.
- try dwarf.writeDbgInfoHeader(&wasm.base, mod, 0, code_section_size);
- try dwarf.writeDbgAranges(&wasm.base, 0, code_section_size);
- try dwarf.writeDbgLineHeader(&wasm.base, mod);
+ try dwarf.writeDbgInfoHeader(mod, 0, code_section_size);
+ try dwarf.writeDbgAranges(0, code_section_size);
+ try dwarf.writeDbgLineHeader(mod);
}
var debug_bytes = std.ArrayList(u8).init(wasm.base.allocator);