From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106518 invoked by alias); 30 Nov 2017 04:07:49 -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 106497 invoked by uid 89); 30 Nov 2017 04:07:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=BAYES_00,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=conclusion, impressed X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 30 Nov 2017 04:07:47 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9CA034E33B for ; Thu, 30 Nov 2017 04:07:46 +0000 (UTC) Received: from localhost (unused-10-15-17-193.yyz.redhat.com [10.15.17.193]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 730AB5C54B; Thu, 30 Nov 2017 04:07:46 +0000 (UTC) From: Sergio Durigan Junior To: Pedro Alves Cc: GDB Patches Subject: Re: [PATCH] Make 'symbol-file' not care about the position of command line arguments References: <779a2d21-badf-b54c-e1c9-2f869716fd71@redhat.com> <20171129214451.14257-1-sergiodj@redhat.com> <196b7212-6a93-8c39-a86e-c5782f470d1e@redhat.com> <87d140emfr.fsf@redhat.com> <87609seigv.fsf@redhat.com> Date: Thu, 30 Nov 2017 04:07:00 -0000 In-Reply-To: (Pedro Alves's message of "Thu, 30 Nov 2017 00:34:51 +0000") Message-ID: <87a7z49zou.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00821.txt.bz2 On Wednesday, November 29 2017, Pedro Alves wrote: > On 11/30/2017 12:08 AM, Sergio Durigan Junior wrote: >> On Wednesday, November 29 2017, Pedro Alves wrote: >> >> I'll wait until we reach a conclusion on whether this patch is useful or >> not, and then submit the testcase along with v2. > > I don't mind this going in, provided it comes with a testcase. I'm working on it right now. >>>> I've always considered that passing '--' is the de facto way >>>> of telling getopt (or argp) to stop processing. >>> >>> "--" is used to stop processing options when you want to pass >>> a non-option argument that starts with "-", like imagine if you >>> wanted to pass a filename that starts with "-" to symbol-file >>> (the filename is not an option.) >> >> Ah, true, that makes sense. >> > > ... which points out that we should really handle "--", for > the possibility of such filenames. > > (At some point we should really come up with some getopt-like > API that can be used by all the commands that also use gdb_argv, > to help with normalizing the interface, and also to make it > easier to add new options to commands.) That'd be super. It's been on my mind for quite some time, too. I'm impressed such interface doesn't exist yet. >>> Note that supporting non-option arguments before options >>> is impossible for commands that need to handle raw arguments. >>> I.e., commands that want to supporting passing arguments >>> arguments with spaces, without forcing the user to wrap it >>> all in quotes. Like "break -q function (int)", or >>> "print /x EXPRESSION_WITH_SPACES", etc. (I have a WIP series >>> that adds '-'-options to "print", btw.) >>> It's good to keep the possibility of the command being extended >>> in that direction in mind. It doesn't seem to be the case >>> here, but that's the angle I was coming from. >> >> I agree, but that's not the case with 'symbol-file' or >> 'add-symbol-file', right? > > Yes, that's what I said - "it doesn't seem to be the case here". > > Are we still negotiating? Can I get you to make > "add-symbol-file" process options in any position too? :-) Sure thing! I'll give it a try. Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/