summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
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