| ... | @@ -85,6 +85,10 @@ fn wantTtyColor() bool { | ... | @@ -85,6 +85,10 @@ fn wantTtyColor() bool { |
| 85 | /// TODO multithreaded awareness | 85 | /// TODO multithreaded awareness |
| 86 | pub fn dumpCurrentStackTrace(start_addr: ?usize) void { | 86 | pub fn dumpCurrentStackTrace(start_addr: ?usize) void { |
| 87 | const stderr = getStderrStream() catch return; | 87 | const stderr = getStderrStream() catch return; |
| | 88 | if (os.wasi.is_the_target) { |
| | 89 | stderr.print("Unable to dump stack trace: unimplemented on WASI\n") catch return; |
| | 90 | return; |
| | 91 | } |
| 88 | const debug_info = getSelfDebugInfo() catch |err| { | 92 | const debug_info = getSelfDebugInfo() catch |err| { |
| 89 | stderr.print("Unable to dump stack trace: Unable to open debug info: {}\n", @errorName(err)) catch return; | 93 | stderr.print("Unable to dump stack trace: Unable to open debug info: {}\n", @errorName(err)) catch return; |
| 90 | return; | 94 | return; |
| ... | @@ -147,6 +151,10 @@ pub fn captureStackTrace(first_address: ?usize, stack_trace: *builtin.StackTrace | ... | @@ -147,6 +151,10 @@ pub fn captureStackTrace(first_address: ?usize, stack_trace: *builtin.StackTrace |
| 147 | /// TODO multithreaded awareness | 151 | /// TODO multithreaded awareness |
| 148 | pub fn dumpStackTrace(stack_trace: builtin.StackTrace) void { | 152 | pub fn dumpStackTrace(stack_trace: builtin.StackTrace) void { |
| 149 | const stderr = getStderrStream() catch return; | 153 | const stderr = getStderrStream() catch return; |
| | 154 | if (os.wasi.is_the_target) { |
| | 155 | stderr.print("Unable to dump stack trace: unimplemented on WASI\n") catch return; |
| | 156 | return; |
| | 157 | } |
| 150 | const debug_info = getSelfDebugInfo() catch |err| { | 158 | const debug_info = getSelfDebugInfo() catch |err| { |
| 151 | stderr.print("Unable to dump stack trace: Unable to open debug info: {}\n", @errorName(err)) catch return; | 159 | stderr.print("Unable to dump stack trace: Unable to open debug info: {}\n", @errorName(err)) catch return; |
| 152 | return; | 160 | return; |