Skip to content

Commit

Permalink
coredump: allow coredump at panic even if gdbstub is used.
Browse files Browse the repository at this point in the history
  • Loading branch information
ESP-Marius committed Feb 17, 2023
1 parent ea6a2ca commit 60d3021
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions components/esp_system/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,6 @@ void esp_panic_handler(panic_info_t *info)
esp_panic_handler_reconfigure_wdts(1000); // restore WDT config
#endif // CONFIG_APPTRACE_ENABLE

#if CONFIG_ESP_SYSTEM_PANIC_GDBSTUB
disable_all_wdts();
wdt_hal_write_protect_disable(&rtc_wdt_ctx);
wdt_hal_disable(&rtc_wdt_ctx);
wdt_hal_write_protect_enable(&rtc_wdt_ctx);
panic_print_str("Entering gdb stub now.\r\n");
esp_gdbstub_panic_handler((void *)info->frame);
#else
#if CONFIG_ESP_COREDUMP_ENABLE
static bool s_dumping_core;
if (s_dumping_core) {
Expand All @@ -379,6 +371,14 @@ void esp_panic_handler(panic_info_t *info)
}
#endif /* CONFIG_ESP_COREDUMP_ENABLE */

#if CONFIG_ESP_SYSTEM_PANIC_GDBSTUB
disable_all_wdts();
wdt_hal_write_protect_disable(&rtc_wdt_ctx);
wdt_hal_disable(&rtc_wdt_ctx);
wdt_hal_write_protect_enable(&rtc_wdt_ctx);
panic_print_str("Entering gdb stub now.\r\n");
esp_gdbstub_panic_handler((void *)info->frame);
#else
#if CONFIG_ESP_SYSTEM_PANIC_REBOOT_DELAY_SECONDS
// start RTC WDT if it hasn't been started yet and set the timeout to more than the delay time
wdt_hal_init(&rtc_wdt_ctx, WDT_RWDT, 0, false);
Expand Down

0 comments on commit 60d3021

Please sign in to comment.