[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] gdbstub: implement remote debugging protocol es
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] gdbstub: implement remote debugging protocol escapes for command receive |
Date: |
Fri, 5 May 2017 15:45:06 +0100 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
On Tue, May 02, 2017 at 10:32:40AM -0400, Doug Gale wrote:
> + } else {
> + /* decode repeat length */
> + int repeat = (unsigned char)ch - ' ' + 3;
> + if (s->line_buf_index + repeat >= sizeof(s->line_buf) - 1) {
> + /* that many repeats would overrun the command buffer */
> +#ifdef DEBUG_GDB
> + printf("gdbstub command buffer overrun,"
> + " dropping command\n");
> +#endif
> + s->state = RS_IDLE;
> + } else if (s->line_buf_index <= 2) {
Why s->line_buf_index <= 2? I expected s->line_buf_index < 1 since we
just need 1 character to clone for run-length decoding.
> + /* got a repeat but we have nothing to repeat */
> +#ifdef DEBUG_GDB
> + printf("gdbstub got invalid RLE sequence\n");
> +#endif
> + } else {
Missing s->state = RS_IDLE?
signature.asc
Description: PGP signature