Merge pull request #6481 from MasterQ32/stage1_error_return_trace

Adds error return trace printing to stage1
This commit is contained in:
Alexandros Naskos 2020-10-02 00:22:24 +03:00 committed by GitHub
commit 49c0cd6e8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,12 @@ pub export fn main(argc: c_int, argv: [*]const [*:0]const u8) c_int {
for (args) |*arg, i| {
arg.* = mem.spanZ(argv[i]);
}
stage2.mainArgs(gpa, arena, args) catch |err| fatal("{}", .{@errorName(err)});
stage2.mainArgs(gpa, arena, args) catch |err| {
if (@errorReturnTrace()) |trace| {
std.debug.dumpStackTrace(trace.*);
}
fatal("unhandled internal error: {}", .{@errorName(err)});
};
return 0;
}