Ignore:
Timestamp:
2023-10-26T15:20:07Z (7 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, topic/msim-upgrade, topic/simplify-dev-export
Children:
2fbb42f
Parents:
d28bdbe
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-26 14:42:03)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-26 15:20:07)
Message:

Read symbol table from ELF sections

Instead of the currently broken data generated using genmap.py,
read the ELF symbol table for stack traces and symbol names.
In addition to that, prepare ground for accessing DWARF debug
sections.

Because neither .symtab, nor .debug_* sections are
normally part of the program image, these have to be provided
externally. Instead of the previous way of relinking kernel
to bake in the symbol data, we now only link kernel once
and the extra debug data is loaded as part of the initrd image.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/debug/stacktrace.c

    rd28bdbe rda13982  
    106106kernel_symbol_resolve(uintptr_t addr, const char **sp, uintptr_t *op)
    107107{
    108         return (symtab_name_lookup(addr, sp, op) == 0);
     108        uintptr_t symbol_addr = 0;
     109        *sp = symtab_name_lookup(addr, &symbol_addr);
     110        *op = addr - symbol_addr;
     111        return symbol_addr != 0;
    109112}
    110113
Note: See TracChangeset for help on using the changeset viewer.