From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: Tom Tromey <tom@tromey.com>
Cc: Andrew Burgess <andrew.burgess@embecosm.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] gdb: Allow parenthesis to group arguments to user-defined commands
Date: Sat, 01 Sep 2018 15:36:00 -0000 [thread overview]
Message-ID: <1535816189.10641.3.camel@skynet.be> (raw)
In-Reply-To: <87zhx1qoxx.fsf@tromey.com>
On Sat, 2018-09-01 at 08:20 -0600, Tom Tromey wrote:
> > > > > > "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:
>
> Philippe> What about the alternative solution to allow a user defined
> Philippe> command to use $argu0, $argu1, $argu2, ... to do unquoted
> Philippe> expansion when needed ?
>
> I think the problem is that people want to write user-defined commands
> that act like other gdb commands, and in particular writing a
> user-defined that takes an expression is, by far, the most common case.
>
> But, this proposal would mean that "print" would have one style of
> quoting, while "user-print" would have another, drastically less nice,
> style.
Then maybe the conclusion is that we really need 2 different styles
of quoting:
* a quote mechanism to quote expressions, which then must have
a
'balanced' nr of open/close parenthesis.
* a quote mechanism (based on '
quoting) for
non expressions args.
Single quotes are already used by
several native gdb
commands (all gdb_argv based, and some others),
but
is (currently) poorly supported for user defined
commands, which must be
able to unquote an arg to pass
it to native commands that do not expect
quoted args.
Â
The $argu approach then should allow to write
user defined
commands that have the same behaviour
as the native commands.
E.g. I believe the
example 'info var for a bunch of REGEXP'
is not implementable today, would still
not be doable
with parenthesis quoting, but is I believe implementable
with the
$argu approach.
>
> Personally I think people should just write Python, since it is a much
> better way. But the CLI is more convenient, so here we are.
>
> Philippe> As far as I can see, gdb_argv is escaping single and double quotes, e.g.
> Philippe> (gdb) handle 10 'ignore this \'bidule'
> Philippe> Unrecognized or ambiguous flag word: "ignore this 'bidule".
> Philippe> (gdb)Â
>
> Yeah, I misremembered that. Thanks.
Well, before you pointed me at gdb_argv, I even did not know
it was existing :). So thanks to Andrew and you for this discussion,
I learned a lot about gdb from it.
Philippe
next prev parent reply other threads:[~2018-09-01 15:36 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-15 14:39 [PATCH 0/2] " Andrew Burgess
2018-08-15 14:39 ` [PATCH 1/2] gdb: Make testnames unique in gdb.base/commands.exp Andrew Burgess
2018-08-30 15:26 ` Tom Tromey
[not found] ` <eaa6d3a2975194a7ef3a2aa40e335c7986b205d8.1534343840.git.andrew.burgess@embecosm.com>
2018-08-15 18:24 ` [PATCH 2/2] gdb: Allow parenthesis to group arguments to user-defined commands Eli Zaretskii
2018-08-25 19:32 ` Philippe Waroquiers
2018-08-25 20:53 ` Philippe Waroquiers
2018-08-25 22:43 ` Andrew Burgess
2018-08-28 15:54 ` Tom Tromey
2018-08-28 18:43 ` Andrew Burgess
2018-08-28 20:29 ` Philippe Waroquiers
2018-08-28 23:29 ` Andrew Burgess
2018-08-30 2:19 ` Tom Tromey
2018-08-30 21:19 ` Philippe Waroquiers
2018-08-31 20:59 ` Tom Tromey
2018-09-01 11:10 ` Philippe Waroquiers
2018-09-01 14:20 ` Tom Tromey
2018-09-01 15:36 ` Philippe Waroquiers [this message]
2018-08-30 2:26 ` Tom Tromey
2018-09-06 23:29 ` [PATCHv2] gdb: Rewrite argument handling for " Andrew Burgess
2018-09-07 6:31 ` Eli Zaretskii
2018-09-07 20:36 ` Tom Tromey
2018-09-07 22:47 ` Andrew Burgess
2018-09-08 6:27 ` Eli Zaretskii
2018-09-08 5:35 ` Philippe Waroquiers
2018-09-08 14:33 ` Andrew Burgess
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1535816189.10641.3.camel@skynet.be \
--to=philippe.waroquiers@skynet.be \
--cc=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox