public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCHv2 5/5] gdb: change info sources to group results by objfile
Date: Wed, 19 May 2021 14:53:16 +0300	[thread overview]
Message-ID: <838s4bq6s3.fsf@gnu.org> (raw)
In-Reply-To: <f2dc337c5bbd116c7d75e74fe293402732a52b40.1621421987.git.andrew.burgess@embecosm.com> (message from Andrew Burgess on Wed, 19 May 2021 12:12:42 +0100)

> From: Andrew Burgess <andrew.burgess@embecosm.com>
> Date: Wed, 19 May 2021 12:12:42 +0100
> 
> 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:
>   (Full debug information has not yet been read for this file.)
> 
>   system-supplied DSO at 0x7ffff7fcf000:
>   (Full debug information has not yet been read for this file.)
> 
>   /tmp/info-sources/libhelper.so:
> 
>   /tmp/info-sources/helper.c, /usr/include/stdc-predef.h,
>   /tmp/info-sources/header.h
> 
>   /lib64/libc.so.6:
>   (Full debug information has not yet been read for this file.)
> 
>   (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.
> 
> 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.

Thanks, the documentation parts are OK.

  reply	other threads:[~2021-05-19 11:53 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 17:06 [PATCH 0/4] New option for 'info sources', also better MI support Andrew Burgess
2021-04-26 17:07 ` [PATCH 1/4] gdb: add new function quick_symbol_functions::has_unexpanded_symbols Andrew Burgess
2021-05-13 14:38   ` Simon Marchi
2021-05-13 17:29     ` Tom Tromey
2021-05-13 14:46   ` Simon Marchi
2021-04-26 17:07 ` [PATCH 2/4] gdb: make struct output_source_filename_data more C++ like Andrew Burgess
2021-05-13 14:58   ` Simon Marchi
2021-04-26 17:07 ` [PATCH 3/4] gdb: add new -group-by-binary flag to info sources command Andrew Burgess
2021-04-26 17:34   ` Eli Zaretskii
2021-05-13 15:05   ` Simon Marchi
2021-05-15  8:45     ` Andrew Burgess
2021-05-15 13:19       ` Simon Marchi
2021-04-26 17:07 ` [PATCH 4/4] gdb/mi: extend -file-list-exec-source-files command Andrew Burgess
2021-04-26 17:39   ` Eli Zaretskii
2021-05-13 15:47   ` Simon Marchi
2021-05-13 10:34 ` [PATCH 0/4] New option for 'info sources', also better MI support Andrew Burgess
2021-05-19 11:12 ` [PATCHv2 0/5] "info sources" - group by objfile Andrew Burgess
2021-05-19 11:12   ` [PATCHv2 1/5] gdb: add new function quick_symbol_functions::has_unexpanded_symbols Andrew Burgess
2021-05-19 11:12   ` [PATCHv2 2/5] gdb: make struct output_source_filename_data more C++ like Andrew Burgess
2021-05-19 11:12   ` [PATCHv2 3/5] gdb/mi: add regexp filtering to -file-list-exec-source-files Andrew Burgess
2021-05-19 11:51     ` Eli Zaretskii
2021-05-19 11:12   ` [PATCHv2 4/5] gdb/mi: add new --group-by-objfile flag for -file-list-exec-source-files Andrew Burgess
2021-05-19 11:44     ` Eli Zaretskii
2021-05-19 11:12   ` [PATCHv2 5/5] gdb: change info sources to group results by objfile Andrew Burgess
2021-05-19 11:53     ` Eli Zaretskii [this message]
2021-06-03 13:08     ` Simon Marchi
2021-06-03  9:27   ` [PATCHv2 0/5] "info sources" - group " Andrew Burgess
2021-06-03 13:15     ` Simon Marchi
2021-06-07 18:32   ` [PATCHv3 " Andrew Burgess
2021-06-07 18:32     ` [PATCHv3 1/5] gdb: add new function quick_symbol_functions::has_unexpanded_symbols Andrew Burgess
2021-06-07 18:32     ` [PATCHv3 2/5] gdb: make struct output_source_filename_data more C++ like Andrew Burgess
2021-07-05 12:31       ` Tom de Vries
2021-07-26 13:21         ` Andrew Burgess
2021-06-07 18:32     ` [PATCHv3 3/5] gdb/mi: add regexp filtering to -file-list-exec-source-files Andrew Burgess
2021-06-07 18:32     ` [PATCHv3 4/5] gdb/mi: add new --group-by-objfile flag for -file-list-exec-source-files Andrew Burgess
2021-06-07 18:32     ` [PATCHv3 5/5] gdb: change info sources to group results by objfile Andrew Burgess
2021-06-21 12:02     ` PING! Re: [PATCHv3 0/5] "info sources" - group " Andrew Burgess
2021-06-25 20:08       ` Andrew Burgess

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=838s4bq6s3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).