From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id vE2QIMSRIWCRSAAAWB0awg (envelope-from ) for ; Mon, 08 Feb 2021 14:32:20 -0500 Received: by simark.ca (Postfix, from userid 112) id 7891A1EF4F; Mon, 8 Feb 2021 14:32:20 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=DKIM_SIGNED,MAILING_LIST_MULTI, RDNS_NONE,T_DKIM_INVALID,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 21B091E4A3 for ; Mon, 8 Feb 2021 14:32:20 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CC63C3939C06; Mon, 8 Feb 2021 19:32:19 +0000 (GMT) Received: from gateway32.websitewelcome.com (gateway32.websitewelcome.com [192.185.145.189]) by sourceware.org (Postfix) with ESMTPS id 418463939C06 for ; Mon, 8 Feb 2021 19:32:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 418463939C06 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway32.websitewelcome.com (Postfix) with ESMTP id D0E355B8AC6 for ; Mon, 8 Feb 2021 13:32:16 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 9CGelk7q8iQiZ9CGel8MuN; Mon, 08 Feb 2021 13:32:16 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=rovT0jxXs0LziwMyPFBvEWGe/lPlQ4WpYPmiLqvTxB4=; b=cOz4MOe9mo8ZVBJM7Ylm/CuyGc abeF1ek8utkfQ8HNoGjfSqbBQ9r8vYyCz3AvP11FPi1sd0/pWmqUaG7LGWNr7p6JzLySPLppjzkcI XGaMmM8vNdiawOFN7TIpXNZiC; Received: from 97-122-91-54.hlrn.qwest.net ([97.122.91.54]:36986 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1l9CGe-001K5Z-G3; Mon, 08 Feb 2021 12:32:16 -0700 From: Tom Tromey To: Andrew Burgess Subject: Re: [PATCH 3/3] gdb: change 'maint info section' to use command options References: <46a0be74dee73dda27d6c9e20c149fa4bc6a89f9.1612560410.git.andrew.burgess@embecosm.com> X-Attribution: Tom Date: Mon, 08 Feb 2021 12:32:15 -0700 In-Reply-To: <46a0be74dee73dda27d6c9e20c149fa4bc6a89f9.1612560410.git.andrew.burgess@embecosm.com> (Andrew Burgess's message of "Fri, 5 Feb 2021 21:29:11 +0000") Message-ID: <87wnvifj9c.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.91.54 X-Source-L: No X-Exim-ID: 1l9CGe-001K5Z-G3 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-91-54.hlrn.qwest.net (murgatroyd) [97.122.91.54]:36986 X-Source-Auth: tom+tromey.com X-Email-Count: 11 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" >>>>> "Andrew" == Andrew Burgess writes: Andrew> The ALLOBJ mechanism is replaced with a real command Andrew> option (-all-objects). The rest of the command operates just as Andrew> before. The example above would now become: Andrew> (gdb) maint info sections -all-objects READONLY Nice. Andrew> gdb/ChangeLog: Andrew> * NEWS: Mention changes to 'maint info sections'. Andrew> * maint.c (match_substring): Return a bool, fix whitespace issue. Andrew> (struct single_bfd_flag_info): New struct. Andrew> (bfd_flag_info): New static global. Andrew> (match_bfd_flags): Return a bool, use bfd_flag_info. Andrew> (print_bfd_flags): Use bfd_flag_info. Andrew> (maint_print_section_info): Delete trailing whitespace. Andrew> (struct maint_info_sections_opts): New struct. Andrew> (maint_info_sections_option_defs): New static global. Andrew> (maint_info_sections_completer): New function. Andrew> (maintenance_info_sections): Use option parsing mechanism. Andrew> (_initialize_maint_cmds): Register command completer. I had one nit here. Andrew> +/* Vector of all the known bfd flags. */ Andrew> + Andrew> +static std::vector bfd_flag_info = Andrew> + { I don't think you need a vector (and thus a static constructor) here. Instead you can just use a "static const" array. The for-each statements will still work fine in this case. Somewhere I have a patch to remove some uses of ARRAY_SIZE in favor of this approach... thanks, Tom