diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-11 11:26:59 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-11 11:27:09 -0300 |
| commit | dcbe8941df205fa8c8805b022f025e1012dede19 (patch) | |
| tree | 9b4df7f904077c07eab979cb10aba9d6a3becf10 /src/trace/telescope.zig | |
| parent | 6142fa676731e158622ca7956c150c58bc57f1f2 (diff) | |
| download | computeranim-dcbe8941df205fa8c8805b022f025e1012dede19.tar.gz computeranim-dcbe8941df205fa8c8805b022f025e1012dede19.zip | |
symbols: a library's separate debug info, when it is of the same build
The system glibc stays dynamically linked and is symbolized from the
debug file in the debuginfod client's cache or under /usr/lib/debug,
used only when its own build id equals the mapped library's; nothing is
downloaded. Static functions get names (the loader's resolver is
_dl_runtime_resolve_xsavec; main_arena is found by symbol), libc's
frames their file and line as the build saw them, and locals, blocks and
parameter counts follow. A recording says of each module its build id
and where its names came from; ztrace show prints it. Read only when an
address in the module needs a name: 44 ms and 25 MB at the first one.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'src/trace/telescope.zig')
| -rw-r--r-- | src/trace/telescope.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/trace/telescope.zig b/src/trace/telescope.zig index 006bb22..f7e4a3d 100644 --- a/src/trace/telescope.zig +++ b/src/trace/telescope.zig @@ -359,6 +359,16 @@ pub fn shadow(m: Moment, addr: u64) !?struct { addr: u64, value: ?u8 } { return .{ .addr = at, .value = if (known[0]) byte[0] else null }; } +/// What the recording says of the file mapped at `path` (`Debugger.emitModule`): +/// its build id, and where its debug info came from: `separate`, a debug +/// file of the same build id (its names and lines are the library's own), +/// `own`, in the file, or `none`. Null for a path that is no module. +pub fn module(m: Moment, path: []const u8) ?struct { build_id: []const u8, debug: Symbols.Debug } { + const text = m.trace.strings.get(event.moduleId(path)) orelse return null; + if (text.len < 1) return null; + return .{ .build_id = text[1..], .debug = std.enums.fromInt(Symbols.Debug, text[0]) orelse .none }; +} + /// A GOT slot at a moment: what it holds, and whether that is still the way /// back into the PLT (`lazy`: the next call through it runs the loader's /// resolver, which binds it) rather than the function. Null where the |
