[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 01/27] gdbstub: Add infrastructure to parse c
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] [PATCH v9 01/27] gdbstub: Add infrastructure to parse cmd packets |
Date: |
Tue, 14 May 2019 19:24:28 +0100 |
User-agent: |
mu4e 1.3.1; emacs 26.1 |
Jon Doron <address@hidden> writes:
> Signed-off-by: Jon Doron <address@hidden>
> ---
<snip>
> +
> +/*
> + * cmd_startswith -> cmd is compared using startswith
> + *
> + *
> + * schema definitions:
> + * Each schema parameter entry consists of 2 chars,
> + * the first char represents the parameter type handling
> + * the second char represents the delimiter for the next parameter
> + *
> + * Currently supported schema types:
> + * 'l' -> unsigned long (stored in .val_ul)
> + * 'L' -> unsigned long long (stored in .val_ull)
> + * 's' -> string (stored in .data)
> + * 'o' -> single char (stored in .opcode)
> + * 't' -> thread id (stored in .thread_id)
> + * '?' -> skip according to delimiter
> + *
> + * Currently supported delimiters:
> + * '?' -> Stop at any delimiter (",;:=\0")
> + * '0' -> Stop at "\0"
> + * '.' -> Skip 1 char unless reached "\0"
> + * Any other value is treated as the delimiter value itself
> + */
> +typedef struct GdbCmdParseEntry {
> + GdbCmdHandler handler;
> + const char *cmd;
> + union {
> + int flags;
> + struct {
> + int cmd_startswith:1;
> + };
> + };
This union seems a little over the top given flags isn't used AFAICT.
Why not just have a bool cmd_startswith for now? You can always expand
the structure later if you need to.
Otherwise:
Reviewed-by: Alex Bennée <address@hidden>
--
Alex Bennée