diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2023-10-04 19:22:52 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2023-10-05 00:19:25 -0400 |
| commit | b4427bc300cd768721891e6747e59102c8cb06fc (patch) | |
| tree | 6224f3695774579ca783e92f0c49b8f4b54f334d /src/codegen.zig | |
| parent | 5a35734a48fddec7fa58a10be01b045c49099145 (diff) | |
| download | zig-b4427bc300cd768721891e6747e59102c8cb06fc.tar.gz zig-b4427bc300cd768721891e6747e59102c8cb06fc.zip | |
plan9: refactor debug info
The main goal is to stop depending on `emit.lower.target`.
Diffstat (limited to 'src/codegen.zig')
| -rw-r--r-- | src/codegen.zig | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/src/codegen.zig b/src/codegen.zig index dd1b6e0cbf..2c5fd7b630 100644 --- a/src/codegen.zig +++ b/src/codegen.zig @@ -40,28 +40,7 @@ pub const CodeGenError = error{ pub const DebugInfoOutput = union(enum) { dwarf: *link.File.Dwarf.DeclState, - /// the plan9 debuginfo output is a bytecode with 4 opcodes - /// assume all numbers/variables are bytes - /// 0 w x y z -> interpret w x y z as a big-endian i32, and add it to the line offset - /// x when x < 65 -> add x to line offset - /// x when x < 129 -> subtract 64 from x and subtract it from the line offset - /// x -> subtract 129 from x, multiply it by the quanta of the instruction size - /// (1 on x86_64), and add it to the pc - /// after every opcode, add the quanta of the instruction size to the pc - plan9: struct { - /// the actual opcodes - dbg_line: *std.ArrayList(u8), - /// what line the debuginfo starts on - /// this helps because the linker might have to insert some opcodes to make sure that the line count starts at the right amount for the next decl - start_line: *?u32, - /// what the line count ends on after codegen - /// this helps because the linker might have to insert some opcodes to make sure that the line count starts at the right amount for the next decl - end_line: *u32, - /// the last pc change op - /// This is very useful for adding quanta - /// to it if its not actually the last one. - pcop_change_index: *?u32, - }, + plan9: *link.File.Plan9.DebugInfoOutput, none, }; |
