Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 3/3] gdb: change 'maint info section' to use command options
Date: Mon, 08 Feb 2021 12:32:15 -0700	[thread overview]
Message-ID: <87wnvifj9c.fsf@tromey.com> (raw)
In-Reply-To: <46a0be74dee73dda27d6c9e20c149fa4bc6a89f9.1612560410.git.andrew.burgess@embecosm.com> (Andrew Burgess's message of "Fri, 5 Feb 2021 21:29:11 +0000")

>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> 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<single_bfd_flag_info> 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

      parent reply	other threads:[~2021-02-08 19:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 21:29 [PATCH 0/3] Changes to 'maint info sections' Andrew Burgess
2021-02-05 21:29 ` [PATCH 1/3] gdb/testsuite: split 'maint info sections' tests to a new file Andrew Burgess
2021-02-08 19:28   ` Tom Tromey
2021-02-05 21:29 ` [PATCH 2/3] gdb: 'maint info sections' - handle the no executable case Andrew Burgess
2021-02-08 19:29   ` Tom Tromey
2021-02-05 21:29 ` [PATCH 3/3] gdb: change 'maint info section' to use command options Andrew Burgess
2021-02-06  7:16   ` Eli Zaretskii via Gdb-patches
2021-02-08 19:32   ` Tom Tromey [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wnvifj9c.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox