nx_dwarf_rnglists.nx
buildroot/runtime/nx_dwarf_rnglists.nx
about
nx_dwarf_rnglists.nx -- DWARF v5 .debug_rnglists builder.
.debug_rnglists supersedes .debug_ranges (DWARF v3/v4). Stores
non-contiguous PC-range sets for DIEs whose code lives in
multiple discontiguous .text fragments (e.g. inlined functions,
hot/cold splitting, function-section partitioning).
A DIE references its range list via DW_AT_ranges with form
DW_FORM_rnglistx (uleb128 index into .debug_rnglists's offset
table) or DW_FORM_sec_offset.
Per-CU range list layout (DWARF v5 7.28):
header:
length u32
version u16 = 5
address_size u8 = 8
segment_selector u8 = 0
offset_entry_count u32
offsets[count] u32 (each = file offset within rnglists
of one range list relative to end of header)
range lists:
each = sequence of operations terminated by DW_RLE_end_of_list
DW_RLE_* opcodes (subset we emit):
DW_RLE_end_of_list 0x00
DW_RLE_base_addressx 0x01 (uleb idx into addr table)
DW_RLE_startx_endx 0x02 (uleb startx, uleb endx)
DW_RLE_startx_length 0x03 (uleb startx, uleb len)
DW_RLE_offset_pair 0x04 (uleb start, uleb end -- relative
to base addr)
DW_RLE_base_address 0x05 (8-byte abs)
DW_RLE_start_end 0x06 (8-byte start, 8-byte end)
DW_RLE_start_length 0x07 (8-byte start, uleb length)
Pairs with nx_dwarf_info (consumer of the offset references) +
nx_dwarf_aranges (similar but for PC-to-CU lookup, not per-DIE).
dependencies 1 imports · 0 importers
imports: syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| 60 | struct NxDwRl |
consts
| 46 | const NX_DWRL_VERSION: i64 = 5 |
| 47 | const NX_DWRL_ADDR_SIZE: i64 = 8 |
| 48 | const NX_DWRL_SEG_SIZE: i64 = 0 |
| 51 | const NX_DW_RLE_END_OF_LIST: i64 = 0x00 |
| 52 | const NX_DW_RLE_BASE_ADDRESSX: i64 = 0x01 |
| 53 | const NX_DW_RLE_STARTX_ENDX: i64 = 0x02 |
| 54 | const NX_DW_RLE_STARTX_LENGTH: i64 = 0x03 |
| 55 | const NX_DW_RLE_OFFSET_PAIR: i64 = 0x04 |
| 56 | const NX_DW_RLE_BASE_ADDRESS: i64 = 0x05 |
| 57 | const NX_DW_RLE_START_END: i64 = 0x06 |
| 58 | const NX_DW_RLE_START_LENGTH: i64 = 0x07 |
| 68 | const NX_DWRL_BYTES: i64 = 40 |
functions
| 70 | func nx_dwrl_new(cap: i64) -> *NxDwRl called by 1: main |
| 81 | func nx_dwrl_byte(r: *NxDwRl, b: i64) -> i64 |
| 88 | func nx_dwrl_u16(r: *NxDwRl, v: i64) -> i64 |
| 93 | func nx_dwrl_u32(r: *NxDwRl, v: i64) -> i64 |
| 100 | func nx_dwrl_u64(r: *NxDwRl, v: i64) -> i64 |
| 111 | func nx_dwrl_uleb(r: *NxDwRl, v: i64) -> i64 |
| 127 | func nx_dwrl_patch_u32(r: *NxDwRl, off: i64, v: i64) -> i64 |
| 139 | func nx_dwrl_cu_begin(r: *NxDwRl, n_offset_entries: i64) -> i64 |
| 159 | func nx_dwrl_patch_offset(r: *NxDwRl, idx: i64, list_off_in_cu: i64) -> i64 |
| 167 | func nx_dwrl_list_offset(r: *NxDwRl, n_offset_entries: i64) -> i64 called by 1: main |
| 173 | func nx_dwrl_start_length(r: *NxDwRl, start: i64, length: i64) -> i64 |
| 180 | func nx_dwrl_start_end(r: *NxDwRl, start: i64, end: i64) -> i64 |
| 187 | func nx_dwrl_end_list(r: *NxDwRl) -> i64 |
| 192 | func nx_dwrl_cu_end(r: *NxDwRl) -> i64 |
| 202 | func main() -> i64 |