Ignore:
Timestamp:
2023-10-26T15:20:07Z (15 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 moved

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/debug/register.h

    rd28bdbe rda13982  
    11/*
    2  * Copyright (c) 2005 Ondrej Palkovsky
     2 * Copyright (c) 2023 Jiří Zárevúcky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup kernel_generic
    30  * @{
    31  */
    32 /** @file
    33  */
     29#ifndef DEBUG_REGISTER_H_
     30#define DEBUG_REGISTER_H_
    3431
    35 #ifndef KERN_SYMTAB_LOOKUP_H_
    36 #define KERN_SYMTAB_LOOKUP_H_
     32/** Accepts data of an ELF file containing debug sections. */
     33void register_debug_data(const void *data, size_t data_size);
    3734
    38 #include <typedefs.h>
    39 
    40 #define MAX_SYMBOL_NAME  64
    41 
    42 struct symtab_entry {
    43         uint64_t address_le;
    44         char symbol_name[MAX_SYMBOL_NAME];
    45 };
    46 
    47 extern errno_t symtab_name_lookup(uintptr_t, const char **, uintptr_t *);
    48 extern const char *symtab_fmt_name_lookup(uintptr_t);
    49 extern errno_t symtab_addr_lookup(const char *, uintptr_t *);
    50 
    51 #ifdef CONFIG_SYMTAB
    52 
    53 /** Symtable linked together by build process
    54  *
    55  */
    56 extern struct symtab_entry symbol_table[];
    57 
    58 #endif /* CONFIG_SYMTAB */
    59 
    60 #endif
    61 
    62 /** @}
    63  */
     35#endif /* DEBUG_REGISTER_H_ */
Note: See TracChangeset for help on using the changeset viewer.