From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10846 invoked by alias); 22 Feb 2006 19:34:15 -0000 Received: (qmail 10838 invoked by uid 22791); 22 Feb 2006 19:34:14 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 22 Feb 2006 19:34:13 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FBzkZ-00083L-0p; Wed, 22 Feb 2006 14:34:11 -0500 Date: Wed, 22 Feb 2006 19:51:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: gdb@sourceware.org Subject: Re: Quoting, backslashes, CLI and MI Message-ID: <20060222193410.GB30642@nevyn.them.org> Mail-Followup-To: Eli Zaretskii , gdb@sourceware.org References: <20060221213324.GA30729@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00306.txt.bz2 On Wed, Feb 22, 2006 at 09:22:18PM +0200, Eli Zaretskii wrote: > > Date: Tue, 21 Feb 2006 16:33:24 -0500 > > From: Daniel Jacobowitz > > > > I think that we want to continue using buildargv-style quoting for CLI > > commands, and that it would be desirable to use only MI-style > > quoting for MI commands. > > I agree. But that means MI commands that delegate to CLI will have to > process the arguments to modify the quoting, right? Right - or stop delegating to the CLI, which is what I think I would do. Especially since it turned out that there were only about a dozen. > > So I think that we should take this opportunity to fix up all MI > > commands to quote like the documentation says they do. > > It would be good to fix that now, yes. > > However, I Think we need 2 different styles of quoting: one for file > names, the other for strings. Otherwise, supporting the Windows > backslashes will be hard. Also, there are messy cases such as this: > > (gdb) break "foo bar.c":'MyClass::MyMethod' > > (I'm not even sure I quoted it correctly ;-). Can we really use the > same quoting rules for both the file-name and class/method name in > such situations? Well, are you talking about the CLI here, or about the MI? Supporting Windows backslashes isn't hard - but we would have to document that they must be doubled (A) on the CLI, and (B) within double-quoted MI arguments. Which is already how things work in many cases; for instance: (gdb) file .\T_MATH.elf .T_MATH.elf: No such file or directory. (gdb) file .\\T_MATH.elf Reading symbols... I'd like for the quoting rules to be independent of what's being quoted. Break is a particularly confusing example that I had not considered in depth. linespec.c needs to receive the quotes, because they affect how the linespec is interpreted (which I think is somewhat horrid, but anyway, moving on, leave that for another day). In MI, this means you ought to be doing things like this, for your example: (gdb) break "foo bar.c":'MyClass::MyMethod' -break-insert "\"foo bar.c\":'MyClass::MyMethod'" Fortunately, -break-insert is already a real MI command - so this is already how it behaves. > > I'd like to fix up all the CLI and "set" commands to use buildargv style > > quoting, too. > > If you agree with me on the two quoting styles, you will also agree > that we need two different flavors of buildargv. I don't think I agree, although Jim's pointed out "set args" and var_*integer, so not all set commands can be handled this way. Some new documentation will definitely be written! > > Andrew Cagney pointed out in a PR that we might need to update the > > readline filename completion, too. I'm not sure if that's still relevant, > > it needs a third look. > > It's relevant, at least wrt backslashes in Windows file names: if you > type TAB with backslash being the last character, completion won't > work (it does TRT when there are backslashes further to the left of > the cursor, though). Also, quoted file names, with or without > whitespace, aren't completed correctly, no matter if they use forward > or backslashes. Thanks. Another day, another bug. -- Daniel Jacobowitz CodeSourcery