Merge branch 'bugfix/gdbstub_no_sync_gdb' into 'master'
Gdbstub: Fix bug, small cleanup Tianzhongxing found a small bug preventing gdbstub to work in certain cases. This fixes it, as well as including some minor cleanups. See merge request !260
This commit is contained in:
commit
9a774848d4
1 changed files with 6 additions and 13 deletions
|
@ -18,12 +18,9 @@
|
||||||
* it allows inspecting the ESP32 state
|
* it allows inspecting the ESP32 state
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
//ToDo: Clean up includes and sync to real rtos
|
|
||||||
#include "rom/ets_sys.h"
|
#include "rom/ets_sys.h"
|
||||||
|
|
||||||
#include "soc/uart_reg.h"
|
#include "soc/uart_reg.h"
|
||||||
#include "soc/io_mux_reg.h"
|
#include "soc/io_mux_reg.h"
|
||||||
|
|
||||||
#include "esp_gdbstub.h"
|
#include "esp_gdbstub.h"
|
||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
|
|
||||||
|
@ -36,17 +33,10 @@ static char chsum; //Running checksum of the output packet
|
||||||
|
|
||||||
#define ATTR_GDBFN
|
#define ATTR_GDBFN
|
||||||
|
|
||||||
static void ATTR_GDBFN keepWDTalive() {
|
|
||||||
//ToDo for esp31/32
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//Receive a char from the uart. Uses polling and feeds the watchdog.
|
//Receive a char from the uart. Uses polling and feeds the watchdog.
|
||||||
static int ATTR_GDBFN gdbRecvChar() {
|
static int ATTR_GDBFN gdbRecvChar() {
|
||||||
int i;
|
int i;
|
||||||
while (((READ_PERI_REG(UART_STATUS_REG(0))>>UART_RXFIFO_CNT_S)&UART_RXFIFO_CNT)==0) {
|
while (((READ_PERI_REG(UART_STATUS_REG(0))>>UART_RXFIFO_CNT_S)&UART_RXFIFO_CNT)==0) ;
|
||||||
keepWDTalive();
|
|
||||||
}
|
|
||||||
i=READ_PERI_REG(UART_FIFO_REG(0));
|
i=READ_PERI_REG(UART_FIFO_REG(0));
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -260,7 +250,11 @@ static void sendReason() {
|
||||||
gdbPacketStart();
|
gdbPacketStart();
|
||||||
gdbPacketChar('T');
|
gdbPacketChar('T');
|
||||||
i=gdbRegFile.expstate&0x7f;
|
i=gdbRegFile.expstate&0x7f;
|
||||||
if (i<sizeof(exceptionSignal)) return gdbPacketHex(exceptionSignal[i], 8); else gdbPacketHex(11, 8);
|
if (i<sizeof(exceptionSignal)) {
|
||||||
|
gdbPacketHex(exceptionSignal[i], 8);
|
||||||
|
} else {
|
||||||
|
gdbPacketHex(11, 8);
|
||||||
|
}
|
||||||
gdbPacketEnd();
|
gdbPacketEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,7 +334,6 @@ static int gdbReadCommand() {
|
||||||
sentchs[1]=gdbRecvChar();
|
sentchs[1]=gdbRecvChar();
|
||||||
ptr=&sentchs[0];
|
ptr=&sentchs[0];
|
||||||
rchsum=gdbGetHexVal(&ptr, 8);
|
rchsum=gdbGetHexVal(&ptr, 8);
|
||||||
// ets_printf("c %x r %x\n", chsum, rchsum);
|
|
||||||
if (rchsum!=chsum) {
|
if (rchsum!=chsum) {
|
||||||
gdbSendChar('-');
|
gdbSendChar('-');
|
||||||
return ST_ERR;
|
return ST_ERR;
|
||||||
|
|
Loading…
Reference in a new issue