Open anwu opened 4 years ago
Capability will probably need to have some inherent knowledge of where certain FreeRTOS stacks live.
e_phnum
in the ELF Header
e_phentsize
e_shoff
by incrementing it by e_phentsize
.shstrtab
, increment offset by e_phentsize
Background
We should be able to save a core dump of a halted POD so that we can continue debugging when the device is no longer attached to the debugger.
Goal
Be able to run a dump tool like so...
iotile hw --port jlink connect_direct device=nrf52 debug dump_core <core.file>
Where you can then doarm-none-eabi-gdb --core <core.file>
And then debug from there.Implementation
A core dump file is pretty much an
.elf
file of the program with certain sections modified with memory contents of the device at the time of crash.A more in depth analysis can be read here.
The following implementation steps will be referencing to this article.
.elf
file of a controller and modify its propertiese_type
of theELF header
should be set to0x04
to indicate that the.elf
file is a core fileSHT_NOBITS
are not present in core filesSHT_PROGBITS
section are present in core fileSHT_NOTE
section header mapd to thePT_NOTE
program header... this is important, this will point us to the saved register information that the core file will usejlink
adapter'sflash_forensic
tool todump_memory
of the device's register informationPT_NOTE
section and format it accordingly with dumped register information