code wiki / (root) / nx_dwarf_info.nx

nx_dwarf_info.nx

buildroot/runtime/nx_dwarf_info.nx

9878 B304 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic dwarf
docsdependenciesstructsconstsfunctions

about

nx_dwarf_info.nx -- DWARF .debug_info section builder. The DIE (Debugging Information Entry) forest. Each DIE is: abbrev_code uleb128 (refers to nx_dwarf_abbrev entry) attribute values raw bytes shaped per the abbrev's form list A compilation unit (CU) starts with a header: length u32 (or extended u64 for >4GB CUs) version u16 (= 5 for DWARF v5) unit_type u8 (= DW_UT_compile = 0x01) addr_size u8 (= 8 for RV64) abbrev_offset u32 (offset into .debug_abbrev) ...DIE bytes... The first DIE after the header is the CU's root DIE (usually DW_TAG_compile_unit). Children DIEs follow when the abbrev declared has_children=1, terminated by a NULL DIE (single 0 byte). Pairs with: nx_dwarf_abbrev -- supplies the codes referenced from each DIE nx_dwarf_str -- supplies offsets for DW_FORM_strp values nx_dwarf_line -- pointed-to by DW_AT_stmt_list What this module ships (v0.0.1): * CU-header writer (begin/finalize that fix up the length field) * DIE-emit helpers: emit_die_open(code) / emit_die_close() * Per-FORM attribute writers (addr / data4 / data8 / strp / ref4 / flag_present / sec_offset / udata / sdata) Doesn't yet validate that the (form, value) pairs match the abbrev's declared schema -- caller responsibility for now.

dependencies 1 imports · 0 importers

syscalls.nx nx_dwarf_info.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_dwinfo_new nx_dwinfo_cu_begin nx_dwinfo_u32 nx_dwinfo_byte nx_dwinfo_u16 nx_dwinfo_byte ↻ nx_dwinfo_byte ↻ nx_dwinfo_die_open nx_dwinfo_uleb nx_dwinfo_byte ↻ nx_dwinfo_attr_strp nx_dwinfo_u32 ↻ nx_dwinfo_attr_addr nx_dwinfo_u64 nx_dwinfo_byte ↻ nx_dwinfo_attr_data8 nx_dwinfo_u64 ↻ nx_dwinfo_attr_sec_offset nx_dwinfo_u32 ↻ nx_dwinfo_attr_ref4 nx_dwinfo_u32 ↻ nx_dwinfo_die_null nx_dwinfo_byte ↻ nx_dwinfo_cu_finalize

structs

47struct NxDwInfo

consts

41const NX_MAGIC_1024: i64 = 1024
43const NX_DW_UT_compile: i64 = 0x01
56const NX_DW_INFO_BYTES: i64 = 48

functions

58func nx_dwinfo_new(cap: i64) -> *NxDwInfo
called by 1: main
72func nx_dwinfo_byte(d: *NxDwInfo, v: i64) -> i64
79func nx_dwinfo_u16(d: *NxDwInfo, v: i64) -> i64
85func nx_dwinfo_u32(d: *NxDwInfo, v: i64) -> i64
93func nx_dwinfo_u64(d: *NxDwInfo, v: i64) -> i64
105func nx_dwinfo_uleb(d: *NxDwInfo, v: i64) -> i64
118func nx_dwinfo_sleb(d: *NxDwInfo, v: i64) -> i64
called by 1: nx_dwinfo_attr_sdata calls 1: nx_dwinfo_byte
139func nx_dwinfo_cu_begin(d: *NxDwInfo, abbrev_offset: i64) -> i64
152func nx_dwinfo_cu_finalize(d: *NxDwInfo) -> i64
called by 1: main
168func nx_dwinfo_die_open(d: *NxDwInfo, abbrev_code: i64) -> i64
called by 1: main calls 1: nx_dwinfo_uleb
173func nx_dwinfo_die_null(d: *NxDwInfo) -> i64
called by 1: main calls 1: nx_dwinfo_byte
179func nx_dwinfo_attr_addr(d: *NxDwInfo, addr: i64) -> i64
called by 1: main calls 1: nx_dwinfo_u64
183func nx_dwinfo_attr_data1(d: *NxDwInfo, v: i64) -> i64
calls 1: nx_dwinfo_byte
187func nx_dwinfo_attr_data2(d: *NxDwInfo, v: i64) -> i64
calls 1: nx_dwinfo_u16
191func nx_dwinfo_attr_data4(d: *NxDwInfo, v: i64) -> i64
calls 1: nx_dwinfo_u32
195func nx_dwinfo_attr_data8(d: *NxDwInfo, v: i64) -> i64
called by 1: main calls 1: nx_dwinfo_u64
200func nx_dwinfo_attr_strp(d: *NxDwInfo, str_off: i64) -> i64
called by 1: main calls 1: nx_dwinfo_u32
205func nx_dwinfo_attr_ref4(d: *NxDwInfo, cu_local_off: i64) -> i64
called by 1: main calls 1: nx_dwinfo_u32
210func nx_dwinfo_attr_sec_offset(d: *NxDwInfo, off: i64) -> i64
called by 1: main calls 1: nx_dwinfo_u32
215func nx_dwinfo_attr_flag(d: *NxDwInfo, b: i64) -> i64
calls 1: nx_dwinfo_byte
223func nx_dwinfo_attr_udata(d: *NxDwInfo, v: i64) -> i64
calls 1: nx_dwinfo_uleb
227func nx_dwinfo_attr_sdata(d: *NxDwInfo, v: i64) -> i64
calls 1: nx_dwinfo_sleb
232func nx_dwinfo_attr_string(d: *NxDwInfo, src: *u8) -> i64
calls 1: nx_dwinfo_byte
243func nx_dwinfo_size(d: *NxDwInfo) -> i64 { return d.used }
244func nx_dwinfo_bytes(d: *NxDwInfo) -> *u8 { return d.buf }
248func main() -> i64