mirror of
https://github.com/ziglang/zig.git
synced 2025-02-12 23:50:18 +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;
|
||||
|
||||
if (exit_data) |data| {
|
||||
if (uefi.system_table.std_err) |out| {
|
||||
_ = out.setAttribute(uefi.protocol.SimpleTextOutput.red);
|
||||
_ = out.outputString(data);
|
||||
_ = out.setAttribute(uefi.protocol.SimpleTextOutput.white);
|
||||
// Output to both std_err and con_out, as std_err is easier
|
||||
// to read in stuff like QEMU at times, but, unlike con_out,
|
||||
// isn't visible on actual hardware if directly booted into
|
||||
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…
Reference in New Issue
Block a user