aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorLuuk de Gram <luuk@degram.dev>2022-04-18 13:11:37 +0200
committerLuuk de Gram <luuk@degram.dev>2022-04-18 13:11:37 +0200
commit2193f7c4a2b56f67bf07d27c3f715cf3969c392f (patch)
tree94ccfd7887dc5ac6d5d213eb34c4f6553b2b9938 /lib/std/debug.zig
parentf8d2b87fa122a948e2c8e1056e2ec4cfd4cf01bf (diff)
downloadzig-2193f7c4a2b56f67bf07d27c3f715cf3969c392f.tar.gz
zig-2193f7c4a2b56f67bf07d27c3f715cf3969c392f.zip
wasm: Add support for debug info
This implements basic DWARF output when building for the wasm target. Stacktraces, however, are currently not supported.
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index e00c0a21a2..6a0d4dac93 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -114,6 +114,10 @@ pub fn detectTTYConfig() TTY.Config {
pub fn dumpCurrentStackTrace(start_addr: ?usize) void {
nosuspend {
const stderr = io.getStdErr().writer();
+ if (comptime builtin.target.isWasm()) {
+ stderr.print("Unable to dump stack trace: not implemented for Wasm\n", .{}) catch return;
+ return;
+ }
if (builtin.strip_debug_info) {
stderr.print("Unable to dump stack trace: debug info stripped\n", .{}) catch return;
return;