How to support interrupting a single step
Luis Machado
luis.machado@linaro.org
Fri Oct 18 13:08:00 GMT 2019
Hi,
On 9/4/19 12:24 PM, Torsten Robitzki wrote:
> Hi,
> Iâm writing a debug server to support the debugging of an ARM Cortex M4 (nRF52) controller via SWD (Bluetooth LE debugger). I have a test program that contains an endless loop (loops over a systick counter with masked PendSV, SysTick interrupts [C_MASKINTS]). If I run that program (âcâ package) and interrupt the execution by ctrl-C (0x03) and try to single step through the program, I canât get back onto the GDB prompt by cntr-C as I would expect.
>
> I can see that GDB is sending sequences of âsâ and âgâ packages and from the content of the âgâ I can see, that the $PC is moving. When I press ctrl-C, I can see that GDB is sending interrupts (0x03) to my debug stub, but as both, âsâ and âgâ are short running commands, there is no point in making them aware of an interrupt. Even if I would, I could tell, what the correct return values would be to make GDB stop sending `s` and `g` packages.
The behavior of GDB when dealing with a tight/endless loop is known. See
https://sourceware.org/bugzilla/show_bug.cgi?id=21221.
The problem of GDB sending lots of 's' and 'g' packets is also known,
but i thought it had been fixed a while ago. We tried to harden that
mechanism a bit more.
Are you running an older GDB version by any chance? If not, it may be a
good idea to file a ticket so we can take a look at it.
>
> Any idea, on how to make âstepâ in this scenario interruptable?
>
It should already be interruptible, but the timing and speed of
communications between GDB and the debug server tends to cause problems.
More information about the Gdb
mailing list