DwarfLinesBuildFromElf
Description
Parse the .debug_line section of a previously-opened ElfFile.
Parameters
| Name | Direction | Description |
|---|---|---|
out |
out | Populated on success. |
elf |
in | ELF file to read from. Borrowed; not retained. |
alloc |
in | Allocator for the resulting tables + string pool. |
Success
Returns true. out->entries.length may be 0 if the binary has no .debug_line section (stripped or built without -g).
Failure
Returns false; logs the failing step. out is left zeroed.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Dwarf.c:28:
DwarfLines lines;
bool built = DwarfLinesBuildFromElf(&lines, &elf, ALLOCATOR_OF(&alloc));
bool ok = built && lines.entries.length > 0;- In
Dwarf.c:68:
DwarfLines lines;
bool built = DwarfLinesBuildFromElf(&lines, &elf, base);
bool ok = false;
if (built) { if (!cache_entry->dwarf_built) {
cache_entry->dwarf_built = true;
cache_entry->dwarf_ok = DwarfLinesBuildFromElf(&cache_entry->dwarf, &cache_entry->elf, self->allocator);
}
if (cache_entry->dwarf_ok) {- 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:588:
bool DwarfLinesBuildFromElf(DwarfLines *out, const ElfFile *elf, Allocator *alloc) {
if (!out || !elf || !alloc) {
LOG_ERROR("DwarfLinesBuildFromElf: NULL argument");
return false;
}
Last updated on