mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
std.builtin.panic(uefi): also output to con_out
This commit is contained in:
parent
1fc42ed3e7
commit
c16aeda8a6
@ -830,10 +830,15 @@ pub fn default_panic(msg: []const u8, error_return_trace: ?*StackTrace, ret_addr
|
|||||||
const exit_data = ExitData.create_exit_data(msg, &exit_size) catch null;
|
const exit_data = ExitData.create_exit_data(msg, &exit_size) catch null;
|
||||||
|
|
||||||
if (exit_data) |data| {
|
if (exit_data) |data| {
|
||||||
if (uefi.system_table.std_err) |out| {
|
// Output to both std_err and con_out, as std_err is easier
|
||||||
_ = out.setAttribute(uefi.protocol.SimpleTextOutput.red);
|
// to read in stuff like QEMU at times, but, unlike con_out,
|
||||||
_ = out.outputString(data);
|
// isn't visible on actual hardware if directly booted into
|
||||||
_ = out.setAttribute(uefi.protocol.SimpleTextOutput.white);
|
inline for ([_]?*uefi.protocol.SimpleTextOutput{ uefi.system_table.std_err, uefi.system_table.con_out }) |o| {
|
||||||
|
if (o) |out| {
|
||||||
|
_ = out.setAttribute(uefi.protocol.SimpleTextOutput.red);
|
||||||
|
_ = out.outputString(data);
|
||||||
|
_ = out.setAttribute(uefi.protocol.SimpleTextOutput.white);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user