[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] Add GDB qAttached support
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] Add GDB qAttached support |
Date: |
Wed, 4 Feb 2015 14:30:00 +0000 |
On 4 February 2015 at 13:36, Pedro Alves <address@hidden> wrote:
>
> This looks like it'd mishandle a future qAttached2 packet.
>
> It should be doing something like:
>
> if (strncmp(p, "Attached", 8) == 0 &&
> (p[8] == '\0' || p[8] == ':')) {
>
> or:
>
> if (strcmp(p, "Attached") == 0 || strncmp(p, "Attached:", 9) == 0) {
>
>
> Likewise other packets, if they have the same issue.
> (I'm not familiar with qemu's stub's internals.)
Looks like we get this wrong for a lot of our existing
query packet handling too... Maybe worth having a utility
function for "is this a foo query packet" rather than
raw strcmp/strncmp?
-- PMM