From 0ec2376cae2fdfc50e90d930ebc86c7a5b7f5594 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 11 Nov 2026 20:08:00 -0300 Subject: trace: what push, call and ret touch; names for data; the stack's roles, sharper For a disassembly that points at the stack word it touched. The stack's own instructions have touches (push, call and enter write at rsp-8; pop and ret read at rsp; leave at rbp), and a rep string instruction its whole range. An address a global or static object holds is named (head+0, libc.so.6!main_arena+96). The saved rbp has its role at the push that makes it; every local in a shared word is given; the stack protector's copy is found by seeing its store; ztrace show labels each stack word. Six bytes a moment and 3% slower on the list by instruction. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa --- src/trace/Symbols.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/trace/Symbols.zig') diff --git a/src/trace/Symbols.zig b/src/trace/Symbols.zig index da13047..684dd95 100644 --- a/src/trace/Symbols.zig +++ b/src/trace/Symbols.zig @@ -271,6 +271,10 @@ pub fn refresh(s: *Symbols, pid: std.os.linux.pid_t) !Maps { mod.start = @min(mod.start, m.start); mod.end = @max(mod.end, m.end); } + // Its .bss past the file's last page is the anonymous mapping right after it. + for (s.maps.list) |m| if (m.start == mod.end and m.end > m.start and m.name.len == 0 and m.prot & 4 == 0) { + mod.end = m.end; + }; if (mod.end == 0) mod.start = 0; // unmapped since } return old; -- cgit v1.3