mirror of
https://github.com/ziglang/zig.git
synced 2026-02-19 07:48:31 +00:00
fix debug builds of WASI
This commit is contained in:
parent
fda7e0bb01
commit
abf959a0c9
@ -4531,7 +4531,7 @@ const mem = std.mem;
|
||||
test "cast *[1][*]const u8 to [*]const ?[*]const u8" {
|
||||
const window_name = [1][*]const u8{c"window name"};
|
||||
const x: [*]const ?[*]const u8 = &window_name;
|
||||
assert(mem.eql(u8, std.cstr.toSliceConst(x[0].?), "window name"));
|
||||
assert(mem.eql(u8, std.mem.toSliceConst(u8, x[0].?), "window name"));
|
||||
}
|
||||
{#code_end#}
|
||||
{#header_close#}
|
||||
|
||||
@ -85,6 +85,10 @@ fn wantTtyColor() bool {
|
||||
/// TODO multithreaded awareness
|
||||
pub fn dumpCurrentStackTrace(start_addr: ?usize) void {
|
||||
const stderr = getStderrStream() catch return;
|
||||
if (os.wasi.is_the_target) {
|
||||
stderr.print("Unable to dump stack trace: unimplemented on WASI\n") catch return;
|
||||
return;
|
||||
}
|
||||
const debug_info = getSelfDebugInfo() catch |err| {
|
||||
stderr.print("Unable to dump stack trace: Unable to open debug info: {}\n", @errorName(err)) catch return;
|
||||
return;
|
||||
@ -147,6 +151,10 @@ pub fn captureStackTrace(first_address: ?usize, stack_trace: *builtin.StackTrace
|
||||
/// TODO multithreaded awareness
|
||||
pub fn dumpStackTrace(stack_trace: builtin.StackTrace) void {
|
||||
const stderr = getStderrStream() catch return;
|
||||
if (os.wasi.is_the_target) {
|
||||
stderr.print("Unable to dump stack trace: unimplemented on WASI\n") catch return;
|
||||
return;
|
||||
}
|
||||
const debug_info = getSelfDebugInfo() catch |err| {
|
||||
stderr.print("Unable to dump stack trace: Unable to open debug info: {}\n", @errorName(err)) catch return;
|
||||
return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user