With the default APP_RETRIEVE_LEN_ELF_SHA setting, core dump files only have a
truncated ELF SHA256 in them. Account for this when comparing the core dump SHA
with the app ELF SHA.
The comment says it returns the "SHA256 hash of the input ELF file", but this is
not true - it was the SHA256 hash of the output ELF file. As the parser may
change some bytes around in minor ways, these were often not the same.
The check that the app ELF file SHA256 matches the one stored in the core dump
would never fail, leading to gdb loading the wrong ELF file and either crashing
or producing misleading debug information.
Specifics:
The note_sec.name field was incorrectly read back as b'ESP_CORE_DUMP_INFO\x00E',
because the namesz length includes the terminating NUL byte and possible junk
padding bytes:
https://github.com/espressif/esp-idf/blob/master/components/espcoredump/src/core_dump_elf.c#L212
In addition, as 'note_sec.name' is a bytes object Python 3 would have never
successfully compared it with a string.
GDB now is standalone tool separated from toolchain due to frequent updates.
Added installation tests for the new tool.
Coredump tests are changed because they were wrong, see explanation:
esp32 objdump:
40084290 <esp_crosscore_int_send_yield>:
......
/builds/espressif/esp-idf/components/esp_system/crosscore_int.c:145
4008429c: 000090 retw
With previous GDB backtrace was:
#0 0x4008429c in esp_crosscore_int_send_yield (core_id=0) at /builds/espressif/esp-idf/components/esp_system/crosscore_int.c:144
This commit fixes the backtrace with the right line number:
#0 0x4008429c in esp_crosscore_int_send_yield (core_id=0) at /builds/espressif/esp-idf/components/esp_system/crosscore_int.c:145
Other tests changes have the same cause of fixing.
Closes https://github.com/espressif/esp-idf/issues/6334
For RISCV, backtrace generation on device is not possible without
including and parsing DWARF sections. We extract the crash task stack
and let the host generate the backtrace
Core dump integrity check can now be parametrized through menuconfig.
It can be performed on boot or ignored. When core dump is activated
in the menuconfig, the user can still check the core dump at any time
with the function `esp_core_dump_image_check()`.
Fix a bug where `esp_core_dump_image_get()` was not accessible
when core dump was disabled.
Closes https://github.com/espressif/esp-idf/issues/6620
When `DIS_USB_JTAG` eFuse is NOT burned (`False`), it is not possible
to set pins 18 and 19 as GPIOs. This commit solves this by manually
disabling USB JTAG when using pins 18 or 19.
The functions shall use `gpio_hal_iomux_func_sel` instead of
`PIN_FUNC_SELELECT`.
Add support to tasks stacks in RTC DRAM. Before this fix, any stack
in RTC DRAM would have been considered as corrupted, whichi is not
the case.
Fix a bug related to wrong parameters passed to esp_core_dump_get_stack.
Fix a bug reading fake stack memory, triggering a memory violation.
* Closes https://github.com/espressif/esp-idf/issues/6751
* Merges https://github.com/espressif/esp-idf/pull/6750
This commit includes the refactoring of the core dump feature. Thanks to
this refactoring, it is easier to integrate the support of RISC-V
architecture for this feature.
Fixes ESP-1758