* [RFA] Remove some text from --version output
@ 2018-05-11 19:56 Tom Tromey
2018-05-12 15:51 ` Eli Zaretskii
2018-05-16 17:39 ` Pedro Alves
0 siblings, 2 replies; 6+ messages in thread
From: Tom Tromey @ 2018-05-11 19:56 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
I happened to notice recently that "gdb --version" says:
GNU gdb (GDB) 8.0.50.20170911-git
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
This is a bit on the wordy side, but also references interactive
commands, which I think doesn't really make sense for --version.
This patch removes that text from --version, while leaving it in the
"show version" output. It also adds a newline between the URLs and
the "For help, ..." text, because I thought that was easier to read.
(Perhaps the URLs ought to be indented a bit as well, but I did not do
that.)
Now the --version output looks like:
GNU gdb (GDB) 8.1.50.20180511-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
Tested by the buildbot.
2018-05-11 Tom Tromey <tom@tromey.com>
* cli/cli-cmds.c (show_version): Update.
* top.c (print_gdb_version): Add "interactive" parameter.
Update.
* main.c (captured_main_1): Update.
* top.h (print_gdb_version): Add "interactive" parameter and a
comment.
2018-05-11 Tom Tromey <tom@tromey.com>
* gdb.base/default.exp: Update expected "show version" output.
---
gdb/ChangeLog | 9 +++++++++
gdb/cli/cli-cmds.c | 2 +-
gdb/main.c | 6 +++---
gdb/testsuite/ChangeLog | 4 ++++
gdb/testsuite/gdb.base/default.exp | 2 +-
gdb/top.c | 30 ++++++++++++++++++++----------
gdb/top.h | 8 +++++++-
7 files changed, 45 insertions(+), 16 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a3a133c036..7f5bbe9a7c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2018-05-11 Tom Tromey <tom@tromey.com>
+
+ * cli/cli-cmds.c (show_version): Update.
+ * top.c (print_gdb_version): Add "interactive" parameter.
+ Update.
+ * main.c (captured_main_1): Update.
+ * top.h (print_gdb_version): Add "interactive" parameter and a
+ comment.
+
2018-05-11 Max Filippov <jcmvbkbc@gmail.com>
* configure.tgt (xtensa*-*-linux*): Drop gdb_target definition.
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 95bd58ce54..5c5d6dc456 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -315,7 +315,7 @@ is_complete_command (struct cmd_list_element *c)
static void
show_version (const char *args, int from_tty)
{
- print_gdb_version (gdb_stdout);
+ print_gdb_version (gdb_stdout, true);
printf_filtered ("\n");
}
diff --git a/gdb/main.c b/gdb/main.c
index 189266f90e..9694af2426 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -918,7 +918,7 @@ captured_main_1 (struct captured_main_args *context)
if (print_version)
{
- print_gdb_version (gdb_stdout);
+ print_gdb_version (gdb_stdout, false);
wrap_here ("");
printf_filtered ("\n");
exit (0);
@@ -947,7 +947,7 @@ captured_main_1 (struct captured_main_args *context)
{
/* Print all the junk at the top, with trailing "..." if we are
about to read a symbol file (possibly slowly). */
- print_gdb_version (gdb_stdout);
+ print_gdb_version (gdb_stdout, true);
if (symarg)
printf_filtered ("..");
wrap_here ("");
@@ -968,7 +968,7 @@ captured_main_1 (struct captured_main_args *context)
{
/* Print all the junk at the top, with trailing "..." if we are
about to read a symbol file (possibly slowly). */
- print_gdb_version (gdb_stdout);
+ print_gdb_version (gdb_stdout, true);
if (symarg)
printf_filtered ("..");
wrap_here ("");
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 9fc54c0001..22a4ce50e2 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2018-05-11 Tom Tromey <tom@tromey.com>
+
+ * gdb.base/default.exp: Update expected "show version" output.
+
2018-05-08 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.arch/amd64-init-x87-values.S: New file.
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index 689d3abf93..c6a2ed8fdc 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -686,7 +686,7 @@ gdb_test_no_output "show values" "show values"
#test show verbose
gdb_test "show verbose" "Verbose printing of informational messages is o.*|Verbosity is off.*" "show verbose"
#test show version
-gdb_test "show version" "GNU gdb \[0-9\.\]*(\[^\r\n\]*\[\r\n\])+Copyright \\(C\\) \[0-9\]* Free Software Foundation, Inc(\[^\r\n\]*\[\r\n\])+License GPLv3\\+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>(\[^\r\n\]*\[\r\n\])+This is free software: you are free to change and redistribute it.(\[^\r\n\]*\[\r\n\])+There is NO WARRANTY, to the extent permitted by law. Type \"show copying\"(\[^\r\n\]*\[\r\n\])+and \"show warranty\" for details..*" "show version"
+gdb_test "show version" "GNU gdb \[0-9\.\]*(\[^\r\n\]*\[\r\n\])+Copyright \\(C\\) \[0-9\]* Free Software Foundation, Inc(\[^\r\n\]*\[\r\n\])+License GPLv3\\+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>(\[^\r\n\]*\[\r\n\])+This is free software: you are free to change and redistribute it.(\[^\r\n\]*\[\r\n\])+There is NO WARRANTY, to the extent permitted by law.(\[^\r\n\]*\[\r\n\])+Type \"show copying\" and \"show warranty\" for details..*" "show version"
#test show width
gdb_test "show width" "Number of characters gdb thinks are in a line is.*" "show width"
#test show write
diff --git a/gdb/top.c b/gdb/top.c
index 07b386dacb..6983bfcedc 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1278,9 +1278,9 @@ command_line_input (const char *prompt_arg, int repeat,
return cmd;
}
\f
-/* Print the GDB banner. */
+/* See top.h. */
void
-print_gdb_version (struct ui_file *stream)
+print_gdb_version (struct ui_file *stream, bool interactive)
{
/* From GNU coding standards, first line is meant to be easy for a
program to parse, and is just canonical program name and version
@@ -1301,8 +1301,11 @@ print_gdb_version (struct ui_file *stream)
fprintf_filtered (stream, "\
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\
\nThis is free software: you are free to change and redistribute it.\n\
-There is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\n\
-and \"show warranty\" for details.\n");
+There is NO WARRANTY, to the extent permitted by law.\n");
+
+ if (interactive)
+ fprintf_filtered (stream, ("Type \"show copying\" and "
+ "\"show warranty\" for details.\n"));
/* After the required info we print the configuration information. */
@@ -1316,21 +1319,28 @@ and \"show warranty\" for details.\n");
{
fprintf_filtered (stream, "%s", host_name);
}
- fprintf_filtered (stream, "\".\n\
-Type \"show configuration\" for configuration details.");
+ fprintf_filtered (stream, "\".\n");
+
+ if (interactive)
+ fprintf_filtered (stream, _("Type \"show configuration\" "
+ "for configuration details.\n"));
if (REPORT_BUGS_TO[0])
{
fprintf_filtered (stream,
- _("\nFor bug reporting instructions, please see:\n"));
+ _("For bug reporting instructions, please see:\n"));
fprintf_filtered (stream, "%s.\n", REPORT_BUGS_TO);
}
fprintf_filtered (stream,
_("Find the GDB manual and other documentation \
-resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\n"));
- fprintf_filtered (stream, _("For help, type \"help\".\n"));
- fprintf_filtered (stream, _("Type \"apropos word\" to search for \
+resources online at:\n<http://www.gnu.org/software/gdb/documentation/>."));
+ if (interactive)
+ {
+ fprintf_filtered (stream, "\n\n");
+ fprintf_filtered (stream, _("For help, type \"help\".\n"));
+ fprintf_filtered (stream, _("Type \"apropos word\" to search for \
commands related to \"word\"."));
+ }
}
/* Print the details of GDB build-time configuration. */
diff --git a/gdb/top.h b/gdb/top.h
index d54b6f15c4..b34defa1f2 100644
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -222,7 +222,13 @@ extern int confirm;
extern int inhibit_gdbinit;
extern const char gdbinit[];
-extern void print_gdb_version (struct ui_file *);
+/* Print the GDB version banner to STREAM. If INTERACTIVE is false,
+ then information referring to commands (e.g., "show configuration")
+ is omitted; this mode is used for the --version command line
+ option. If INTERACTIVE is true, then interactive commands are
+ mentioned. */
+extern void print_gdb_version (struct ui_file *stream, bool interactive);
+
extern void print_gdb_configuration (struct ui_file *);
extern void read_command_file (FILE *);
--
2.14.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA] Remove some text from --version output
2018-05-11 19:56 [RFA] Remove some text from --version output Tom Tromey
@ 2018-05-12 15:51 ` Eli Zaretskii
2018-05-14 15:36 ` Tom Tromey
2018-05-16 17:39 ` Pedro Alves
1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2018-05-12 15:51 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>
> Date: Fri, 11 May 2018 13:40:08 -0600
>
> I happened to notice recently that "gdb --version" says:
>
> GNU gdb (GDB) 8.0.50.20170911-git
> Copyright (C) 2017 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-pc-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word".
>
> This is a bit on the wordy side, but also references interactive
> commands, which I think doesn't really make sense for --version.
The text shows details usually shown in the "About" screen by other
programs.
> Now the --version output looks like:
>
> GNU gdb (GDB) 8.1.50.20180511-git
> Copyright (C) 2018 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> This GDB was configured as "x86_64-pc-linux-gnu".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
FWIW, I don't think I'd like to lose the text you removed. At the
very least, the line about "show configuration" should be retained.
It is also quite common to show important commands at the initial
screen, e.g. see what Python or Guile show there.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA] Remove some text from --version output
2018-05-12 15:51 ` Eli Zaretskii
@ 2018-05-14 15:36 ` Tom Tromey
0 siblings, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2018-05-14 15:36 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Tom Tromey, gdb-patches
>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
Eli> FWIW, I don't think I'd like to lose the text you removed. At the
Eli> very least, the line about "show configuration" should be retained.
Eli> It is also quite common to show important commands at the initial
Eli> screen, e.g. see what Python or Guile show there.
It's still shown during ordinary gdb startup -- when the user could
actually type the commands.
This patch only changes --version output, where mentioning the commands
is at best redundant.
Tom
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA] Remove some text from --version output
2018-05-11 19:56 [RFA] Remove some text from --version output Tom Tromey
2018-05-12 15:51 ` Eli Zaretskii
@ 2018-05-16 17:39 ` Pedro Alves
2018-06-04 20:24 ` Tom Tromey
1 sibling, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2018-05-16 17:39 UTC (permalink / raw)
To: Tom Tromey, gdb-patches
On 05/11/2018 08:40 PM, Tom Tromey wrote:
> I happened to notice recently that "gdb --version" says:
>
> GNU gdb (GDB) 8.0.50.20170911-git
> Copyright (C) 2017 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-pc-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word".
>
> This is a bit on the wordy side, but also references interactive
> commands, which I think doesn't really make sense for --version.
Agreed.
>
> This patch removes that text from --version, while leaving it in the
> "show version" output. It also adds a newline between the URLs and
> the "For help, ..." text, because I thought that was easier to read.
> (Perhaps the URLs ought to be indented a bit as well, but I did not do
> that.)
I think indenting the urls would be nice.
>
> Now the --version output looks like:
>
> GNU gdb (GDB) 8.1.50.20180511-git
> Copyright (C) 2018 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> This GDB was configured as "x86_64-pc-linux-gnu".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
LGTM.
I'd even support removing everything after the "NO WARRANTY" line.
The "This GDB was configured..." info can be found in
"gdb --configuration" instead.
(And I guess it if it stays, it could be argued that it'd be
reasonable to say to look at "--configuration" instead removing
the "show configuration" suggestion. I'm not suggesting
that, though.)
Neither "gcc --version" nor "emacs --version", nor coreutils
tools' --version output, like "ls --version" talk about bug
reporting or doc resources in their output.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA] Remove some text from --version output
2018-05-16 17:39 ` Pedro Alves
@ 2018-06-04 20:24 ` Tom Tromey
2018-06-05 16:38 ` Pedro Alves
0 siblings, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2018-06-04 20:24 UTC (permalink / raw)
To: Pedro Alves; +Cc: Tom Tromey, gdb-patches
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Pedro> I'd even support removing everything after the "NO WARRANTY" line.
[...]
How about this?
Tom
commit 791745aebaf8bf547b32c54f774d2495d86b3362
Author: Tom Tromey <tom@tromey.com>
Date: Fri May 11 12:21:03 2018 -0600
Remove some text from --version output
I happened to notice recently that "gdb --version" says:
GNU gdb (GDB) 8.0.50.20170911-git
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
This is a bit on the wordy side, but also references interactive
commands, which I think doesn't really make sense for --version.
This patch removes some text from --version, while leaving it in the
"show version" output. It also adds a newline between the URLs and
the "For help, ..." text, because I thought that was easier to read.
Finally, it indents one of the URLs, since that was simpler to read,
but not the other URL, because the current format is specified by the
GNU coding standards section on "--version".
Now the --version output looks like:
GNU gdb (GDB) 8.1.50.20180511-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Tested by the buildbot.
2018-05-11 Tom Tromey <tom@tromey.com>
* cli/cli-cmds.c (show_version): Update.
* top.c (print_gdb_version): Add "interactive" parameter.
Update.
* main.c (captured_main_1): Update.
* top.h (print_gdb_version): Add "interactive" parameter and a
comment.
gdb/testsuite/ChangeLog
2018-05-11 Tom Tromey <tom@tromey.com>
* gdb.base/default.exp: Update expected "show version" output.
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d0c43027d6e..c31de820b8d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2018-05-11 Tom Tromey <tom@tromey.com>
+
+ * cli/cli-cmds.c (show_version): Update.
+ * top.c (print_gdb_version): Add "interactive" parameter.
+ Update.
+ * main.c (captured_main_1): Update.
+ * top.h (print_gdb_version): Add "interactive" parameter and a
+ comment.
+
2018-06-04 Simon Marchi <simon.marchi@ericsson.com>
* Makefile.in (config.status): Add configure.nat as a
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 95bd58ce545..5c5d6dc4561 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -315,7 +315,7 @@ is_complete_command (struct cmd_list_element *c)
static void
show_version (const char *args, int from_tty)
{
- print_gdb_version (gdb_stdout);
+ print_gdb_version (gdb_stdout, true);
printf_filtered ("\n");
}
diff --git a/gdb/main.c b/gdb/main.c
index 189266f90e0..9694af24269 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -918,7 +918,7 @@ captured_main_1 (struct captured_main_args *context)
if (print_version)
{
- print_gdb_version (gdb_stdout);
+ print_gdb_version (gdb_stdout, false);
wrap_here ("");
printf_filtered ("\n");
exit (0);
@@ -947,7 +947,7 @@ captured_main_1 (struct captured_main_args *context)
{
/* Print all the junk at the top, with trailing "..." if we are
about to read a symbol file (possibly slowly). */
- print_gdb_version (gdb_stdout);
+ print_gdb_version (gdb_stdout, true);
if (symarg)
printf_filtered ("..");
wrap_here ("");
@@ -968,7 +968,7 @@ captured_main_1 (struct captured_main_args *context)
{
/* Print all the junk at the top, with trailing "..." if we are
about to read a symbol file (possibly slowly). */
- print_gdb_version (gdb_stdout);
+ print_gdb_version (gdb_stdout, true);
if (symarg)
printf_filtered ("..");
wrap_here ("");
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 8cef172a26d..79b0a9e8141 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2018-05-11 Tom Tromey <tom@tromey.com>
+
+ * gdb.base/default.exp: Update expected "show version" output.
+
2018-06-01 Joel Brobecker <brobecker@adacore.com>
* gdb.ada/bp_fun_addr: New testcase.
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index 689d3abf932..5c0dc781fd3 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -686,7 +686,7 @@ gdb_test_no_output "show values" "show values"
#test show verbose
gdb_test "show verbose" "Verbose printing of informational messages is o.*|Verbosity is off.*" "show verbose"
#test show version
-gdb_test "show version" "GNU gdb \[0-9\.\]*(\[^\r\n\]*\[\r\n\])+Copyright \\(C\\) \[0-9\]* Free Software Foundation, Inc(\[^\r\n\]*\[\r\n\])+License GPLv3\\+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>(\[^\r\n\]*\[\r\n\])+This is free software: you are free to change and redistribute it.(\[^\r\n\]*\[\r\n\])+There is NO WARRANTY, to the extent permitted by law. Type \"show copying\"(\[^\r\n\]*\[\r\n\])+and \"show warranty\" for details..*" "show version"
+gdb_test "show version" "GNU gdb \[0-9\.\]*(\[^\r\n\]*\[\r\n\])+Copyright \\(C\\) \[0-9\]* Free Software Foundation, Inc(\[^\r\n\]*\[\r\n\])+License GPLv3\\+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>(\[^\r\n\]*\[\r\n\])+This is free software: you are free to change and redistribute it.(\[^\r\n\]*\[\r\n\])+There is NO WARRANTY, to the extent permitted by law.(\[^\r\n\]*\[\r\n\])+Type \"show copying\" and \"show warranty\" for details..*" "show version"
#test show width
gdb_test "show width" "Number of characters gdb thinks are in a line is.*" "show width"
#test show write
diff --git a/gdb/top.c b/gdb/top.c
index 07b386dacba..8e0a39494e1 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1278,9 +1278,9 @@ command_line_input (const char *prompt_arg, int repeat,
return cmd;
}
\f
-/* Print the GDB banner. */
+/* See top.h. */
void
-print_gdb_version (struct ui_file *stream)
+print_gdb_version (struct ui_file *stream, bool interactive)
{
/* From GNU coding standards, first line is meant to be easy for a
program to parse, and is just canonical program name and version
@@ -1301,8 +1301,13 @@ print_gdb_version (struct ui_file *stream)
fprintf_filtered (stream, "\
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\
\nThis is free software: you are free to change and redistribute it.\n\
-There is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\n\
-and \"show warranty\" for details.\n");
+There is NO WARRANTY, to the extent permitted by law.");
+
+ if (!interactive)
+ return;
+
+ fprintf_filtered (stream, ("\nType \"show copying\" and "
+ "\"show warranty\" for details.\n"));
/* After the required info we print the configuration information. */
@@ -1316,18 +1321,21 @@ and \"show warranty\" for details.\n");
{
fprintf_filtered (stream, "%s", host_name);
}
- fprintf_filtered (stream, "\".\n\
-Type \"show configuration\" for configuration details.");
+ fprintf_filtered (stream, "\".\n");
+
+ fprintf_filtered (stream, _("Type \"show configuration\" "
+ "for configuration details.\n"));
if (REPORT_BUGS_TO[0])
{
fprintf_filtered (stream,
- _("\nFor bug reporting instructions, please see:\n"));
+ _("For bug reporting instructions, please see:\n"));
fprintf_filtered (stream, "%s.\n", REPORT_BUGS_TO);
}
fprintf_filtered (stream,
_("Find the GDB manual and other documentation \
-resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\n"));
+resources online at:\n <http://www.gnu.org/software/gdb/documentation/>."));
+ fprintf_filtered (stream, "\n\n");
fprintf_filtered (stream, _("For help, type \"help\".\n"));
fprintf_filtered (stream, _("Type \"apropos word\" to search for \
commands related to \"word\"."));
diff --git a/gdb/top.h b/gdb/top.h
index d54b6f15c46..b34defa1f29 100644
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -222,7 +222,13 @@ extern int confirm;
extern int inhibit_gdbinit;
extern const char gdbinit[];
-extern void print_gdb_version (struct ui_file *);
+/* Print the GDB version banner to STREAM. If INTERACTIVE is false,
+ then information referring to commands (e.g., "show configuration")
+ is omitted; this mode is used for the --version command line
+ option. If INTERACTIVE is true, then interactive commands are
+ mentioned. */
+extern void print_gdb_version (struct ui_file *stream, bool interactive);
+
extern void print_gdb_configuration (struct ui_file *);
extern void read_command_file (FILE *);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFA] Remove some text from --version output
2018-06-04 20:24 ` Tom Tromey
@ 2018-06-05 16:38 ` Pedro Alves
0 siblings, 0 replies; 6+ messages in thread
From: Pedro Alves @ 2018-06-05 16:38 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
On 06/04/2018 09:24 PM, Tom Tromey wrote:
>
> This patch removes some text from --version, while leaving it in the
> "show version" output. It also adds a newline between the URLs and
> the "For help, ..." text, because I thought that was easier to read.
> Finally, it indents one of the URLs, since that was simpler to read,
> but not the other URL, because the current format is specified by the
> GNU coding standards section on "--version".
>
> Now the --version output looks like:
>
> GNU gdb (GDB) 8.1.50.20180511-git
> Copyright (C) 2018 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
IIUC, you changed the "show version" output too, in which case it would be
nice to include the new output for that here too. I didn't try it locally,
but I trust that it's fine. Thus, OK with me.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-06-05 16:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-11 19:56 [RFA] Remove some text from --version output Tom Tromey
2018-05-12 15:51 ` Eli Zaretskii
2018-05-14 15:36 ` Tom Tromey
2018-05-16 17:39 ` Pedro Alves
2018-06-04 20:24 ` Tom Tromey
2018-06-05 16:38 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox