[gdb/cli] Improve show logging output
Before commit
3b6acaee895 "Update more calls to add_prefix_cmd" we had the
following output for "show logging":
...
$ gdb -q -batch -ex "set trace-commands on" \
-ex "set logging off" \
-ex "show logging" \
-ex "set logging on" \
-ex "show logging"
+set logging off
+show logging
Future logs will be written to gdb.txt.
Logs will be appended to the log file.
Output will be logged and displayed.
Debug output will be logged and displayed.
+set logging on
+show logging
Currently logging to "gdb.txt".
Logs will be appended to the log file.
Output will be logged and displayed.
Debug output will be logged and displayed.
...
After that commit we have instead:
...
+set logging off
+show logging
debugredirect: The logging output mode is off.
file: The current logfile is "gdb.txt".
overwrite: Whether logging overwrites or appends to the log file is off.
redirect: The logging output mode is off.
+set logging on
+show logging
debugredirect: The logging output mode is off.
file: The current logfile is "gdb.txt".
overwrite: Whether logging overwrites or appends to the log file is off.
redirect: The logging output mode is off.
...
which gives less clear output for some subcommands.
OTOH, it's explicit about whether boolean values are on or off.
The new text seems to have been chosen to match the set/show help texts:
...
(gdb) help show logging
Show logging options.
List of show logging subcommands:
show logging debugredirect -- Show the logging debug output mode.
show logging file -- Show the current logfile.
show logging overwrite -- \
Show whether logging overwrites or appends to the log file.
show logging redirect -- Show the logging output mode.
...
Make the show logging messages more clear, while still keep the boolean
values explicit, such that we have:
...
$ ./gdb.sh -q -batch -ex "show logging"
logging debugredirect: off: \
Debug output will go to both the screen and the log file.
logging enabled: off: Logging is disabled.
logging file: The current logfile is "gdb.txt".
logging overwrite: off: Logging appends to the log file.
logging redirect: off: Output will go to both the screen and the log file.
...
Tested on x86_64-linux.