Re: [re: PATCH v2 00/15 - 03/11] dyndbg: disambiguate quoting in a debug msg

From: Petr Mladek
Date: Mon Dec 18 2023 - 11:34:25 EST


On Thu 2023-12-07 17:15:06, Jim Cromie wrote:
> When debugging a query parsing error, the debug message wraps the
> query in escaped-double-quotes. This is confusing when mixed with any
> quoted args where quotes are stripped by the shell.
>
> So this replaces the \"%s\" with <%s> in the format string, allowing a
> user to see how the shell strips quotes:
>
> lx]# echo module "foo" format ,_ -f > /proc/dynamic_debug/control
> [ 716.037430] dyndbg: read 26 bytes from userspace
> [ 716.037966] dyndbg: query 0: <module foo format ,_ -f> on module: <*>

Could you provide a real life example, please? It is hard to imagine
what '"foo" format' means in a real life.

Also could you please provide output before and after?

Honestly, Using <> as quotes looks pretty non-standard and confusing
to me. Also this changes only one place but '\"' is used in many
other locations which would make dyndbg messages even more confusing.

I do not understand how this would help. The double quote is gone
even in this variant.

BTW: It is a bit funny that this patch is supposed to make the debug
message better readable. For me, the echo command is hard
to read in the first place. I would use:

lx]# echo "module $my_module ,_ -f" > /proc/dynamic_debug/control

Maybe, this change fixes the output to match some personal style.
I wonder how common is the style. I can't remember seeing:

$> echo param param param

Instead I frequently see:

$> echo "bla bla bla".

Best Regards,
Petr