debug: coredump: support dumping stack top only

Add Kconfig option to dump only a portion of stack from the
current stack pointer to the stack end. This is enough to
let gdb reconstruct the stack trace and can significantly
reduce the dump size. This is crucial if the core dump needs
to be sent over radio.

Additionally, add another option to set the limit for the
dumped stack portion.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
This commit is contained in:
Damian Krolik 2025-04-14 15:25:48 +02:00 committed by Benjamin Cabé
commit 222e0fcd06
6 changed files with 82 additions and 7 deletions

View file

@ -638,6 +638,11 @@ void arch_coredump_info_dump(const struct arch_esf *esf);
*/
uint16_t arch_coredump_tgt_code_get(void);
/**
* @brief Get the stack pointer of the thread.
*/
uintptr_t arch_coredump_stack_ptr_get(const struct k_thread *thread);
#if defined(CONFIG_USERSPACE) || defined(__DOXYGEN__)
/**