doc: services: debugging: add documentation for symtab

Add a simple documentation for symbol table.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
This commit is contained in:
Yong Cong Sin 2024-05-27 22:31:27 +08:00 committed by David Leach
commit db2f74555d
3 changed files with 49 additions and 0 deletions

View file

@ -11,3 +11,4 @@ Debugging
gdbstub.rst
debugmon.rst
mipi_stp_decoder.rst
symtab.rst

View file

@ -0,0 +1,31 @@
.. _symtab:
Symbol Table (Symtab)
#####################
The Symtab module, when enabled, will generate full symbol table during the Zephyr linking
stage that keep tracks of the information about the functions' name and address, for advanced application
with a lot of functions, this is expected to consume a sizable amount of ROM.
Currently, this is being used to look up the function names during a stack trace in supported architectures.
Usage
*****
Application can gain access to the symbol table data structure by including the :file:`symtab.h` header
file and call :c:func:`symtab_get`. For now, we only provide :c:func:`symtab_find_symbol_name`
function to look-up the symbol name and offset of an address. More advanced functionalities and be
achieved by directly accessing the members of the data structure.
Configuration
*************
Configure this module using the following options.
* :kconfig:option:`CONFIG_SYMTAB`: enable the generation of the symbol table.
API documentation
*****************
.. doxygengroup:: symtab_apis

View file

@ -9,6 +9,15 @@
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @defgroup symtab_apis Symbol Table API
* @{
*/
/**
* @cond INTERNAL_HIDDEN
*/
@ -49,4 +58,12 @@ const struct symtab_info *const symtab_get(void);
*/
const char *const symtab_find_symbol_name(uintptr_t addr, uint32_t *offset);
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_INCLUDE_DEBUG_SYMTAB_H_ */