The "remote serial protocol", which was enhanced with several features, is used as communication protocol between the modified GDB Server and the host PC (figure 3).
The protocol thereby consists of three parts: The first part is a header byte at the beginning of the data stream. Following this is the data part, which contains the packet data. Since the probability of a consecutive redundancy in the packet data stream is very high, a compression algorithm was inserted that consolidates equal parts in the data stream.
By means of this method, not only can more information per packet be transferred, but also the transfer of identical successive patterns is prevented. As completion of the actual data, follows 1 Byte as terminating character, followed by a 1 Byte width checksum. The checksum is calculated from the cross total of the payload stream and serves as protection against manipulation or damage. Due to the checksum length and its structure, a reconstruction of the data stream with help of it is not possible.
Fig 3: Construction of the remote serial protocol (simplified representation)
To see a bigger version of this graphic click here.
The execution-mode debugging described can always then be meaningfully used when the main attention is paid to the application development. With this constellation for the debugging, a halt of the entire system is definitely not necessary (figure 4).
Fig 4: Linux application debugging (execution-mode) with the Universal Debug Engine (UDE)
To see a bigger version of this graphic click here.
Kernel and application debugging (freeze-mode debugging)
In contrast to execution-mode debugging, freeze-mode debugging is mainly applied for debugging of the kernel. The main difference is that the entire system is halted when a break point is reached. This debug method has proven useful if, for example, with kernel oops/OOMs the boot process of the Linux kernel must be examined, the loading or unloading of a driver module fails or the driver has to be checked for faults or performance bottlenecks during operation.
All standard debug functions can be used as tools, such as: the setting of code or data breakpoints, step-in/step-over routines, asynchronous breaks triggered by the user or the read out of the "call stack".