nx_dwarf_pubnames.nx
buildroot/runtime/nx_dwarf_pubnames.nx
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
imports: syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| 34 | struct NxDwPub |
consts
| 32 | const NX_DWPUB_VERSION: i64 = 2 |
| 42 | const NX_DWPUB_BYTES: i64 = 40 |
functions
| 44 | func nx_dwpub_new(cap: i64) -> *NxDwPub called by 1: main |
| 55 | func nx_dwpub_byte(p: *NxDwPub, b: i64) -> i64 |
| 62 | func nx_dwpub_u16(p: *NxDwPub, v: i64) -> i64 |
| 67 | func nx_dwpub_u32(p: *NxDwPub, v: i64) -> i64 |
| 74 | func nx_dwpub_patch_u32(p: *NxDwPub, off: i64, v: i64) -> i64 called by 1: nx_dwpub_cu_end |
| 85 | func nx_dwpub_cu_begin(p: *NxDwPub, info_off: i64, info_len: i64) -> i64 |
| 97 | func nx_dwpub_add(p: *NxDwPub, die_off: i64, name: *u8) -> i64 |
| 110 | func nx_dwpub_cu_end(p: *NxDwPub) -> i64 |
| 121 | func main() -> i64 |