nx_dwarf_str.nx
buildroot/runtime/nx_dwarf_str.nx
about
nx_dwarf_str.nx -- DWARF .debug_str + .debug_line_str builder.
DWARF stores its strings in dedicated sections (.debug_str /
.debug_line_str) so DIE entries (.debug_info) and line-program
file names (.debug_line) can reference them by 4- or 8-byte
offset instead of inlining bytes. Crucial for keeping debug
info compact when many DIEs share names ("int", "char *",
function names, etc.).
API matches nx_strtab but with two ergonomic differences:
* Dedup via nx_intern on the input bytes. Same input string
always returns the same offset, so DIE-side references
hash-cons cleanly.
* `intern_at_in_pool` returns the OFFSET (the value DWARF
wants), not a *u8.
Pairs with nx_dwarf_line.nx (file-name strings) and the
forthcoming nx_dwarf_info.nx (DIE attribute strings).
dependencies 2 imports · 0 importers
imports: syscalls.nxnx_intern.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| 32 | struct NxDwStr |
consts
| 30 | const NX_MAGIC_1024: i64 = 1024 |
| 39 | const NX_DWSTR_BYTES: i64 = 32 |
functions
| 41 | func nx_dwstr_new(bytes_cap: i64, ids_cap: i64) -> *NxDwStr |
| 54 | func nx_dwstr_get(s: *NxDwStr, bytes: *u8, len: i64) -> i64 |
| 91 | func nx_dwstr_get_cstr(s: *NxDwStr, str: *u8) -> i64 |
| 99 | func nx_dwstr_size(s: *NxDwStr) -> i64 { return s.flat_used } called by 1: main |
| 100 | func nx_dwstr_bytes(s: *NxDwStr) -> *u8 { return s.flat } |
| 103 | func nx_dwstr_at(s: *NxDwStr, offset: i64) -> *u8 called by 1: main |
| 110 | func main() -> i64 |