From 004aadfe7076c646014a331f014f65bacec4d2b9 Mon Sep 17 00:00:00 2001 From: Jeroen Domburg Date: Fri, 2 Dec 2016 17:42:11 +0800 Subject: [PATCH] Fix small bug in gdbstub where it sometimes would not return a valid stop reason, timing out gdb. Also clean up the code a bit. --- components/esp32/gdbstub.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/components/esp32/gdbstub.c b/components/esp32/gdbstub.c index 819944a902..757725aad6 100644 --- a/components/esp32/gdbstub.c +++ b/components/esp32/gdbstub.c @@ -18,12 +18,9 @@ * it allows inspecting the ESP32 state *******************************************************************************/ -//ToDo: Clean up includes and sync to real rtos #include "rom/ets_sys.h" - #include "soc/uart_reg.h" #include "soc/io_mux_reg.h" - #include "esp_gdbstub.h" #include "driver/gpio.h" @@ -36,17 +33,10 @@ static char chsum; //Running checksum of the output packet #define ATTR_GDBFN -static void ATTR_GDBFN keepWDTalive() { - //ToDo for esp31/32 -} - - //Receive a char from the uart. Uses polling and feeds the watchdog. static int ATTR_GDBFN gdbRecvChar() { int i; - while (((READ_PERI_REG(UART_STATUS_REG(0))>>UART_RXFIFO_CNT_S)&UART_RXFIFO_CNT)==0) { - keepWDTalive(); - } + while (((READ_PERI_REG(UART_STATUS_REG(0))>>UART_RXFIFO_CNT_S)&UART_RXFIFO_CNT)==0) ; i=READ_PERI_REG(UART_FIFO_REG(0)); return i; } @@ -260,7 +250,11 @@ static void sendReason() { gdbPacketStart(); gdbPacketChar('T'); i=gdbRegFile.expstate&0x7f; - if (i