From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8056 invoked by alias); 22 Feb 2006 18:01:41 -0000 Received: (qmail 8048 invoked by uid 22791); 22 Feb 2006 18:01:40 -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 18:01:39 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FByIz-0007JU-G1; Wed, 22 Feb 2006 13:01:37 -0500 Date: Wed, 22 Feb 2006 18:11:00 -0000 From: Daniel Jacobowitz To: Jim Blandy Cc: gdb@sourceware.org Subject: Re: Quoting, backslashes, CLI and MI Message-ID: <20060222180137.GA27535@nevyn.them.org> Mail-Followup-To: Jim Blandy , gdb@sourceware.org References: <20060221213324.GA30729@nevyn.them.org> <8f2776cb0602212223p1b8fda93meb9b12e5d187b3b6@mail.gmail.com> <20060222142953.GA20393@nevyn.them.org> <8f2776cb0602220939i5189212ds8fb249747851cf72@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8f2776cb0602220939i5189212ds8fb249747851cf72@mail.gmail.com> 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/msg00294.txt.bz2 On Wed, Feb 22, 2006 at 09:39:55AM -0800, Jim Blandy wrote: > > Similar problems apply to the other listed MI commands. For instance, > > -exec-arguments ARGS; should it take a single string which is then > > split by buildargv into a vector, or should it take freeform text which > > is then split into an argument vector? Well, right now it takes a > > literal string, since it just passes the text to CLI "set args". > > That's saved as a string and then passed to create_inferior as a > > string, and eventually passed directly to a shell in the fork-child.c > > case. So, as un-MI-like as it is, I think I'd have to leave this one > > alone for now - it's just too big a can of worms! > > You'd have to rework a lot of code to make the quoting happen earlier. Actually, there's two different possibilities here, and I think I focused on the wrong one. 1. We want -exec-arguments to take MI-quoted individual arguments, which are then passed as argv elements to the program. 2. We want -exec-arguments to take a single MI-quoted argument, which is the value to set the argument string to, for the target and/or shell to handle however they deem appropriate. Doing (1) would require a lot of reworking, but more-or-less-kind-of preserve the current semantics, for common cases - it would probably be incompatible at the edge cases. Doing (2) would be a clear MI interface change, but the result seems somewhat sensible. WDYT? Then there's the question of what to do with CLI "set args". People use this today and it is passed literally to the program, without any interpretation of quotes or escapes - if you want that to happen you wait for the shell to do it. I don't think that we can really change that - we can bump the interface version on MI, but we can't really bump it on our CLI users' fingers :-) So CLI "set args" will need to continue being unescaped, one way or another. -- Daniel Jacobowitz CodeSourcery