arch: arm64: use symtab to print function name in stack trace
Selecting `CONFIG_SYMTAB` will enable the symtab generation which will be used in the stack trace to print the function name of the return address. Added `arm64` to the `arch.common.stack_unwind.symtab` test. Signed-off-by: Yong Cong Sin <ycsin@meta.com>
This commit is contained in:
parent
eafc4eff04
commit
2a3d9d0d90
3 changed files with 15 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
||||||
* exceptions
|
* exceptions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <zephyr/debug/symtab.h>
|
||||||
#include <zephyr/drivers/pm_cpu_ops.h>
|
#include <zephyr/drivers/pm_cpu_ops.h>
|
||||||
#include <zephyr/arch/common/exc_handle.h>
|
#include <zephyr/arch/common/exc_handle.h>
|
||||||
#include <zephyr/kernel.h>
|
#include <zephyr/kernel.h>
|
||||||
|
@ -224,8 +225,16 @@ static void esf_unwind(const z_arch_esf_t *esf)
|
||||||
LOG_ERR("");
|
LOG_ERR("");
|
||||||
while (fp != NULL) {
|
while (fp != NULL) {
|
||||||
lr = fp[1];
|
lr = fp[1];
|
||||||
|
#ifdef CONFIG_SYMTAB
|
||||||
|
uint32_t offset = 0;
|
||||||
|
const char *name = symtab_find_symbol_name(lr, &offset);
|
||||||
|
|
||||||
|
LOG_ERR("backtrace %2d: fp: 0x%016llx lr: 0x%016llx [%s+0x%x]",
|
||||||
|
count++, (uint64_t) fp, lr, name, offset);
|
||||||
|
#else
|
||||||
LOG_ERR("backtrace %2d: fp: 0x%016llx lr: 0x%016llx",
|
LOG_ERR("backtrace %2d: fp: 0x%016llx lr: 0x%016llx",
|
||||||
count++, (uint64_t) fp, lr);
|
count++, (uint64_t) fp, lr);
|
||||||
|
#endif
|
||||||
fp = (uint64_t *) fp[0];
|
fp = (uint64_t *) fp[0];
|
||||||
}
|
}
|
||||||
LOG_ERR("");
|
LOG_ERR("");
|
||||||
|
|
|
@ -71,6 +71,10 @@ Architectures
|
||||||
|
|
||||||
* ARM
|
* ARM
|
||||||
|
|
||||||
|
* ARM64
|
||||||
|
|
||||||
|
* Implemented symbol names in the backtraces, enable by selecting :kconfig:option:`CONFIG_SYMTAB`
|
||||||
|
|
||||||
* RISC-V
|
* RISC-V
|
||||||
|
|
||||||
* The fatal error message triggered from a fault now contains the callee-saved-registers states.
|
* The fatal error message triggered from a fault now contains the callee-saved-registers states.
|
||||||
|
|
|
@ -53,9 +53,11 @@ tests:
|
||||||
arch.common.stack_unwind.symtab:
|
arch.common.stack_unwind.symtab:
|
||||||
arch_allow:
|
arch_allow:
|
||||||
- riscv
|
- riscv
|
||||||
|
- arm64
|
||||||
integration_platforms:
|
integration_platforms:
|
||||||
- qemu_riscv32
|
- qemu_riscv32
|
||||||
- qemu_riscv64
|
- qemu_riscv64
|
||||||
|
- qemu_cortex_a53
|
||||||
extra_args: OVERLAY_CONFIG="enable_fp.conf"
|
extra_args: OVERLAY_CONFIG="enable_fp.conf"
|
||||||
harness_config:
|
harness_config:
|
||||||
type: multi_line
|
type: multi_line
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue