From 5a70f0981fb7158e6fe92b5a939bfd256a7d03c2 Mon Sep 17 00:00:00 2001 From: mikee47 Date: Sun, 14 Apr 2019 12:14:42 +0100 Subject: [PATCH] Remove `GDBSTUB_PAUSE_HARDWARE_TIMER` option and related code - it doesn't work --- Sming/gdb/gdbstub-cfg.h | 9 --------- Sming/gdb/gdbstub.cpp | 26 -------------------------- 2 files changed, 35 deletions(-) diff --git a/Sming/gdb/gdbstub-cfg.h b/Sming/gdb/gdbstub-cfg.h index d51f36e58d..e468ec1937 100644 --- a/Sming/gdb/gdbstub-cfg.h +++ b/Sming/gdb/gdbstub-cfg.h @@ -54,15 +54,6 @@ #define GDBSTUB_ENABLE_DEBUG 0 #endif -/* - * The HardwareTimer defaults to non-maskable mode, and will continue to operate whilst paused. - * Set this value to 1 to disable during a debugging exception, and restore it afterwards. - * Note that to debug HardwareTimer callback routines, the timer must be initialise in maskable mode. - */ -#ifndef GDBSTUB_PAUSE_HARDWARE_TIMER -#define GDBSTUB_PAUSE_HARDWARE_TIMER 0 -#endif - /* * Espressif provide a patched version of GDB which emits only those registered present in the lx106. * Set to 0 if an unpatched version of GDB is used. diff --git a/Sming/gdb/gdbstub.cpp b/Sming/gdb/gdbstub.cpp index 02322be236..cc216894c3 100644 --- a/Sming/gdb/gdbstub.cpp +++ b/Sming/gdb/gdbstub.cpp @@ -810,23 +810,6 @@ static void ATTR_GDBEXTERNFN emulLdSt() } } -/** - * @brief If the hardware timer is operating using non-maskable interrupts, we must explicitly stop it - * @param pause true to stop the timer, false to resume it - */ -static void pauseHardwareTimer(bool pause) -{ -#if GDBSTUB_PAUSE_HARDWARE_TIMER - static bool edgeIntEnable; - if(pause) { - edgeIntEnable = bitRead(READ_PERI_REG(EDGE_INT_ENABLE_REG), 1); - TM1_EDGE_INT_DISABLE(); - } else if(edgeIntEnable) { - TM1_EDGE_INT_ENABLE(); - } -#endif -} - // Main exception handler static void __attribute__((noinline)) gdbstub_handle_debug_exception_flash() { @@ -835,8 +818,6 @@ static void __attribute__((noinline)) gdbstub_handle_debug_exception_flash() bool isEnabled = gdb_state.enabled; if(isEnabled) { - pauseHardwareTimer(true); - bitSet(gdb_state.flags, DBGFLAG_DEBUG_EXCEPTION); if(singleStepPs >= 0) { @@ -881,10 +862,6 @@ static void __attribute__((noinline)) gdbstub_handle_debug_exception_flash() } gdb_state.flags = 0; - - if(isEnabled) { - pauseHardwareTimer(false); - } } // We just caught a debug exception and need to handle it. This is called from an assembly routine in gdbstub-entry.S @@ -901,14 +878,12 @@ void gdbstub_handle_exception() return; } - pauseHardwareTimer(true); bitSet(gdb_state.flags, DBGFLAG_SYSTEM_EXCEPTION); sendReason(); commandLoop(true, false); gdb_state.flags = 0; - pauseHardwareTimer(false); } #endif @@ -923,7 +898,6 @@ void ATTR_GDBINIT gdbstub_init() SD(ENABLE_EXCEPTION_DUMP); SD(ENABLE_CRASH_DUMP); SD(GDBSTUB_ENABLE_DEBUG); - SD(GDBSTUB_PAUSE_HARDWARE_TIMER); SD(GDBSTUB_GDB_PATCHED); SD(GDBSTUB_USE_OWN_STACK); SD(GDBSTUB_BREAK_ON_EXCEPTION);