aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug/Dwarf/expression.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-08-22 18:30:21 -0700
committerAndrew Kelley <andrew@ziglang.org>2025-08-23 13:48:52 -0700
commitd00cc100867bbb7a5e4305a5597cb45982c4593f (patch)
tree6c04d8c2d13a72d3a2117d6723494311d53018ed /lib/std/debug/Dwarf/expression.zig
parent77c09d16f9d992b19bc7cb2d2497f8009e0250ba (diff)
downloadzig-d00cc100867bbb7a5e4305a5597cb45982c4593f.tar.gz
zig-d00cc100867bbb7a5e4305a5597cb45982c4593f.zip
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.
Diffstat (limited to 'lib/std/debug/Dwarf/expression.zig')
-rw-r--r--lib/std/debug/Dwarf/expression.zig12
1 files changed, 0 insertions, 12 deletions
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)).*,