Skip to content

Self hosted compiler produces worse debug info for parameters #12257

@Vexu

Description

@Vexu
// 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorfrontendTokenization, parsing, AstGen, Sema, and Liveness.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions