That's not correct, unfortunately. A packet containing
<symbol><cntrl-C>, sure, that's easy. But <retry><cntrl-C> is pretty
hard. The call stack at this point goes through the middle of
libthread_db; I can't resume the inferior to give it a real SIGINT
without have to jump through hoops to re-initialize libthread_db after
processing the SIGINT, so I would have to:
- stop all other running threads, if there are any; there could be
depending on what libthread_db is trying to look up
- forge a stop-with-SIGINT packet
- handle whatever packets GDB sends me while I'm stopped
- wait for GDB to resume
- cause the resume to trigger re-issue of the queued qSymbol "stop
response"
- repeat until this succeeds
- return that result to libthread_db
The long and short of it is that I'd have to duplicate or considerably
modularize the packet processing, to make the main loop re-entrant, to
support interruption of an otherwise non-blocking operation.