nx_addr2line_lib.nx
buildroot/runtime/nx_addr2line_lib.nx
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
imports: syscalls.nx
imported by: nx_addr2line.nxnx_dbg_step.nxnx_dwline_e2e_gate.nxnx_dwline_roundtrip_gate.nxnx_dwline_stmt_gate.nx
structs
| 32 | struct NxA2LResult |
consts
| 20 | const NX_MAGIC_65536: i64 = 65536 |
| 21 | const NX_MAGIC_16777216: i64 = 16777216 |
| 25 | const NX_A2L_DW_LNS_copy: i64 = 0x01 |
| 26 | const NX_A2L_DW_LNS_advance_pc: i64 = 0x02 |
| 27 | const NX_A2L_DW_LNS_advance_line: i64 = 0x03 |
| 28 | const NX_A2L_DW_LNS_set_file: i64 = 0x04 |
| 29 | const NX_A2L_DW_LNE_end_sequence: i64 = 0x01 |
| 30 | const NX_A2L_DW_LNE_set_address: i64 = 0x02 |
| 39 | const NX_A2L_RESULT_BYTES: i64 = 32 |
| 141 | const NX_A2L_TAG_SUBPROGRAM: i64 = 0x2E |
| 142 | const NX_A2L_AT_NAME: i64 = 0x03 |
| 143 | const NX_A2L_AT_LOW_PC: i64 = 0x11 |
| 144 | const NX_A2L_AT_HIGH_PC: i64 = 0x12 |
| 145 | const NX_A2L_FORM_ADDR: i64 = 0x01 |
| 146 | const NX_A2L_FORM_STRING: i64 = 0x08 |
| 147 | const NX_A2L_MAX_ABBR: i64 = 256 |
| 148 | const NX_A2L_MAX_ATTR: i64 = 2048 |
functions
| 42 | func nx_a2l_uleb(buf: *u8, off: i64, consumed: *i64) -> i64 |
| 59 | func nx_a2l_sleb(buf: *u8, off: i64, consumed: *i64) -> i64 |
| 104 | func nx_a2l_u32(buf: *u8, off: i64) -> i64 |
| 116 | func nx_a2l_prog_off(buf: *u8, len: i64) -> i64 |
| 150 | func nx_a2l_u64le(b: *u8, off: i64) -> i64 |
| 159 | func nx_a2l_func_at(info: *u8, ilen: i64, abbr: *u8, alen: i64, |
| 273 | func nx_a2l_run_section(buf: *u8, len: i64, target_addr: i64) -> *NxA2LResult |
| 287 | func nx_a2l_run(buf: *u8, len: i64, target_addr: i64) -> *NxA2LResult |