Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for the compilation of esp-gdbstub with SDK 3.0.0 in strict mode. #1582

Merged
merged 1 commit into from
Jan 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions Sming/third-party/.patches/esp-gdbstub.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/gdbstub.c b/gdbstub.c
index 5fc6633..fe655b8 100644
index 5fc6633..1df3b9c 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -8,6 +8,7 @@
Expand All @@ -10,39 +10,42 @@ index 5fc6633..fe655b8 100644
#include "ets_sys.h"
#include "eagle_soc.h"
#include "c_types.h"
@@ -72,6 +73,7 @@ the xthal stack frame struct.
@@ -72,6 +73,10 @@ the xthal stack frame struct.

void _xtos_set_exception_handler(int cause, void (exhandler)(struct XTensa_exception_frame_s *frame));
int os_printf_plus(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
+void xthal_set_intenable(unsigned);
+
+extern void ets_wdt_enable(void);
+extern void ets_wdt_disable(void);

#endif

@@ -575,6 +577,7 @@ void ATTR_GDBFN gdbstub_handle_debug_exception() {
@@ -575,6 +580,7 @@ void ATTR_GDBFN gdbstub_handle_debug_exception() {
}

sendReason();
+ xthal_set_intenable(0); // enable receiving UART bytes without interrupts
while(gdbReadCommand()!=ST_CONT);
if ((gdbstub_savedRegs.reason&0x84)==0x4) {
//We stopped due to a watchpoint. We can't re-execute the current instruction
@@ -627,6 +630,7 @@ static void ATTR_GDBFN gdb_exception_handler(struct XTensa_exception_frame_s *fr
@@ -627,6 +633,7 @@ static void ATTR_GDBFN gdb_exception_handler(struct XTensa_exception_frame_s *fr

ets_wdt_disable();
sendReason();
+ xthal_set_intenable(0); // enable receiving UART bytes without interrupts
while(gdbReadCommand()!=ST_CONT);
ets_wdt_enable();

@@ -706,6 +710,7 @@ static void ATTR_GDBFN uart_hdlr(void *arg, void *frame) {
@@ -706,6 +713,7 @@ static void ATTR_GDBFN uart_hdlr(void *arg, void *frame) {

ets_wdt_disable();
sendReason();
+ xthal_set_intenable(0); // enable receiving UART bytes without interrupts
while(gdbReadCommand()!=ST_CONT);
ets_wdt_enable();
//Copy any changed registers back to the frame the Xtensa HAL uses.
@@ -714,7 +719,7 @@ static void ATTR_GDBFN uart_hdlr(void *arg, void *frame) {
@@ -714,7 +722,7 @@ static void ATTR_GDBFN uart_hdlr(void *arg, void *frame) {
}

static void ATTR_GDBINIT install_uart_hdlr() {
Expand Down