From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22613 invoked by alias); 27 Apr 2009 21:39:51 -0000 Received: (qmail 22595 invoked by uid 22791); 27 Apr 2009 21:39:50 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 27 Apr 2009 21:39:45 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n3RLdh9X008864; Mon, 27 Apr 2009 17:39:43 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n3RLdg4L025154; Mon, 27 Apr 2009 17:39:43 -0400 Received: from opsy.redhat.com (vpn-13-172.rdu.redhat.com [10.11.13.172]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n3RLdgfM031913; Mon, 27 Apr 2009 17:39:42 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 940183785BE; Mon, 27 Apr 2009 15:39:36 -0600 (MDT) To: Denis PILAT Cc: gdb-patches Subject: Re: [Fwd: Re: Patch to support spaces in filenames & paths] References: <4981BA17.2090501@st.com> From: Tom Tromey Reply-To: tromey@redhat.com In-Reply-To: <4981BA17.2090501@st.com> (Denis PILAT's message of "Thu\, 29 Jan 2009 15\:15\:51 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Date: Mon, 27 Apr 2009 21:39:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2009-04/txt/msg00743.txt.bz2 >>>>> "Denis" == Denis PILAT writes: Oops, I mistyped and sent a draft before I had finished. This is the same note with one minor addition at the end. Denis> Ping ! Sorry for the delay on this. I read both the patches for this issue, plus the thread on the mailing list. Denis> I read your comments and produce a new patch that uses gdb_buildargv Denis> (as Pedro suggested), inspired from add_symbol_file_command as well. I don't like this approach. With the current patch, we will accept a quoted expression. This seems very ugly to me. I wouldn't be surprised if completion failed in this case. And, given that I would not support a new command using a quoting scheme like this, it seems odd to allow one via refactoring. I think this problem can be addressed to some degree by more carefully parsing the address arguments. Second, concatenating the final arguments using a space is not completely correct, because it does not preserve the meaning of all possible expressions. This is a pedantic point, since such expressions are unlikely to be used here. In the long term, I would like to see gdb move toward a more uniform approach to parsing its arguments, and to allowing full expressions in more places. I don't think gdb_buildargv can be the foundation for that, though. Since there only seems to be a single argument that has a problem here, how about what Daniel suggested: a function that uses the same quoting rules as gdb_buildargv, but which only peels off a single argument? A few notes on the patch itself follow. Denis> I also removed lot of dead code in cli/cli-dump.c and Denis> fopen_with_cleanup is now used only locally, so removed from Denis> cli-dump.h. In this case, make the function static as well. Denis> Dump restore and append commands are impacted by this patch. I think this may need a documentation update. Denis> @@ -559,8 +515,14 @@ restore_command (char *args, int from_tt [...] Denis> + argv = gdb_buildargv (args); Denis> + make_cleanup_freeargv (argv); You have to save the first cleanup in a function and then either "do" or "discard" it before any return. Tom