From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 71495 invoked by alias); 1 Dec 2017 12:11:38 -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 71450 invoked by uid 89); 1 Dec 2017 12:11:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy= 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; Fri, 01 Dec 2017 12:11:36 +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 404CF61479 for ; Fri, 1 Dec 2017 12:11:35 +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 3FC3D5C54C; Fri, 1 Dec 2017 12:11:32 +0000 (UTC) Subject: Re: [PATCH v4] Make '{add-,}symbol-file' not care about the position of command line arguments To: Sergio Durigan Junior , GDB Patches References: <20171129214451.14257-1-sergiodj@redhat.com> <20171130195950.872-1-sergiodj@redhat.com> From: Pedro Alves Message-ID: <452db1ef-5ca5-0fd7-9029-e2047d24798c@redhat.com> Date: Fri, 01 Dec 2017 12:11: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: <20171130195950.872-1-sergiodj@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-12/txt/msg00020.txt.bz2 On 11/30/2017 07:59 PM, Sergio Durigan Junior wrote: > Changes from v3: > > - 'add-symbol-file -s' now accepts sections whose names start with a > dash. > > - Use a better way to test must-ask questions on the testsuite. > > > This is a bug that's been detected while doing the readnever work. > > If you use 'symbol-file' or 'add-symbol-file', the position of each > argument passed to the command matters. This means that if you do: > > (gdb) symbol-file -readnow /foo/bar > > The symbol file specified will (correctly) have all of its symbols > read by GDB (because of the -readnow flag). However, if you do: > > (gdb) symbol-file /foo/bar -readnow > > GDB will silently ignore the -readnow flag, because it was specified > after the filename. This is not a good thing to do and may confuse > the user. > > To address that, I've modified the argument parsing mechanisms of > symbol_file_command and add_symbol_file_command to be > "position-independent". I have also added one error call at the end > of add_symbol_file_command's argument parsing logic, which now clearly > complains if no filename has been specified. Both commands now > support the "--" option to stop argument processing. > > This patch provides a testcase for both commands, in order to make > sure that the argument order does not matter. It has been > regression-tested on BuildBot. > > gdb/ChangeLog: > > 2017-11-30 Sergio Durigan Junior > > * symfile.c (symbol_file_command): Call > 'symbol_file_add_main_1' only after processing all command > line options. > (add_symbol_file_command): Modify logic to make arguments > position-independent. > > gdb/testsuite/ChangeLog: > > 2017-11-30 Sergio Durigan Junior > > * gdb.base/relocate.exp: Add tests to guarantee that arguments > to 'symbol-file' and 'add-symbol-file' can be > position-independent. OK. Thanks, Pedro Alves