aboutsummaryrefslogtreecommitdiff
path: root/gdb/NEWS
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2021-05-18 14:27:25 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2021-06-25 20:54:29 +0100
commitbd742128ba3b0eebda581a26c5bfa52ac0995584 (patch)
treeda0044bc2b93ad6a437c37247f79deedcfab4818 /gdb/NEWS
parent1fb1ce02fc0e311c1dede3f2b992c9fc31124d6d (diff)
downloadgdb-bd742128ba3b0eebda581a26c5bfa52ac0995584.zip
gdb-bd742128ba3b0eebda581a26c5bfa52ac0995584.tar.gz
gdb-bd742128ba3b0eebda581a26c5bfa52ac0995584.tar.bz2
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.
Diffstat (limited to 'gdb/NEWS')
-rw-r--r--gdb/NEWS6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/NEWS b/gdb/NEWS
index f37ad42..7f3ed4f 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -221,6 +221,12 @@ ptype[/FLAGS] TYPE | EXPRESSION
offsets of struct members. Default behavior is given by 'show print
type hex'.
+info sources
+ The info sources command output has been restructured. The results
+ are now based around a list of objfiles (executable and libraries),
+ and for each objfile the source files that are part of that objfile
+ are listed.
+
* Removed targets and native configurations
ARM Symbian arm*-*-symbianelf*