anchao opened a new pull request #3256: URL: https://github.com/apache/incubator-nuttx/pull/3256
## Summary libc/execinfo: add backstace support based on EABI Unwinder libc/execinfo: add dump_stack support 1. Flags < -funwind-tables > is required 2. Keep the section ".exidx" in linker script ## Impact N/A ## Testing ``` diff --git a/examples/hello/hello_main.c b/examples/hello/hello_main.c index fcc04112..4b85a41b 100644 --- a/examples/hello/hello_main.c +++ b/examples/hello/hello_main.c @@ -24,6 +24,7 @@ #include <nuttx/config.h> #include <stdio.h> +#include <execinfo.h> /**************************************************************************** * Public Functions @@ -36,5 +37,6 @@ int main(int argc, FAR char *argv[]) { printf("Hello, World!!\n"); + dump_stack(); return 0; } ``` ``` ap> hello Hello, World!! [ 73.800676] [42] [ INFO] [BackTrace]: 0xc0d9bfe 0xc0f3330 0xc0dba0a 0x210838 ``` ``` $ arm-none-eabi-addr2line -e nuttx 0xc0d9bfe 0xc0f3330 0xc0dba0a 0x210838 nuttx/libs/libc/debug/lib_dumpstack.c:52 apps/examples/hello/hello_main.c:42 nuttx/libs/libc/sched/task_startup.c:165 nuttx/sched/task/task_start.c:144 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org