aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2024-01-28 01:04:38 +0200
committerVeikka Tuominen <git@vexu.eu>2024-02-01 15:22:36 +0200
commita4f27e8987ef3e2388839b6452b9f485ab82e7b7 (patch)
tree6420c218896c0f44dea7353b8a9c00b01461c2ec /lib/std/debug.zig
parentb0bea72588c685c1d6439f61d2e842756b5fc496 (diff)
downloadzig-a4f27e8987ef3e2388839b6452b9f485ab82e7b7.tar.gz
zig-a4f27e8987ef3e2388839b6452b9f485ab82e7b7.zip
remove std.io.Mode
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index 5976e52684..216b1b20e6 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -1141,8 +1141,8 @@ pub fn readElfDebugInfo(
) !ModuleDebugInfo {
nosuspend {
const elf_file = (if (elf_filename) |filename| blk: {
- break :blk fs.cwd().openFile(filename, .{ .intended_io_mode = .blocking });
- } else fs.openSelfExe(.{ .intended_io_mode = .blocking })) catch |err| switch (err) {
+ break :blk fs.cwd().openFile(filename, .{});
+ } else fs.openSelfExe(.{})) catch |err| switch (err) {
error.FileNotFound => return error.MissingDebugInfo,
else => return err,
};
@@ -1452,7 +1452,7 @@ fn readMachODebugInfo(allocator: mem.Allocator, macho_file: File) !ModuleDebugIn
fn printLineFromFileAnyOs(out_stream: anytype, line_info: LineInfo) !void {
// Need this to always block even in async I/O mode, because this could potentially
// be called from e.g. the event loop code crashing.
- var f = try fs.cwd().openFile(line_info.file_name, .{ .intended_io_mode = .blocking });
+ var f = try fs.cwd().openFile(line_info.file_name, .{});
defer f.close();
// TODO fstat and make sure that the file has the correct size
@@ -1640,7 +1640,6 @@ const MachoSymbol = struct {
}
};
-/// `file` is expected to have been opened with .intended_io_mode == .blocking.
/// Takes ownership of file, even on error.
/// TODO it's weird to take ownership even on error, rework this code.
fn mapWholeFile(file: File) ![]align(mem.page_size) const u8 {
@@ -1824,9 +1823,7 @@ pub const DebugInfo = struct {
errdefer self.allocator.destroy(obj_di);
const macho_path = mem.sliceTo(std.c._dyld_get_image_name(i), 0);
- const macho_file = fs.cwd().openFile(macho_path, .{
- .intended_io_mode = .blocking,
- }) catch |err| switch (err) {
+ const macho_file = fs.cwd().openFile(macho_path, .{}) catch |err| switch (err) {
error.FileNotFound => return error.MissingDebugInfo,
else => return err,
};
@@ -2162,7 +2159,7 @@ pub const ModuleDebugInfo = switch (native_os) {
}
fn loadOFile(self: *@This(), allocator: mem.Allocator, o_file_path: []const u8) !*OFileInfo {
- const o_file = try fs.cwd().openFile(o_file_path, .{ .intended_io_mode = .blocking });
+ const o_file = try fs.cwd().openFile(o_file_path, .{});
const mapped_mem = try mapWholeFile(o_file);
const hdr: *const macho.mach_header_64 = @ptrCast(@alignCast(mapped_mem.ptr));