This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] gdb: Allow parenthesis to group arguments to user-defined commands
- From: Tom Tromey <tom at tromey dot com>
- To: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- Cc: Tom Tromey <tom at tromey dot com>, Andrew Burgess <andrew dot burgess at embecosm dot com>, gdb-patches at sourceware dot org
- Date: Sat, 01 Sep 2018 08:20:42 -0600
- Subject: Re: [PATCH 2/2] gdb: Allow parenthesis to group arguments to user-defined commands
- References: <cover.1534343840.git.andrew.burgess@embecosm.com> <eaa6d3a2975194a7ef3a2aa40e335c7986b205d8.1534343840.git.andrew.burgess@embecosm.com> <1535225533.1438.5.camel@skynet.be> <1535230403.1438.10.camel@skynet.be> <20180825224310.GA32506@embecosm.com> <87lg8q7ai7.fsf@tromey.com> <20180828184331.GJ32506@embecosm.com> <1535488137.7778.4.camel@skynet.be> <20180828232948.GK32506@embecosm.com> <1535663976.7778.12.camel@skynet.be> <87h8jaz1zz.fsf@tromey.com> <1535800196.10641.1.camel@skynet.be>
>>>>> "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.
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.
Tom