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>
15 lines
319 B
C
15 lines
319 B
C
/*
|
|
* Copyright (c) 2024 Meta Platforms
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <zephyr/debug/symtab.h>
|
|
|
|
/**
|
|
* These are placeholder variables. They will be replaced by the real ones
|
|
* generated by `gen_symtab.py`.
|
|
*/
|
|
const struct z_symtab_entry *z_symtab_entries;
|
|
const struct symtab_info z_symtab;
|