code wiki / (root) / nx_addr2line_lib.nx

nx_addr2line_lib.nx

buildroot/runtime/nx_addr2line_lib.nx

15798 B392 linesdepth 3pulls 3 transitivereach 6 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_addr2line_lib.nx -- the sovereign DWARF v5 .debug_line DECODER, as a SHARED library. WHY THIS FILE EXISTS (2026-08-07). `nx_a2l_run` was proven and useful but lived inside nx_addr2line.nx, which owns `main()` -- so no gate and no other organ could ever call it. A PROVEN PREDICATE TRAPPED INSIDE AN ORGAN THAT OWNS main() IS NOT A SHARED CAPABILITY, IT IS A COPY WAITING TO BE MADE, AND EVERY COPY IS FREE TO DISAGREE WITH THE ONE THAT WAS PROVEN. Lifted VERBATIM (no semantic edit) so the extraction is mechanically checkable; nx_addr2line.nx now imports this and keeps only its CLI main. The decoder is deliberately INDEPENDENT of nx_dwarf_line.nx (the encoder): it repeats the DWARF opcode constants rather than sharing them. That independence is the whole point -- it is what makes encoder-vs-decoder a genuine TWO-SYSTEM check instead of one system agreeing with itself. Do not "clean this up" by unifying the constants. Needs only sys_mmap. Importing nx_elf_read here would be wrong: locating the section in an ELF is the CALLER's job, and nx_elf_read owns a main() of its own. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 5 importers

syscalls.nx nx_addr2line_lib.nx nx_addr2line.nx nx_dbg_step.nx nx_dwline_e2e_gate.nx nx_dwline_roundtrip_gate.nx nx_dwline_stmt_gate.nx

imports: syscalls.nx

imported by: nx_addr2line.nxnx_dbg_step.nxnx_dwline_e2e_gate.nxnx_dwline_roundtrip_gate.nxnx_dwline_stmt_gate.nx

structs

32struct NxA2LResult

consts

20const NX_MAGIC_65536: i64 = 65536
21const NX_MAGIC_16777216: i64 = 16777216
25const NX_A2L_DW_LNS_copy: i64 = 0x01
26const NX_A2L_DW_LNS_advance_pc: i64 = 0x02
27const NX_A2L_DW_LNS_advance_line: i64 = 0x03
28const NX_A2L_DW_LNS_set_file: i64 = 0x04
29const NX_A2L_DW_LNE_end_sequence: i64 = 0x01
30const NX_A2L_DW_LNE_set_address: i64 = 0x02
39const NX_A2L_RESULT_BYTES: i64 = 32
141const NX_A2L_TAG_SUBPROGRAM: i64 = 0x2E
142const NX_A2L_AT_NAME: i64 = 0x03
143const NX_A2L_AT_LOW_PC: i64 = 0x11
144const NX_A2L_AT_HIGH_PC: i64 = 0x12
145const NX_A2L_FORM_ADDR: i64 = 0x01
146const NX_A2L_FORM_STRING: i64 = 0x08
147const NX_A2L_MAX_ABBR: i64 = 256
148const NX_A2L_MAX_ATTR: i64 = 2048

functions

42func nx_a2l_uleb(buf: *u8, off: i64, consumed: *i64) -> i64
59func nx_a2l_sleb(buf: *u8, off: i64, consumed: *i64) -> i64
104func nx_a2l_u32(buf: *u8, off: i64) -> i64
116func nx_a2l_prog_off(buf: *u8, len: i64) -> i64
150func nx_a2l_u64le(b: *u8, off: i64) -> i64
159func nx_a2l_func_at(info: *u8, ilen: i64, abbr: *u8, alen: i64,
273func nx_a2l_run_section(buf: *u8, len: i64, target_addr: i64) -> *NxA2LResult
287func nx_a2l_run(buf: *u8, len: i64, target_addr: i64) -> *NxA2LResult