Skip to content

Commit

Permalink
Remove GDBSTUB_PAUSE_HARDWARE_TIMER option and related code - it do…
Browse files Browse the repository at this point in the history
…esn't work
  • Loading branch information
mikee47 committed Apr 14, 2019
1 parent 6f4fd5b commit 5a70f09
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
9 changes: 0 additions & 9 deletions Sming/gdb/gdbstub-cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
26 changes: 0 additions & 26 deletions Sming/gdb/gdbstub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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) {
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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);
Expand Down

0 comments on commit 5a70f09

Please sign in to comment.