espsystem: add support for RISC-V panic backtrace

Add .eh_frame and .eh_frame_hdr sections to the binary (can be
enabled/disabled within menuconfig). These sections are parsed
when a panic occurs. Their DWARF instructions are decoded and
executed at runtime, to retrieve the whole backtrace. This
parser has been tested on both RISC-V and x86 architectures.

This feature needs esptool's merge adjacent ELF sections feature.
This commit is contained in:
Omar Chebib
2021-01-14 12:09:40 +08:00
parent 34c16dba93
commit b967dc0dbf
17 changed files with 1560 additions and 4 deletions

View File

@@ -116,3 +116,8 @@ REGION_ALIAS("rtc_data_location", rtc_iram_seg );
ASSERT(_flash_rodata_dummy_start == ORIGIN(default_rodata_seg),
".flash_rodata_dummy section must be placed at the beginning of the rodata segment.")
#endif
#if CONFIG_ESP_SYSTEM_USE_EH_FRAME
ASSERT ((_eh_frame_end > _eh_frame), "Error: eh_frame size is null!");
ASSERT ((_eh_frame_hdr_end > _eh_frame_hdr), "Error: eh_frame_hdr size is null!");
#endif