binutils-gdb/gdb/doc
Andrew Burgess bf3386f0c1 gdb: change 'maint info section' to use command options
The 'maintenance info sections' command currently takes a list of
filters on the command line.  It can also accept the magic string
'ALLOBJ' which acts more like a command line flag, telling the command
to print information about all objfiles.

The manual has this to say about the options and filters:

  ... In addition, 'maint info sections' provides the following
  command options (which may be arbitrarily combined): ...

Implying (to me at least) that I can do this:

  (gdb) maint info sections ALLOBJ READONLY

to list all the read-only sections from all currently loaded object
files.

Unfortunately, this doesn't work.  The READONLY filter will work, but
ALLOBJ will not be detected correctly.

It would be fairly simple to fix the ALLOBJ detection.  However, I
dislike this mixing of command options (ALLOBJ) with command data (the
filters, e.g. READONLY, etc).

As this is a maintenance command, so not really intended for end
users, I think we can be a little more aggressive in "fixing" the
option parsing.  So that's what I do in this commit.

The ALLOBJ mechanism is replaced with a real command
option (-all-objects).  The rest of the command operates just as
before.  The example above would now become:

  (gdb) maint info sections -all-objects READONLY

The manual has been updated, and I added a NEWS entry to document the
change.

gdb/ChangeLog:

	* NEWS: Mention changes to 'maint info sections'.
	* maint.c (match_substring): Return a bool, fix whitespace issue.
	(struct single_bfd_flag_info): New struct.
	(bfd_flag_info): New static global.
	(match_bfd_flags): Return a bool, use bfd_flag_info.
	(print_bfd_flags): Use bfd_flag_info.
	(maint_print_section_info): Delete trailing whitespace.
	(struct maint_info_sections_opts): New struct.
	(maint_info_sections_option_defs): New static global.
	(maint_info_sections_completer): New function.
	(maintenance_info_sections): Use option parsing mechanism.
	(_initialize_maint_cmds): Register command completer.

gdb/doc/ChangeLog:

	* gdb.texinfo (Files): Update documentation for 'maint info
	sections'.

gdb/testsuite/ChangeLog:

	* gdb.base/maint-info-sections.exp: Update expected output, and
	add additional tests. Again.
2021-02-11 10:26:19 +00:00
..
.gitignore
a4rc.sed
agentexpr.texi Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
all-cfg.texi Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
annotate.texinfo Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
ChangeLog gdb: change 'maint info section' to use command options 2021-02-11 10:26:19 +00:00
doxy-index.in Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
Doxyfile-base.in Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
Doxyfile-gdb-api.in Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
Doxyfile-gdb-xref.in Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
Doxyfile-gdbserver.in Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
fdl.texi
filter-for-doxygen
filter-params.pl
gdb.texinfo gdb: change 'maint info section' to use command options 2021-02-11 10:26:19 +00:00
gpl.texi
guile.texi Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
lpsrc.sed
Makefile.in Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
psrc.sed
python.texi gdb: return true in TuiWindow.is_valid only if TUI is enabled 2021-02-08 11:56:16 +00:00
refcard.tex Manual updates of copyright year range not covered by gdb/copyright.py 2021-01-01 12:13:21 +04:00
stabs.texinfo Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
stack_frame.eps
stack_frame.pdf
stack_frame.png
stack_frame.svg
stack_frame.txt