From e5026b2e07b1362c17f349379fd79c8e412d1ec9 Mon Sep 17 00:00:00 2001 From: Alexey Lapshin Date: Tue, 4 Mar 2025 17:05:30 +0700 Subject: [PATCH] fix(gdbstub): fix segfault when a non-running task is selected --- components/esp_gdbstub/src/gdbstub.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/esp_gdbstub/src/gdbstub.c b/components/esp_gdbstub/src/gdbstub.c index 830dced54d..4860cdcba6 100644 --- a/components/esp_gdbstub/src/gdbstub.c +++ b/components/esp_gdbstub/src/gdbstub.c @@ -369,6 +369,9 @@ void gdbstub_handle_debug_int(esp_gdbstub_frame_t *regs_frame) * */ void esp_gdbstub_init(void) { +#ifdef CONFIG_ESP_GDBSTUB_SUPPORT_TASKS + s_scratch.paniced_task_index = GDBSTUB_CUR_TASK_INDEX_UNKNOWN; +#endif esp_intr_alloc(ETS_UART0_INTR_SOURCE, 0, esp_gdbstub_int, NULL, NULL); esp_gdbstub_init_dports(); }