From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55672 invoked by alias); 15 Aug 2018 18:24:51 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 55115 invoked by uid 89); 15 Aug 2018 18:24:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.2 spammy=H*RU:sk:fencepo, Hx-spam-relays-external:sk:fencepo, H*r:eggs.gnu.org, H*r:4.71 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Aug 2018 18:24:45 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fq0TG-0002FA-Jp for gdb-patches@sourceware.org; Wed, 15 Aug 2018 14:24:42 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpxhW-0007WV-Qj; Wed, 15 Aug 2018 11:27:12 -0400 Received: from [176.228.60.248] (port=4481 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fpxhT-0005Il-W3; Wed, 15 Aug 2018 11:27:09 -0400 Date: Wed, 15 Aug 2018 18:24:00 -0000 Message-Id: <83zhxnirav.fsf@gnu.org> From: Eli Zaretskii To: Andrew Burgess CC: gdb-patches@sourceware.org In-reply-to: (message from Andrew Burgess on Wed, 15 Aug 2018 15:39:20 +0100) Subject: Re: [PATCH 2/2] gdb: Allow parenthesis to group arguments to user-defined commands References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00395.txt.bz2 > From: Andrew Burgess > Cc: Andrew Burgess > Date: Wed, 15 Aug 2018 15:39:20 +0100 > > When calling a user-defined command then currently, arguments are > whitespace separated. This means that it is impossible to pass a > single argument that contains a whitespace. > > The exception to the no whitespace rule is strings, a string argument, > enclosed in double, or single quotes, can contain whitespace. > > However, if a user wants to reference, for example, a type name that > contains a space, as in these examples: > > user_command *((unsigned long long *) some_pointer) > > user_command {unsigned long long}some_pointer > > then this will not work, as the whitespace between 'unsigned' and > 'long', as well as the whitespace between 'long' and 'long', will mean > GDB interprets this as many arguments. > > The solution proposed in this patch is to allow parenthesis to be used > to group arguments, so the use could now write: > > user_command (*((unsigned long long *) some_pointer)) > > user_command ({unsigned long long}some_pointer) > > And GDB will interpret these as a single argument. > > gdb/ChangeLog: > > * cli/cli-script.c (user_args::user_args): Allow parenthesis to > group arguments. > > gdb/testsuite/ChangeLog: > > * gdb.base/commands.exp (args_with_whitespace): New proc, which is > added to the list of procs to call. > * gdb.base/run.c (global_var): Defined global. > > gdb/doc/ChangeLog: > > * gdb.texinfo (Define): Additional documentation about argument > syntax. > --- > gdb/ChangeLog | 5 ++++ > gdb/cli/cli-script.c | 8 +++++- > gdb/doc/ChangeLog | 5 ++++ > gdb/doc/gdb.texinfo | 54 +++++++++++++++++++++++++++++++++---- > gdb/testsuite/ChangeLog | 6 +++++ > gdb/testsuite/gdb.base/commands.exp | 36 +++++++++++++++++++++++++ > gdb/testsuite/gdb.base/run.c | 3 +++ > 7 files changed, 111 insertions(+), 6 deletions(-) OK for the documentation parts. Thanks.