]> granicus.if.org Git - esp-idf/commitdiff
coredump: Fixes exception stack frame structure indicator
authorAlexey Gerenkov <alexey@espressif.com>
Mon, 2 Jul 2018 15:10:34 +0000 (18:10 +0300)
committerAlexey Gerenkov <alexey@espressif.com>
Thu, 5 Jul 2018 19:20:20 +0000 (22:20 +0300)
Initializes exception stack frame EXIT field to indicate stack frame format for 'espcoredump'.

components/esp32/core_dump.c

index 56ce08b64a744d3927ef9aaa1ce7e47ef9044f1f..078afe93ba3998008512ecc4e8f47317df6223c2 100644 (file)
@@ -127,6 +127,10 @@ static void esp_core_dump_write(XtExcFrame *frame, core_dump_write_config_t *wri
         if (tasks[i].pxTCB == xTaskGetCurrentTaskHandleForCPU(xPortGetCoreID())) {
             // set correct stack top for current task
             tasks[i].pxTopOfStack = (StackType_t *)frame;
+            // This field is not initialized for crashed task, but stack frame has the structure of interrupt one,
+            // so make workaround to allow espcoredump to parse it properly.
+            if (frame->exit == 0)
+                frame->exit = -1;
             ESP_COREDUMP_LOG_PROCESS("Current task EXIT/PC/PS/A0/SP %x %x %x %x %x",
                 frame->exit, frame->pc, frame->ps, frame->a0, frame->a1);
         }