binutils-gdb/gdb/doc
Andrew Burgess bd742128ba gdb: change info sources to group results by objfile
Currently the 'info sources' command lists all of the known source
files together, regardless of their source, e.g. here is a session
debugging a test application that makes use of a shared library:

  (gdb) info sources
  Source files for which symbols have been read in:

  /tmp/info-sources/test.c, /usr/include/stdc-predef.h,
  /tmp/info-sources/header.h, /tmp/info-sources/helper.c

  Source files for which symbols will be read in on demand:

  (gdb)

In this commit I change the format of the 'info sources' results so
that the results are grouped by the object file that uses that source
file.  Here's the same session with the new output format:

  (gdb) info sources
  /tmp/info-sources/test.x:

  /tmp/info-sources/test.c, /usr/include/stdc-predef.h,
  /tmp/info-sources/header.h

  /lib64/ld-linux-x86-64.so.2:
  (Objfile has no debug information.)

  system-supplied DSO at 0x7ffff7fcf000:
  (Objfile has no debug information.)

  /tmp/info-sources/libhelper.so:

  /tmp/info-sources/helper.c, /usr/include/stdc-predef.h,
  /tmp/info-sources/header.h

  /lib64/libc.so.6:
  (Objfile has no debug information.)

  (gdb)

Notice that in the new output some source files are repeated,
e.g. /tmp/info-sources/header.h, as multiple objfiles use this source
file.

Further, some object files are tagged with the message '(Objfile has
no debug information.)', it is also possible to see the message '(Full
debug information has not yet been read for this file.)', which is
printed when some symtabs within an objfile have not yet been
expanded.

All of the existing regular expression based filtering still works.

An original version of this patch added the new format as an option to
'info sources', however, it was felt that the new layout was so much
better than the old style that GDB should just switch to the new
result format completely.

gdb/ChangeLog:

	* NEWS: Mention changes to 'info sources'.
	* symtab.c (info_sources_filter::print): Delete.
	(struct output_source_filename_data) <print_header>: Delete
	declaration.  <printed_filename_p>: New member function.
	(output_source_filename_data::print_header): Delete.
	(info_sources_worker): Update group-by-objfile style output to
	make it CLI suitable, simplify non-group-by-objfile now this is
	only used from the MI.
	(info_sources_command): Make group-by-objfile be the default for
	CLI info sources command.
	* symtab.h (struct info_sources_filter) <print>: Delete.

gdb/doc/ChangeLog:

	* gdb.texinfo (Symbols): Document new output format for 'info
	sources'.

gdb/testsuite/ChangeLog:

	* gdb.base/info_sources_2-header.h: New file.
	* gdb.base/info_sources_2-lib.c: New file.
	* gdb.base/info_sources_2-test.c: New file.
	* gdb.base/info_sources_2.exp: New file.
2021-06-25 20:54:29 +01:00
..
.gitignore
a4rc.sed
agentexpr.texi
all-cfg.texi
annotate.texinfo
ChangeLog gdb: change info sources to group results by objfile 2021-06-25 20:54:29 +01:00
doxy-index.in
Doxyfile-base.in
Doxyfile-gdb-api.in
Doxyfile-gdb-xref.in
Doxyfile-gdbserver.in
fdl.texi
filter-for-doxygen
filter-params.pl
gdb.texinfo gdb: change info sources to group results by objfile 2021-06-25 20:54:29 +01:00
gpl.texi
guile.texi gdb/guile: allow for catchpoint type breakpoints in guile 2021-06-25 18:22:05 +01:00
lpsrc.sed
Makefile.in
psrc.sed
python.texi gdb/python: allow for catchpoint type breakpoints in python 2021-06-25 18:22:07 +01:00
refcard.tex
stabs.texinfo
stack_frame.eps
stack_frame.pdf
stack_frame.png
stack_frame.svg
stack_frame.txt