aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug/ElfFile.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-12-05 19:08:37 -0800
committerAndrew Kelley <andrew@ziglang.org>2025-12-23 22:15:07 -0800
commitaafddc2ea13e40a8262d9378aeca2e097a37ac03 (patch)
tree46770e51147a635a43c2e7356e62064466b51c34 /lib/std/debug/ElfFile.zig
parenteab354b2f5d7242c036523394023e9824be7eca9 (diff)
downloadzig-aafddc2ea13e40a8262d9378aeca2e097a37ac03.tar.gz
zig-aafddc2ea13e40a8262d9378aeca2e097a37ac03.zip
update all occurrences of close() to close(io)
Diffstat (limited to 'lib/std/debug/ElfFile.zig')
-rw-r--r--lib/std/debug/ElfFile.zig26
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/std/debug/ElfFile.zig b/lib/std/debug/ElfFile.zig
index e81943ab49..92bcca1bcf 100644
--- a/lib/std/debug/ElfFile.zig
+++ b/lib/std/debug/ElfFile.zig
@@ -1,5 +1,13 @@
//! A helper type for loading an ELF file and collecting its DWARF debug information, unwind
//! information, and symbol table.
+const ElfFile = @This();
+
+const std = @import("std");
+const Io = std.Io;
+const Endian = std.builtin.Endian;
+const Dwarf = std.debug.Dwarf;
+const Allocator = std.mem.Allocator;
+const elf = std.elf;
is_64: bool,
endian: Endian,
@@ -358,10 +366,17 @@ const Section = struct {
const Array = std.enums.EnumArray(Section.Id, ?Section);
};
-fn loadSeparateDebugFile(arena: Allocator, main_loaded: *LoadInnerResult, opt_crc: ?u32, comptime fmt: []const u8, args: anytype) Allocator.Error!?[]align(std.heap.page_size_min) const u8 {
+fn loadSeparateDebugFile(
+ arena: Allocator,
+ io: Io,
+ main_loaded: *LoadInnerResult,
+ opt_crc: ?u32,
+ comptime fmt: []const u8,
+ args: anytype,
+) Allocator.Error!?[]align(std.heap.page_size_min) const u8 {
const path = try std.fmt.allocPrint(arena, fmt, args);
const elf_file = std.fs.cwd().openFile(path, .{}) catch return null;
- defer elf_file.close();
+ defer elf_file.close(io);
const result = loadInner(arena, elf_file, opt_crc) catch |err| switch (err) {
error.OutOfMemory => |e| return e,
@@ -529,10 +544,3 @@ fn loadInner(
.mapped_mem = mapped_mem,
};
}
-
-const std = @import("std");
-const Endian = std.builtin.Endian;
-const Dwarf = std.debug.Dwarf;
-const ElfFile = @This();
-const Allocator = std.mem.Allocator;
-const elf = std.elf;