mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-12-13 13:02:58 +01:00
mzteinit: print ERT
This commit is contained in:
parent
21b6392a13
commit
5b4585e820
2 changed files with 20 additions and 1 deletions
|
@ -42,6 +42,26 @@ pub fn main() void {
|
|||
|
||||
tryMain() catch |e| {
|
||||
std.log.err("FATAL ERROR: {}", .{e});
|
||||
if (@errorReturnTrace()) |trace| {
|
||||
var buf: [1024 * 8]u8 = undefined;
|
||||
const trace_s = s: {
|
||||
const deb_inf = std.debug.getSelfDebugInfo() catch break :s null;
|
||||
|
||||
var fbs = std.io.fixedBufferStream(&buf);
|
||||
std.debug.writeStackTrace(
|
||||
trace.*,
|
||||
fbs.writer(),
|
||||
std.heap.page_allocator,
|
||||
deb_inf,
|
||||
.no_color,
|
||||
) catch break :s null;
|
||||
break :s fbs.getWritten();
|
||||
};
|
||||
|
||||
if (trace_s) |s| {
|
||||
std.log.err("ERT: {s}", .{s});
|
||||
}
|
||||
}
|
||||
std.debug.print("Encountered fatal error (check log), starting emergency shell!\n", .{});
|
||||
|
||||
@panic(@errorName(std.os.execveZ(
|
||||
|
|
|
@ -7,4 +7,3 @@ pub fn Mutex(comptime T: type) type {
|
|||
mtx: std.Thread.Mutex = .{},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue