esp32c3/nsh: enable dumpstack/backtrace

Dump task stack:
| nsh> ps
|   PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK   STACK COMMAND
|     0     0   0 FIFO     Kthread N-- Ready              00000000 002016 Idle Task
|     1     1 100 RR       Task    --- Running            00000000 001984 nsh_main
| nsh> dumpstack 0 100
| backtrace| 0: 0x4200764a 0x3fc82d60 0x420000b2 0x42000044
| backtrace| 1: 0x42007e98 0x420036b4 0x4201043c 0x42010450 0x4200cab0 0x42008fec 0x42009294 0x42008454
| backtrace| 1: 0x42007fbe 0x42007f54 0x42006200 0x4200432c
| backtrace| 2: 0x42013ec0 0x420119bc 0x42013abc 0x42006200 0x4200432c

address to line:
| $ riscv64-unknown-elf-addr2line -e nuttx 0x42007e98 0x420036b4 0x4201043c 0x42010450 0x4200cab0 0x42008fec 0x42009294 0x42008454
| nuttx/include/arch/syscall.h:238
| nuttx/sched/semaphore/sem_wait.c:201
| nuttx/sched/sched/sched_waitpid.c:127
| nuttx/sched/sched/sched_waitpid.c:597
| apps/nshlib/nsh_builtin.c:160
| apps/nshlib/nsh_parse.c:543
| apps/nshlib/nsh_parse.c:2736
| apps/nshlib/nsh_session.c:234

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2022-12-08 23:56:38 +08:00 committed by Xiang Xiao
parent f72f7ebee0
commit ee72f920a3
1 changed files with 5 additions and 0 deletions

View File

@ -19,7 +19,10 @@ CONFIG_ARCH_RISCV=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_BOARD_LOOPSPERMSEC=15000
CONFIG_BUILTIN=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEV_ZERO=y
CONFIG_FRAME_POINTER=y
CONFIG_FS_PROCFS=y
CONFIG_IDLETHREAD_STACKSIZE=2048
CONFIG_INIT_ENTRYPOINT="nsh_main"
@ -34,9 +37,11 @@ CONFIG_NSH_READLINE=y
CONFIG_NSH_STRERROR=y
CONFIG_PREALLOC_TIMERS=0
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_BACKTRACE=y
CONFIG_SCHED_WAITPID=y
CONFIG_START_DAY=29
CONFIG_START_MONTH=11
CONFIG_START_YEAR=2019
CONFIG_SYSTEM_DUMPSTACK=y
CONFIG_SYSTEM_NSH=y
CONFIG_UART0_SERIAL_CONSOLE=y