These algorithms generally only require attention if a new architecture requires a new capability. For instance, the Mitsubishi D10V is a Harvard architecture chip, and its split instruction and data spaces required changes to GDB's basic assumption of a flat uniform address space. The most important algorithm in GDB's target side is the one that does execution control. Remote Debugging Protocol GDB's standard remote debugging protocol is widely used. The target-side code is usually known as the GDB debugging stub, or just stub for short.
Numbers are always in hexadecimal.
The stub's response depends on the packet type. In many cases, the stub need only respond with OK, while in the case of register and memory reads, it should return a string of hex digits with all the data run together. In the case of stepping and continuing, the stub should come back with the signal that caused the program to stop. The signals mimic Unix signals, although for embedded they are just agreed-upon numbers. For instance, GDB declares traps to be signal 5, so if the target program hits a breakpoint trap, the stub will come back with S05.