code wiki / (root) / nx_dwarf_addr.nx

nx_dwarf_addr.nx

buildroot/runtime/nx_dwarf_addr.nx

5525 B179 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic dwarf
docsdependenciesstructsconstsfunctions

about

nx_dwarf_addr.nx -- DWARF v5 .debug_addr builder. Same indirection trick as .debug_str_offsets, applied to runtime code addresses. DWARF v4 stored each address inline as 8 bytes in DIE attributes (DW_FORM_addr). DWARF v5 introduces DW_FORM_addrx -- a uleb128 index into a per-CU address table living in .debug_addr. Benefits: - All link-time-relocated addresses concentrate in ONE section (the linker only patches .debug_addr, never DIEs). - DIEs become smaller and more compressible. - Addresses can be deduplicated within a CU. Per-CU layout (DWARF v5 7.27): length u32 (excludes itself) version u16 = 5 addr_size u8 = 8 segment_selector u8 = 0 addresses[] 8 bytes each (vaddr post-link) Caller emits one CU contribution per .debug_info CU and writes one u64 per address the CU references. DIE attributes use form DW_FORM_addrx (uleb128 index). Pairs with nx_dwarf_info (consumer) + nx_dwarf_str_offsets (sister DWARF v5 indirection).

dependencies 1 imports · 0 importers

syscalls.nx nx_dwarf_addr.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_dwaddr_new nx_dwaddr_cu_begin nx_dwaddr_u32 nx_dwaddr_byte nx_dwaddr_u16 nx_dwaddr_byte ↻ nx_dwaddr_byte ↻ nx_dwaddr_cu_base nx_dwaddr_add nx_dwaddr_u64 nx_dwaddr_byte ↻ nx_dwaddr_cu_end nx_dwaddr_patch_u32

structs

41struct NxDwAddr

consts

37const NX_DWADDR_VERSION: i64 = 5
38const NX_DWADDR_ADDR_SIZE: i64 = 8
39const NX_DWADDR_SEG_SIZE: i64 = 0
49const NX_DWADDR_BYTES: i64 = 40

functions

51func nx_dwaddr_new(cap: i64) -> *NxDwAddr
called by 1: main
62func nx_dwaddr_byte(a: *NxDwAddr, b: i64) -> i64
69func nx_dwaddr_u16(a: *NxDwAddr, v: i64) -> i64
called by 1: nx_dwaddr_cu_begin calls 1: nx_dwaddr_byte
74func nx_dwaddr_u32(a: *NxDwAddr, v: i64) -> i64
called by 1: nx_dwaddr_cu_begin calls 1: nx_dwaddr_byte
81func nx_dwaddr_u64(a: *NxDwAddr, v: i64) -> i64
called by 1: nx_dwaddr_add calls 1: nx_dwaddr_byte
90func nx_dwaddr_patch_u32(a: *NxDwAddr, off: i64, v: i64) -> i64
called by 1: nx_dwaddr_cu_end
99func nx_dwaddr_cu_begin(a: *NxDwAddr) -> i64
112func nx_dwaddr_add(a: *NxDwAddr, vaddr: i64) -> i64
called by 1: main calls 1: nx_dwaddr_u64
122func nx_dwaddr_cu_base(a: *NxDwAddr) -> i64
called by 1: main
128func nx_dwaddr_cu_end(a: *NxDwAddr) -> i64
called by 1: main calls 1: nx_dwaddr_patch_u32
138func main() -> i64