debug: implement symtab generation

Use pyelftools to extract the symbol table from the
link stage executable. Then, filter out the function names
and sort them based on their offsets before writing into the
`symtab.c`, this is similar to how the `isr_tables` works.

To access the structure, simply include the new header:
```c
#include <zephyr/debug/symtab.h>
```

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
This commit is contained in:
Yong Cong Sin 2024-05-18 16:45:44 +08:00 committed by Anas Nashif
commit e1ce0aefff
9 changed files with 276 additions and 0 deletions

View file

@ -323,6 +323,13 @@ Devicetree
Libraries / Subsystems
**********************
* Debug
* symtab
* By enabling :kconfig:option:`CONFIG_SYMTAB`, the symbol table will be
generated with Zephyr link stage executable on supported architectures.
* Management
* hawkBit