From d00cc100867bbb7a5e4305a5597cb45982c4593f Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 22 Aug 2025 18:30:21 -0700 Subject: std.debug: delete MemoryAccessor This API is based around the unsound idea that a process can perform checked virtual memory loads to prevent crashing. This depends on OS-specific APIs that may be unavailable, disabled, or impossible due to virtualization. It also makes collecting stack traces ridiculously slow, which is a problem for users of DebugAllocator - in other words, everybody, all the time. It also makes strace go from being superbly clean to being awful. --- lib/std/debug/Dwarf/expression.zig | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'lib/std/debug/Dwarf/expression.zig') diff --git a/lib/std/debug/Dwarf/expression.zig b/lib/std/debug/Dwarf/expression.zig index fcbb939171..c123cdb30b 100644 --- a/lib/std/debug/Dwarf/expression.zig +++ b/lib/std/debug/Dwarf/expression.zig @@ -15,8 +15,6 @@ const assert = std.debug.assert; pub const Context = struct { /// The dwarf format of the section this expression is in format: std.dwarf.Format = .@"32", - /// If specified, any addresses will pass through before being accessed - memory_accessor: ?*std.debug.MemoryAccessor = null, /// The compilation unit this expression relates to, if any compile_unit: ?*const std.debug.Dwarf.CompileUnit = null, /// When evaluating a user-presented expression, this is the address of the object being evaluated @@ -465,16 +463,6 @@ pub fn StackMachine(comptime options: Options) type { else => unreachable, }; - if (context.memory_accessor) |memory_accessor| { - if (!switch (size) { - 1 => memory_accessor.load(u8, addr) != null, - 2 => memory_accessor.load(u16, addr) != null, - 4 => memory_accessor.load(u32, addr) != null, - 8 => memory_accessor.load(u64, addr) != null, - else => return error.InvalidExpression, - }) return error.InvalidExpression; - } - const value: addr_type = std.math.cast(addr_type, @as(u64, switch (size) { 1 => @as(*const u8, @ptrFromInt(addr)).*, 2 => @as(*const u16, @ptrFromInt(addr)).*, -- cgit v1.2.3