aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorVexu <git@vexu.eu>2020-06-04 13:11:23 +0300
committerVexu <git@vexu.eu>2020-06-04 13:11:23 +0300
commitfd067fbe8b14c445ed764da15fff5163156126df (patch)
tree6169e491a273718743df7bc988e1eaae8d2945bd /lib/std/debug.zig
parent6524a64bda71a2eed9a3160562fd6da7232f9720 (diff)
downloadzig-fd067fbe8b14c445ed764da15fff5163156126df.tar.gz
zig-fd067fbe8b14c445ed764da15fff5163156126df.zip
add workaround for #5525
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index bf82dab49c..0e234ab419 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -1295,10 +1295,13 @@ pub const DebugInfo = struct {
const obj_di = try self.allocator.create(ModuleDebugInfo);
errdefer self.allocator.destroy(obj_di);
- const elf_file = (if (ctx.name.len > 0)
+ // TODO https://github.com/ziglang/zig/issues/5525
+ const copy = if (ctx.name.len > 0)
fs.cwd().openFile(ctx.name, .{ .intended_io_mode = .blocking })
else
- fs.openSelfExe(.{ .intended_io_mode = .blocking })) catch |err| switch (err) {
+ fs.openSelfExe(.{ .intended_io_mode = .blocking });
+
+ const elf_file = copy catch |err| switch (err) {
error.FileNotFound => return error.MissingDebugInfo,
else => return err,
};