[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] Add GDB qAttached support
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] Add GDB qAttached support |
Date: |
Wed, 04 Feb 2015 15:06:07 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
On 2015-02-04 14:36, Pedro Alves wrote:
> Hi, I was skimming the list, and noticed:
>
> On 01/31/2015 10:28 AM, Jan Kiszka wrote:
>> @@ -1187,6 +1193,10 @@ static int gdb_handle_packet(GDBState *s, const char
>> *line_buf)
>> put_packet_binary(s, buf, len + 1);
>> break;
>> }
>> + if (strncmp(p, "Attached", 8) == 0) {
>
> 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.)
Thanks for the remark! Will update the patch using the easier readable
second variant.
Jan
signature.asc
Description: OpenPGP digital signature