From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112124 invoked by alias); 30 Nov 2017 00:34:58 -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 112093 invoked by uid 89); 30 Nov 2017 00:34:57 -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 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 00:34:56 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 51C7C356EA for ; Thu, 30 Nov 2017 00:34:55 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id A83C160C89; Thu, 30 Nov 2017 00:34:52 +0000 (UTC) Subject: Re: [PATCH] Make 'symbol-file' not care about the position of command line arguments To: Sergio Durigan Junior 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> Cc: GDB Patches From: Pedro Alves Message-ID: Date: Thu, 30 Nov 2017 00:34:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <87609seigv.fsf@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-11/txt/msg00811.txt.bz2 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'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.) >> 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? :-) > I mean, their only non-option argument is the > FILE, which won't have spaces (or will, but they'll be quoted like they > should). > > Sorry for being so persistent, but I was bit by this bug and it wasn't > nice. Thanks, Pedro Alves