[Patch] Implement run length encoding

Hi All,
This patch implements the run-length encoding used by the gdb protocol. As gdb reads data 1 byte at a time, it is able to handle RLE as it is putting data in the buffer. We read data in a chunk so I check for RLE on a packet when we have detected its boundary. Tested by running LLDB with gdbserver and also by manually inspecting the packet logs from both sides. Is it ok?


rle.patch (3.25 KB)

Looks fine to me.

Please checkout Virgil Bello's patch and see if his works for you? It does things differently by only expanding the packet when the packet is complete, which I like a bit better.

lldb-rle.diff (3.3 KB)