diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-12-02 15:02:17 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-12-02 15:02:17 -0500 |
| commit | ad214c7aa00fc82b243eb38061f41588a0c58867 (patch) | |
| tree | ea2273fa1d318a167c15633d94d8e8a7fed1bc7d /lib/std/debug.zig | |
| parent | dcbd5ad1553c5994353de47babc0e07e02153bd8 (diff) | |
| download | zig-ad214c7aa00fc82b243eb38061f41588a0c58867.tar.gz zig-ad214c7aa00fc82b243eb38061f41588a0c58867.zip | |
bring your own OS layer in the std lib
closes #3784
Diffstat (limited to 'lib/std/debug.zig')
| -rw-r--r-- | lib/std/debug.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 711f728fa6..e31f847d79 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -796,6 +796,9 @@ pub const OpenSelfDebugInfoError = error{ pub fn openSelfDebugInfo(allocator: *mem.Allocator) !DebugInfo { if (builtin.strip_debug_info) return error.MissingDebugInfo; + if (@hasDecl(root, "os") and @hasDecl(root.os, "debug") and @hasDecl(root.os.debug, "openSelfDebugInfo")) { + return noasync root.os.debug.openSelfDebugInfo(allocator); + } if (builtin.os == .windows) { return noasync openSelfDebugInfoWindows(allocator); } @@ -1722,8 +1725,7 @@ pub const DebugInfo = switch (builtin.os) { sect_contribs: []pdb.SectionContribEntry, modules: []Module, }, - .linux, .freebsd, .netbsd, .dragonfly => DwarfInfo, - else => @compileError("Unsupported OS"), + else => DwarfInfo, }; const PcRange = struct { |
