aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-04-24 19:14:54 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-04-26 20:56:21 -0700
commit396bd51c4818752f6309ff10f2d316f41598d5cd (patch)
tree452bc2f332c7a3ee6ab9d0274582b4b9da6800d6 /lib/std/debug.zig
parentafbcad9939169f0b9b9b8ecb287718023c58b428 (diff)
downloadzig-396bd51c4818752f6309ff10f2d316f41598d5cd.tar.gz
zig-396bd51c4818752f6309ff10f2d316f41598d5cd.zip
enable debugging infrastructure when using C backend
Thanks to @jacobly0's recent enhancements to the C backend, this stuff works now.
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig14
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index c965dd6436..fc8b55a888 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -1360,13 +1360,7 @@ pub const DebugInfo = struct {
}
pub fn getModuleForAddress(self: *DebugInfo, address: usize) !*ModuleDebugInfo {
- if (builtin.zig_backend == .stage2_c) {
- return @as(error{
- InvalidDebugInfo,
- MissingDebugInfo,
- UnsupportedBackend,
- }, error.UnsupportedBackend);
- } else if (comptime builtin.target.isDarwin()) {
+ if (comptime builtin.target.isDarwin()) {
return self.lookupModuleDyld(address);
} else if (native_os == .windows) {
return self.lookupModuleWin32(address);
@@ -1380,9 +1374,7 @@ pub const DebugInfo = struct {
}
pub fn getModuleNameForAddress(self: *DebugInfo, address: usize) ?[]const u8 {
- if (builtin.zig_backend == .stage2_c) {
- return null;
- } else if (comptime builtin.target.isDarwin()) {
+ if (comptime builtin.target.isDarwin()) {
return null;
} else if (native_os == .windows) {
return self.lookupModuleNameWin32(address);
@@ -2191,8 +2183,6 @@ pub fn dumpStackPointerAddr(prefix: []const u8) void {
}
test "manage resources correctly" {
- if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // error.UnsupportedBackend
-
if (builtin.os.tag == .wasi) return error.SkipZigTest;
if (builtin.os.tag == .windows and builtin.cpu.arch == .x86_64) {