code wiki / (root) / nx_dwarf_pubnames.nx

nx_dwarf_pubnames.nx

buildroot/runtime/nx_dwarf_pubnames.nx

5685 B168 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic dwarf
docsdependenciesstructsconstsfunctions

about

nx_dwarf_pubnames.nx -- DWARF .debug_pubnames + .debug_pubtypes builder. Companion to .debug_aranges (PC-to-CU lookup): .debug_pubnames gives gdb/lldb a NAME-to-DIE-offset lookup, so when the user types `b foo`, the debugger doesn't scan every CU's DIE forest to find the function `foo` -- it consults this index first. Per-CU layout (DWARF v4 6.1.1; v5 deprecated this in favor of .debug_names but most consumers still understand pubnames): length u32 (excludes itself) version u16 = 2 debug_info_off u32 (offset of CU header in .debug_info) debug_info_len u32 (length of CU contribution to .debug_info) tuples: die_offset u32 (offset within the CU) name NUL-terminated string terminator u32 (=0) .debug_pubtypes uses the same layout but for type names instead. The two builders share this code -- caller decides which section the bytes go into.

dependencies 1 imports · 0 importers

syscalls.nx nx_dwarf_pubnames.nx

imports: syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_dwpub_new nx_dwpub_cu_begin nx_dwpub_u32 nx_dwpub_byte nx_dwpub_u16 nx_dwpub_byte ↻ nx_dwpub_add nx_dwpub_u32 ↻ nx_dwpub_byte ↻ nx_dwpub_cu_end nx_dwpub_u32 ↻ nx_dwpub_patch_u32

structs

34struct NxDwPub

consts

32const NX_DWPUB_VERSION: i64 = 2
42const NX_DWPUB_BYTES: i64 = 40

functions

44func nx_dwpub_new(cap: i64) -> *NxDwPub
called by 1: main
55func nx_dwpub_byte(p: *NxDwPub, b: i64) -> i64
62func nx_dwpub_u16(p: *NxDwPub, v: i64) -> i64
called by 1: nx_dwpub_cu_begin calls 1: nx_dwpub_byte
67func nx_dwpub_u32(p: *NxDwPub, v: i64) -> i64
74func nx_dwpub_patch_u32(p: *NxDwPub, off: i64, v: i64) -> i64
called by 1: nx_dwpub_cu_end
85func nx_dwpub_cu_begin(p: *NxDwPub, info_off: i64, info_len: i64) -> i64
called by 1: main calls 2: nx_dwpub_u32nx_dwpub_u16
97func nx_dwpub_add(p: *NxDwPub, die_off: i64, name: *u8) -> i64
called by 1: main calls 2: nx_dwpub_u32nx_dwpub_byte
110func nx_dwpub_cu_end(p: *NxDwPub) -> i64
called by 1: main calls 2: nx_dwpub_u32nx_dwpub_patch_u32
121func main() -> i64