Here is a patch which uses the 'T' response to report the registers
which gdb generally needs, and implements the 'P' request to set only
a single register. The general effect is to avoid sending all the
register contents back and forth between gdb and the stub every time
the stub stops. This also implements the 'D' request which handles
the gdb detach command, so you can cleanly quit out of the debugger
and leave the target board running.