This adds a very primitive coredump mechanism under subsys/debug where during fatal error, register and memory content can be dumped to coredump backend. One such backend utilizing log module for output is included. Once the coredump log is converted to a binary file, it can be used with the ELF output file as inputs to an overly simplified implementation of a GDB server. This GDB server can be attached via the target remote command of GDB and will be serving register and memory content. This allows using GDB to examine stack and memory where the fatal error occurred. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
51 lines
1.1 KiB
Plaintext
51 lines
1.1 KiB
Plaintext
# Copyright (c) 2020 Intel Corporation.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
menuconfig DEBUG_COREDUMP
|
|
bool "Enable Core Dump"
|
|
depends on ARCH_SUPPORTS_COREDUMP
|
|
help
|
|
Enable core dump so it can be used for offline debugging.
|
|
|
|
if DEBUG_COREDUMP
|
|
|
|
choice
|
|
prompt "Coredump backend"
|
|
default DEBUG_COREDUMP_BACKEND_LOGGING if LOG
|
|
|
|
config DEBUG_COREDUMP_BACKEND_LOGGING
|
|
bool "Use Logging subsystem for coredump"
|
|
depends on LOG
|
|
help
|
|
Core dump is done via logging subsystem.
|
|
|
|
endchoice
|
|
|
|
choice
|
|
prompt "Memory dump"
|
|
default DEBUG_COREDUMP_MEMORY_DUMP_LINKER_RAM
|
|
|
|
config DEBUG_COREDUMP_MEMORY_DUMP_MIN
|
|
bool "Minimal"
|
|
select THREAD_STACK_INFO
|
|
help
|
|
Only dumps the bare minimum memory content.
|
|
For example, the thread struct and stack of
|
|
the exception thread will be dumped.
|
|
|
|
Don't use this unless you want absolutely
|
|
minimum core dump.
|
|
|
|
config DEBUG_COREDUMP_MEMORY_DUMP_LINKER_RAM
|
|
bool "RAM defined by linker section"
|
|
help
|
|
Dumps the memory region between _image_ram_start[]
|
|
and _image_ram_end[]. This includes at least data,
|
|
noinit, and BSS sections.
|
|
|
|
This is the default.
|
|
|
|
endchoice
|
|
|
|
endif # DEBUG_COREDUMP
|