From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19416 invoked by alias); 13 Jan 2010 20:13:36 -0000 Received: (qmail 19395 invoked by uid 22791); 13 Jan 2010 20:13:35 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Jan 2010 20:13:28 +0000 Received: (qmail 4451 invoked from network); 13 Jan 2010 20:13:27 -0000 Received: from unknown (HELO wind.localnet) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 13 Jan 2010 20:13:27 -0000 From: Vladimir Prus To: gdb-patches@sourceware.org Subject: Re: Make -exec-run and -exec-until into 'real' MI commands Date: Wed, 13 Jan 2010 20:13:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-14-generic-pae; KDE/4.3.2; i686; ; ) References: <201001131629.25873.vladimir@codesourcery.com> <20100113200953.GA3955@caradoc.them.org> In-Reply-To: <20100113200953.GA3955@caradoc.them.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201001132313.24694.vladimir@codesourcery.com> 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 X-SW-Source: 2010-01/txt/msg00355.txt.bz2 On Wednesday 13 January 2010 23:09:58 Daniel Jacobowitz wrote: > On Wed, Jan 13, 2010 at 04:29:25PM +0300, Vladimir Prus wrote: > > > > At present, '-exec-run' and '-exec-until' are directly routed > > to CLI, with very little MI intervention. I have tried to fix > > that before, but there were backward compatibility concerns. > > > > While working on multiexec MI patches, I really needed to have > > -exec-run handled in MI, so I've made another attempt, which > > is attached. Comments? > > How much compatibility are you looking for? > > It takes a long path through GDB, but the argument to -exec-run today > eventually gets passed to the shell with no additional quoting. If > I type: > > (gdb) run a b "a b" "\"" > > then GDB does: > > execve("/bin/zsh", ["/bin/zsh", "-c", "exec /usr/bin/gdb a b \"a b\" \"\\\"\""], [/* 64 vars */]) > > That's the same as typing at a shell prompt: > > exec /usr/bin/gdb a b "a b" "\"" > > Your patch doesn't undo the effect of mi_parse_argv, so this > won't be preserved. I think that only "\"" won't be preserved. While "a b" will be present in reconstructed string with quotes. > Can we just save the unparsed argv somehow? We can, but that would be ugly ... > I don't remember the previous time this came up, but are there front > ends that pass arguments to -exec-run? It's not documented as > accepting any. ... for the purpose of supporting frontends that use undocumented accidental feature, and worse, we don't know any such frontends. I believe the fact that no known frontends use args was raised the last time, but you still wanted to assume they exist. - Volodya > > - Volodya