[PATCH v3 7/9] winedbg: Define table for GDB qXfer command handlers.

Jinoh Kang jinoh.kang.kr at gmail.com
Wed Nov 17 02:24:28 CST 2021


On 11/17/21 03:43, Rémi Bernon wrote:
> On 11/16/21 17:51, Jinoh Kang wrote:
>> Replace the series of sscanf in packet_query with a dedicated qXfer
>> request parser function and a lookup into a predefined handler table.
>>
>> Signed-off-by: Jinoh Kang <jinoh.kang.kr at gmail.com>
>> ---
>>   programs/winedbg/gdbproxy.c | 218 ++++++++++++++++++++++++++----------
>>   1 file changed, 160 insertions(+), 58 deletions(-)
>>
> 
> To be honest I find the sscanf version much more readable, especially as gdb protocol is not always easy to follow,

I do too.  It's just that I couldn't figure out how to keep sscanf (with its
format specifiers) in the generalised parser.

The annex part of "libraries" and "threads" is always empty, but for
"features" it is not.  Therefore, extracting the annex part requires matching
a *possibly empty* sequence of characters in a desired character set.
'%[]' can no longer be used, as it requires at least one character.

Any suggestions are welcome.

> and the number of possible qxfer variants (3) doesn't really justify to use a dispatch table imho.> 
> Is this change solving anything in particular?

Apologies for not clarifying the purpose of this patch upfront.  The following two patches do depend
on this generalisation.

-- 
Sincerely,
Jinoh Kang



More information about the wine-devel mailing list