This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 7f499e6f4859e6f7389ebf1dc5a4ea8bce0c8d88 Author: wanggang26 <[email protected]> AuthorDate: Fri Mar 14 19:00:09 2025 +0800 boards/Kconfig: allow BOARD_CRASHDUMP_CUSTOM with a core dump method BOARD_CRASHDUMP_CUSTOM was one entry of the "BOARD crashdump method" choice, so dump_fatal_info() called either board_crashdump() or coredump_dump(), never both. A board that saves its own crash record with board_crashdump() could not also produce a core dump. Move BOARD_CRASHDUMP_CUSTOM out of the choice and call board_crashdump() before the core dump when both are enabled. A configuration that selected BOARD_CRASHDUMP_CUSTOM keeps it enabled, and the choice falls back to its default BOARD_CRASHDUMP_NONE, so only board_crashdump() is called, as before. Signed-off-by: wanggang26 <[email protected]> --- boards/Kconfig | 13 +++++++------ sched/misc/assert.c | 4 +++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/boards/Kconfig b/boards/Kconfig index 075b599fe1a..e176bac5b8f 100644 --- a/boards/Kconfig +++ b/boards/Kconfig @@ -5917,17 +5917,18 @@ config BOARD_COREDUMP_MTDDEV ---help--- Enable save coredump to mtd device when crash. -config BOARD_CRASHDUMP_CUSTOM - bool "Enable Core Dump with custom method" - ---help--- - Enable save coredump with custom method. only work with - board_crashdump api. - config BOARD_CRASHDUMP_NONE bool "No Board level crash dump" endchoice # BOARD crashdump method +config BOARD_CRASHDUMP_CUSTOM + bool "Enable Crash Dump with custom method" + default n + ---help--- + Enable save crash dump info with custom method. only work with + board_crashdump api. + config BOARD_COREDUMP_DEVPATH string "Save Core Dump data with device PATH" depends on BOARD_COREDUMP_BLKDEV || BOARD_COREDUMP_MTDDEV diff --git a/sched/misc/assert.c b/sched/misc/assert.c index aaad64dee0a..1b2f3da2c44 100644 --- a/sched/misc/assert.c +++ b/sched/misc/assert.c @@ -792,7 +792,9 @@ static void dump_fatal_info(FAR struct tcb_s *rtcb, #ifdef CONFIG_BOARD_CRASHDUMP_CUSTOM board_crashdump(up_getsp(), rtcb, filename, linenum, msg, regs); -#elif !defined(CONFIG_BOARD_CRASHDUMP_NONE) +#endif + +#ifndef CONFIG_BOARD_CRASHDUMP_NONE /* Dump core information */
