Show line numbers in output for "info var/func/type"

Message ID m3r2ntlv8u.fsf@oc1027705133.ibm.com
State New, archived
Headers

Commit Message

Andreas Arnez April 5, 2018, 11:59 a.m. UTC
  On Wed, Apr 04 2018, Eli Zaretskii wrote:

>> From: Andreas Arnez <arnez@linux.vnet.ibm.com>
>> Date: Wed, 04 Apr 2018 20:53:00 +0200
>> 
>> gdb/ChangeLog:
>> 
>> 	* symtab.c (print_symbol_info): Precede the symbol definition by
>> 	the line number when available.
>> 	* NEWS: Advertise this enhancement.
>
> Thanks, but I think the manual should also be updated.

OK.  How about the patch below?

> The NEWS part of the patch is OK.

Thanks!

--
Andreas
  

Comments

Eli Zaretskii April 5, 2018, 1:35 p.m. UTC | #1
> From: Andreas Arnez <arnez@linux.vnet.ibm.com>
> Cc: gdb-patches@sourceware.org
> Date: Thu, 05 Apr 2018 13:59:13 +0200
> 
> >> 	* symtab.c (print_symbol_info): Precede the symbol definition by
> >> 	the line number when available.
> >> 	* NEWS: Advertise this enhancement.
> >
> > Thanks, but I think the manual should also be updated.
> 
> OK.  How about the patch below?

Fine with me, thanks.
  

Patch

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index bd20b39c63..0ea11898e5 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -17522,7 +17522,7 @@  name is @code{value}.
 
 This command differs from @code{ptype} in two ways: first, like
 @code{whatis}, it does not print a detailed description; second, it
-lists all source files where a type is defined.
+lists all source files and line numbers where a type is defined.
 
 @kindex info type-printers
 @item info type-printers
@@ -17600,24 +17600,29 @@  have already been read, and files whose symbols will be read when needed.
 @kindex info functions
 @item info functions
 Print the names and data types of all defined functions.
+Similarly to @samp{info types}, this command groups its output by source
+files and annotates each function definition with its source line
+number.
 
 @item info functions @var{regexp}
-Print the names and data types of all defined functions
-whose names contain a match for regular expression @var{regexp}.
-Thus, @samp{info fun step} finds all functions whose names
-include @code{step}; @samp{info fun ^step} finds those whose names
-start with @code{step}.  If a function name contains characters
-that conflict with the regular expression language (e.g.@:
+Like @samp{info functions}, but only print the names and data types of
+functions whose names contain a match for regular expression
+@var{regexp}.  Thus, @samp{info fun step} finds all functions whose
+names include @code{step}; @samp{info fun ^step} finds those whose names
+start with @code{step}.  If a function name contains characters that
+conflict with the regular expression language (e.g.@:
 @samp{operator*()}), they may be quoted with a backslash.
 
 @kindex info variables
 @item info variables
 Print the names and data types of all variables that are defined
 outside of functions (i.e.@: excluding local variables).
+The printed variables are grouped by source files and annotated with
+their respective source line numbers.
 
 @item info variables @var{regexp}
-Print the names and data types of all variables (except for local
-variables) whose names contain a match for regular expression
+Like @kbd{info variables}, but only print the names and data types of
+non-local variables whose names contain a match for regular expression
 @var{regexp}.
 
 @kindex info classes