Re: How to support interrupting a single step
Luis Machado <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
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.