DwarfLines
Description
Parsed .debug_line content. Entries are flat and sorted-by- address per the line-number program’s natural emission order inside each compilation unit. Lookups do a linear scan across all CUs.
Fields
| Name | Description |
|---|---|
allocator |
Allocator backing entries + string_pool. |
entries |
All (address, file, line, …) rows, in CU / program order. |
string_pool |
Owned buffer holding the file / directory strings that entries borrows from. Required because .debug_line file/dir entries are interleaved byte-strings inside the section — we copy them into a contiguous pool so the ElfFile’s lifetime doesn’t have to match ours. |
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Dwarf.c:27:
}
DwarfLines lines;
bool built = DwarfLinesBuildFromElf(&lines, &elf, ALLOCATOR_OF(&alloc));
bool ok = built && lines.entries.length > 0;- In
Dwarf.c:67:
}
DwarfLines lines;
bool built = DwarfLinesBuildFromElf(&lines, &elf, base);
bool ok = false;- In
Dwarf.c:374:
static bool lnp_emit(
DwarfLines *out,
Str *pool,
const CuStrings *cs,- In
Dwarf.c:416:
const LineProgHeader *hdr,
const CuStrings *cs,
DwarfLines *out,
U64Vec *pending_file_offsets,
U64Vec *pending_dir_offsets- In
Dwarf.c:586:
// ---------------------------------------------------------------------------
bool DwarfLinesBuildFromElf(DwarfLines *out, const ElfFile *elf, Allocator *alloc) {
if (!out || !elf || !alloc) {
LOG_ERROR("DwarfLinesBuildFromElf: NULL argument");- In
Dwarf.c:695:
}
void DwarfLinesDeinit(DwarfLines *self) {
if (!self)
return;- In
Dwarf.c:707:
// ---------------------------------------------------------------------------
const DwarfLineEntry *DwarfLinesResolve(const DwarfLines *self, u64 vaddr) {
if (!self || self->entries.length == 0)
return NULL; ElfFile elf;
#if MISRA_HAVE_PARSER_DWARF
DwarfLines dwarf;
bool dwarf_built;
bool dwarf_ok;- In
Dwarf.h:80:
DwarfLineEntries entries;
Str string_pool;
} DwarfLines;
///
- In
Dwarf.h:96:
/// TAGS: Parser, DWARF, Lines
///
bool DwarfLinesBuildFromElf(DwarfLines *out, const ElfFile *elf, Allocator *alloc);
///
- In
Dwarf.h:110:
/// TAGS: Parser, DWARF, Lookup
///
const DwarfLineEntry *DwarfLinesResolve(const DwarfLines *self, u64 vaddr);
///
- In
Dwarf.h:115:
/// Release storage owned by a `DwarfLines`. Safe on a zeroed struct.
///
void DwarfLinesDeinit(DwarfLines *self);
#endif // MISRA_PARSERS_DWARF_H
Last updated on