zig icon indicating copy to clipboard operation
zig copied to clipboard

Self hosted compiler produces worse debug info for parameters

Open Vexu opened this issue 3 years ago • 0 comments

// test.zig
pub fn main() void {
    foo(12, 23.5, .foo, "true");
}
fn foo(a: u32, b: f64, c: enum {foo, bar}, d: []const u8) void {
    _ = a; _ = b; _ = c; _ = d;
}

stage1:

$ zig build-exe test.zig
$ gdb ./test -ex 'b foo' -ex r
Breakpoint 1, foo (a=12, b=23.5, c=foo, d=...) at test.zig:5
4       fn foo(a: u32, b: f64, c: enum {foo, bar}, d: []const u8) void {

stage2:

$ zig2 build-exe test.zig
$ gdb ./test -ex 'b test.foo'
Breakpoint 1, test.foo () at test.zig:6
5           _ = a; _ = b; _ = c; _ = d;

stage3 has the same output as stage2.

Vexu avatar Jul 27 '22 15:07 Vexu