arm/backtrace: add support for EHABI(Exception Handling ABI) stack unwinder

Reference:
https://github.com/ARM-software/abi-aa/blob/main/ehabi32/ehabi32.rst
https://github.com/ARM-software/abi-aa/releases/download/2022Q1/ehabi32.pdf

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an
2022-10-09 12:29:10 +08:00
committed by Xiang Xiao
parent e793207bb6
commit 24129e4ba7
4 changed files with 726 additions and 10 deletions
+36
View File
@@ -1218,6 +1218,42 @@ config ARM_SEMIHOSTING_HOSTFS_CACHE_COHERENCE
endif endif
if SCHED_BACKTRACE
choice
prompt "Choose ARM unwinder"
default UNWINDER_STACK_POINTER if ARM_THUMB
default UNWINDER_FRAME_POINTER if !ARM_THUMB
---help---
This determines which method will be used for unwinding nuttx stack
traces for debug.
config UNWINDER_FRAME_POINTER
bool "Frame pointer unwinder"
select FRAME_POINTER
---help---
This option enables the frame pointer unwinder for unwinding
nuttx stack traces.
config UNWINDER_STACK_POINTER
bool "Stack pointer unwinder"
---help---
This option enables the stack pointer unwinder for unwinding
nuttx stack traces.
config UNWINDER_ARM
bool "ARM EHABI stack unwinder"
---help---
This option enables stack unwinding support in the nuttx
using the information automatically generated by the
compiler. The resulting nuttx image is slightly bigger but
the performance is not affected. Currently, this feature
only works with EABI compilers.
endchoice
endif
if ARCH_ARMV6M if ARCH_ARMV6M
source "arch/arm/src/armv6-m/Kconfig" source "arch/arm/src/armv6-m/Kconfig"
endif endif
+10 -10
View File
@@ -63,16 +63,16 @@ ifeq ($(CONFIG_SCHED_THREAD_LOCAL),y)
CMN_CSRCS += arm_tls.c CMN_CSRCS += arm_tls.c
endif endif
ifeq ($(CONFIG_SCHED_BACKTRACE),y) ifeq ($(CONFIG_UNWINDER_FRAME_POINTER),y)
ifeq ($(CONFIG_FRAME_POINTER),y) CMN_CSRCS += arm_backtrace_fp.c
ifeq ($(CONFIG_ARM_THUMB),y) endif
CMN_CSRCS += arm_backtrace_thumb.c
else ifeq ($(CONFIG_UNWINDER_STACK_POINTER),y)
CMN_CSRCS += arm_backtrace_fp.c CMN_CSRCS += arm_backtrace_thumb.c
endif endif
else
CMN_CSRCS += arm_backtrace_thumb.c ifeq ($(CONFIG_UNWINDER_ARM),y)
endif CMN_CSRCS += arm_backtrace_unwind.c
endif endif
CMN_ASRCS += vfork.S CMN_ASRCS += vfork.S
+4
View File
@@ -74,6 +74,10 @@ ifeq ($(CONFIG_ARM_THUMB),y)
ARCHOPTIMIZATION += -mthumb ARCHOPTIMIZATION += -mthumb
endif endif
ifeq ($(CONFIG_UNWINDER_ARM),y)
ARCHOPTIMIZATION += -funwind-tables -fasynchronous-unwind-tables
endif
# Link Time Optimization # Link Time Optimization
ifeq ($(CONFIG_LTO_THIN),y) ifeq ($(CONFIG_LTO_THIN),y)
File diff suppressed because it is too large Load Diff