summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-11 11:26:59 -0300
committerGabriel Schneider <[email protected]>2026-11-11 11:27:09 -0300
commitdcbe8941df205fa8c8805b022f025e1012dede19 (patch)
tree9b4df7f904077c07eab979cb10aba9d6a3becf10 /README.md
parent6142fa676731e158622ca7956c150c58bc57f1f2 (diff)
downloadcomputeranim-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 'README.md')
-rw-r--r--README.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/README.md b/README.md
index 79c2e89..f166675 100644
--- a/README.md
+++ b/README.md
@@ -273,6 +273,34 @@ $ ztrace record --by break -b fib -- ./fib 5 && ztrace show out.ztrace 34
02:0010│ 7ffc63068920 ◂— 3
```
+**Separate debug info.** A stripped library (a distribution's libc, its
+loader) is named from its separate debug file where one is on disk: by
+build id in the debuginfod client's cache (`$DEBUGINFOD_CACHE_PATH`, else
+`$XDG_CACHE_HOME/debuginfod_client`, else `~/.cache/debuginfod_client`)
+and in `/usr/lib/debug/.build-id`, or by `.gnu_debuglink` beside the file
+(through `std.debug.ElfFile`). It is used only when its own build id is the
+mapped library's, or, for a debuglink without one, its CRC matches:
+anything else is ignored. Its symbol table names static functions
+(`_int_malloc`, `__libc_start_call_main`, the loader's
+`_dl_runtime_resolve_xsavec`), versions dropped (`__libc_start_main`, not
+`@@GLIBC_2.34`); its DWARF gives libc's frames their lines, by the paths of
+the distribution's build (`/usr/src/debug/glibc/glibc/...`, recorded as
+they are), and its functions' bounds and parameters; the heap's
+`main_arena` is found by its symbol. The tracer never fetches: on Arch,
+`debuginfod-find debuginfo /usr/lib/libc.so.6` (or gdb, once) fills the
+cache; with nothing on disk it is as before. Each module's build id, and
+whether its names come from its own debug info, separate or in the file,
+is recorded once (`event.moduleId` of its path; `zt.telescope.module(m,
+path)`), and `ztrace show` prints it beside its mapping: a recording says
+which libc it is of. A library run through another loader (pwndbg's glibc
+2.40) has its own build id and gets nothing from the system's file.
+Nothing of it is read until an address in the library wants a name: its
+symbols when it is mapped (1 ms), its DWARF at the first stop that wants a
+line there (30 ms and 25 MB in a release build; 1.6 s in a debug build,
+`std.debug.Dwarf.open` reading every function). On the list of
+`anim/tools` by instruction, libc's stops then have lines too: 325 bytes a
+moment against 249, 12 000 moments a second against 16 000.
+
A stop also says what its instruction is about to do to memory, worked
out from capstone's operands and the registers: a `touch` event (the
address, the size, read or write) with what is there, and after the step