aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-12-06 17:52:57 -0800
committerAndrew Kelley <andrew@ziglang.org>2025-12-23 22:15:08 -0800
commit8328de24f13e21e325207b19288a143854df50df (patch)
treeef7c9c46f969e31258a4c052c85f5a9ecfc34b80 /lib/std/debug
parentdd1d15b72aa3bae4b38e2337609758ffb7a7b55a (diff)
downloadzig-8328de24f13e21e325207b19288a143854df50df.tar.gz
zig-8328de24f13e21e325207b19288a143854df50df.zip
update all occurrences of openFile to receive an io instance
Diffstat (limited to 'lib/std/debug')
-rw-r--r--lib/std/debug/ElfFile.zig2
-rw-r--r--lib/std/debug/Info.zig2
-rw-r--r--lib/std/debug/MachOFile.zig2
-rw-r--r--lib/std/debug/SelfInfo/Elf.zig4
-rw-r--r--lib/std/debug/SelfInfo/MachO.zig2
-rw-r--r--lib/std/debug/SelfInfo/Windows.zig6
6 files changed, 9 insertions, 9 deletions
diff --git a/lib/std/debug/ElfFile.zig b/lib/std/debug/ElfFile.zig
index 5dbae18130..a0f1188ade 100644
--- a/lib/std/debug/ElfFile.zig
+++ b/lib/std/debug/ElfFile.zig
@@ -375,7 +375,7 @@ fn loadSeparateDebugFile(
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;
+ const elf_file = std.fs.cwd().openFile(io, path, .{}) catch return null;
defer elf_file.close(io);
const result = loadInner(arena, elf_file, opt_crc) catch |err| switch (err) {
diff --git a/lib/std/debug/Info.zig b/lib/std/debug/Info.zig
index da7656e626..6b31f03f72 100644
--- a/lib/std/debug/Info.zig
+++ b/lib/std/debug/Info.zig
@@ -39,7 +39,7 @@ pub fn load(
) LoadError!Info {
switch (format) {
.elf => {
- var file = try path.root_dir.handle.openFile(path.sub_path, .{});
+ var file = try path.root_dir.handle.openFile(io, path.sub_path, .{});
defer file.close(io);
var elf_file: ElfFile = try .load(gpa, file, null, &.none);
diff --git a/lib/std/debug/MachOFile.zig b/lib/std/debug/MachOFile.zig
index 3f0f620a90..ae904c0aec 100644
--- a/lib/std/debug/MachOFile.zig
+++ b/lib/std/debug/MachOFile.zig
@@ -512,7 +512,7 @@ fn loadOFile(gpa: Allocator, io: Io, o_file_name: []const u8) !OFile {
/// Uses `mmap` to map the file at `path` into memory.
fn mapDebugInfoFile(io: Io, path: []const u8) ![]align(std.heap.page_size_min) const u8 {
- const file = std.fs.cwd().openFile(path, .{}) catch |err| switch (err) {
+ const file = std.fs.cwd().openFile(io, path, .{}) catch |err| switch (err) {
error.FileNotFound => return error.MissingDebugInfo,
else => return error.ReadFailed,
};
diff --git a/lib/std/debug/SelfInfo/Elf.zig b/lib/std/debug/SelfInfo/Elf.zig
index 155dac6fb8..124768687c 100644
--- a/lib/std/debug/SelfInfo/Elf.zig
+++ b/lib/std/debug/SelfInfo/Elf.zig
@@ -325,7 +325,7 @@ const Module = struct {
}
fn loadElf(mod: *Module, gpa: Allocator, io: Io) Error!LoadedElf {
const load_result = if (mod.name.len > 0) res: {
- var file = std.fs.cwd().openFile(mod.name, .{}) catch return error.MissingDebugInfo;
+ var file = std.fs.cwd().openFile(io, mod.name, .{}) catch return error.MissingDebugInfo;
defer file.close(io);
break :res std.debug.ElfFile.load(gpa, file, mod.build_id, &.native(mod.name));
} else res: {
@@ -334,7 +334,7 @@ const Module = struct {
else => return error.ReadFailed,
};
defer gpa.free(path);
- var file = std.fs.cwd().openFile(path, .{}) catch return error.MissingDebugInfo;
+ var file = std.fs.cwd().openFile(io, path, .{}) catch return error.MissingDebugInfo;
defer file.close(io);
break :res std.debug.ElfFile.load(gpa, file, mod.build_id, &.native(path));
};
diff --git a/lib/std/debug/SelfInfo/MachO.zig b/lib/std/debug/SelfInfo/MachO.zig
index 2491cf416c..15da616f3b 100644
--- a/lib/std/debug/SelfInfo/MachO.zig
+++ b/lib/std/debug/SelfInfo/MachO.zig
@@ -616,7 +616,7 @@ test {
/// Uses `mmap` to map the file at `path` into memory.
fn mapDebugInfoFile(io: Io, path: []const u8) ![]align(std.heap.page_size_min) const u8 {
- const file = std.fs.cwd().openFile(path, .{}) catch |err| switch (err) {
+ const file = std.fs.cwd().openFile(io, path, .{}) catch |err| switch (err) {
error.FileNotFound => return error.MissingDebugInfo,
else => return error.ReadFailed,
};
diff --git a/lib/std/debug/SelfInfo/Windows.zig b/lib/std/debug/SelfInfo/Windows.zig
index 3af7223293..c7f9d8c352 100644
--- a/lib/std/debug/SelfInfo/Windows.zig
+++ b/lib/std/debug/SelfInfo/Windows.zig
@@ -387,7 +387,7 @@ const Module = struct {
const section_view = section_view_ptr.?[0..coff_len];
coff_obj = coff.Coff.init(section_view, false) catch return error.InvalidDebugInfo;
break :mapped .{
- .file = .adaptFromNewApi(coff_file),
+ .file = coff_file,
.section_handle = section_handle,
.section_view = section_view,
};
@@ -432,7 +432,7 @@ const Module = struct {
break :pdb null;
};
const pdb_file_open_result = if (fs.path.isAbsolute(path)) res: {
- break :res std.fs.cwd().openFile(path, .{});
+ break :res std.fs.cwd().openFile(io, path, .{});
} else res: {
const self_dir = fs.selfExeDirPathAlloc(gpa) catch |err| switch (err) {
error.OutOfMemory, error.Unexpected => |e| return e,
@@ -441,7 +441,7 @@ const Module = struct {
defer gpa.free(self_dir);
const abs_path = try fs.path.join(gpa, &.{ self_dir, path });
defer gpa.free(abs_path);
- break :res std.fs.cwd().openFile(abs_path, .{});
+ break :res std.fs.cwd().openFile(io, abs_path, .{});
};
const pdb_file = pdb_file_open_result catch |err| switch (err) {
error.FileNotFound, error.IsDir => break :pdb null,