arch: riscv: use symtab to print function name in stack trace

Selecting `CONFIG_EXCEPTION_STACK_TRACE_SYMTAB` will
enable the symtab generation which will be used in the
stack trace to print the function name of the return
address.

Updated the `stack_unwind` test to test the symbols in a
stack trace.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
This commit is contained in:
Yong Cong Sin 2024-05-18 16:49:42 +08:00 committed by Anas Nashif
commit c1a925de98
4 changed files with 57 additions and 4 deletions

View file

@ -50,3 +50,18 @@ tests:
regex:
- "E: backtrace 0: fp: \\w+ lr: \\w+"
- "E: backtrace 1: fp: \\w+ lr: \\w+"
arch.common.stack_unwind.symtab:
arch_allow:
- riscv
integration_platforms:
- qemu_riscv32
- qemu_riscv64
extra_args: OVERLAY_CONFIG="enable_fp.conf"
harness_config:
type: multi_line
regex:
- "[func1+\\w+]"
- "[func2+\\w+]"
- "[func1+\\w+]"
- "[func2+\\w+]"
- "[func1+\\w+]"