I want to implement better debugger single stepping on the esp8266.
I am able to use the icount/icountlevel registers for that to debug user level tasks at intlevel 0.
My problem is that the intlevel1 handler executes some code at intlevel 0, too.
That leads to the following:
The debugger stopped at some user level code.
I do an assembler level single step that is translated into icount.
An int1 interrupt occurs and as soon as the int1 handler lowers its intlevel the debugger stops one instruction
later.
We end up in the int handler instead of the user code.
I thought about checking the instruction at program counter before single step, remembering
the next pc or possible branch pc and continuing single stepping in debug handler until one of
those is matched. But that would reduce execution speed by at least a factor of 10.
Has anyone a better idea?
Cal