[RFC] Make the first line of 'command help documentation' consistent.

Message ID 20190609184529.26198-1-philippe.waroquiers@skynet.be
State New
Headers show
Series
  • [RFC] Make the first line of 'command help documentation' consistent.
Related show

Commit Message

Philippe Waroquiers June 9, 2019, 6:45 p.m.
With this patch, the help docs now respect 2 invariants:
  * The first line of a command help is terminated by a '.' character.
  * The last character of a command help is not a newline character.

Note: this is an RFC because:
  * Feedback needed over the above invariants and the rephrased/restructured
    help docs that had to be done for some commands.
  * This is better pushed after Pedro's cli-option is pushed,
    so as to avoid creating merge conflicts in the (big) cli-option branch
    (as many changes here are mechanical).
  * And I have not yet 'Likewise-d' the ChangeLog.

Before this patch, print_doc_line was printing the first line
of a command help documentation, but stopping at the first '.'
or ',' character.

This was giving inconsistent results :
  * The first line of command helps was sometimes '.' terminated,
    sometimes not.
  * The first line of command helps was not always designed to be
    readable/understandable/unambiguous when stopping at the first
    '.' or ',' character.

This e.g. created the following inconsistencies/problems:
< catch exception -- Catch Ada exceptions
< catch handlers -- Catch Ada exceptions
< catch syscall -- Catch system calls by their names
< down-silently -- Same as the `down' command
while the new help is:
> catch exception -- Catch Ada exceptions, when raised.

> catch handlers -- Catch Ada exceptions, when handled.

> catch syscall -- Catch system calls by their names, groups and/or numbers.

> down-silently -- Same as the `down' command, but does not print anything.


Also, the command help doc should not be terminated by a newline
character, but this was not respected by all commands.

This patch changes the help documentations to ensure the 2 invariants
given above.

It implied to slightly rephrase or restructure some help docs.

The test gdb.base/help.exp is modified to verify these invariants
automatically for all commands compiled in GDB.

Based on the above invariants, print_doc_line (called by
'apropos' and 'help' commands to print the first line of a command
help) now outputs the full first line of a command help.

This all results in a lot of small changes in the produced help docs.
There are less code changes than changes in the help docs, as a lot
of docs are produced by some code (e.g. the remote packet usage settings).

If you want, you might look at the new resulting help by doing the following
command in a HEAD GDB and in a GDB with this patch, and then
use emacs M-x ediff-files (or the diff tool you prefer) to review
the changes in the 'full_help.txt', checking a.o. that the
first line of the help of a command is understanble by itself.

(gdb) |apropos -v .| cat > full_help.txt

full_help.txt has a lot of small differences (but less than the
one_line_help.txt below) because:
  * excess new-lines at the end of docs have been removed.
  * missing . at end of first line have been added.

You can also produce a file with just the first line of help:
(gdb) |apropos .| cat > one_line_help.txt
The 'one_line_help.txt' contains a lot more of artificial differences,
as the HEAD GDB does not output the trailing '.' character.

gdb/ChangeLog
2019-06-09  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* cli/cli-decode.h (print_doc_line): Add for_value_prefix argument.
	* cli/cli-decode.c (print_doc_line): Likewise.  It now prints
	the full first line, except when FOR_VALUE_PREFIX.  In this case,
	the trailing '.' is not output, and the first character is uppercased.
	(print_help_for_command): Update call to print_doc_line.
	(print_doc_of_command): Likewise.  Output a specific string
	when doc string ends with a line feed to allow the testsuite
	to detect the broken invariant.
	* cli/cli-setshow.c (deprecated_show_value_hack): Likewise.
	* gdb/interps.c (interpreter_exec_cmd): Fix Usage: that was
	incorrectly telling COMMAND is optional.
        * ada-lang.c (_initialize_ada_language): Change help doc or code
	producing the help doc to respect the invariants.
	* TODO *************:
	 add all other changed files/functions and put Likewise.

gdb/testsuite/ChangeLog
2019-06-09  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* gdb.base/style.exp: Update tests for help doc new invariants.
	* gdb.base/help.exp: Likewise.	Add tests to check new invariants.
---
 gdb/ada-lang.c                        | 12 ++---
 gdb/ada-tasks.c                       |  4 +-
 gdb/breakpoint.c                      | 68 ++++++++++++++++-----------
 gdb/btrace.c                          |  8 ++--
 gdb/cli/cli-cmds.c                    |  9 ++--
 gdb/cli/cli-decode.c                  | 38 ++++++++++-----
 gdb/cli/cli-decode.h                  | 11 +++--
 gdb/cli/cli-logging.c                 |  4 +-
 gdb/cli/cli-setshow.c                 |  5 +-
 gdb/cli/cli-style.c                   | 28 +++++------
 gdb/compile/compile.c                 |  8 ++--
 gdb/corelow.c                         |  3 +-
 gdb/disasm.c                          |  2 +-
 gdb/dwarf-index-cache.c               |  4 +-
 gdb/dwarf2read.c                      |  6 +--
 gdb/filesystem.c                      |  4 +-
 gdb/frame.c                           |  4 +-
 gdb/gnu-nat.c                         | 10 ++--
 gdb/infcall.c                         |  4 +-
 gdb/infcmd.c                          |  5 +-
 gdb/interps.c                         |  7 +--
 gdb/language.c                        | 12 ++---
 gdb/linux-fork.c                      |  3 +-
 gdb/maint.c                           | 21 +++++----
 gdb/memattr.c                         | 10 ++--
 gdb/printcmd.c                        |  6 +--
 gdb/python/lib/gdb/function/strfns.py |  8 ++--
 gdb/python/python.c                   |  3 +-
 gdb/ravenscar-thread.c                |  8 ++--
 gdb/record-btrace.c                   | 14 +++---
 gdb/record-full.c                     |  4 +-
 gdb/record.c                          |  6 +--
 gdb/regcache-dump.c                   |  4 +-
 gdb/regcache.c                        |  2 +-
 gdb/remote.c                          | 36 +++++++-------
 gdb/reverse.c                         |  4 +-
 gdb/ser-tcp.c                         | 16 +++----
 gdb/serial.c                          |  8 ++--
 gdb/skip.c                            | 30 +++++++-----
 gdb/source.c                          |  3 ++
 gdb/stack.c                           | 10 ++--
 gdb/symfile.c                         |  4 +-
 gdb/symtab.c                          |  3 +-
 gdb/target-descriptions.c             |  9 ++--
 gdb/testsuite/gdb.base/help.exp       | 17 +++++--
 gdb/testsuite/gdb.base/style.exp      |  4 +-
 gdb/top.c                             | 19 ++++----
 gdb/tracefile-tfile.c                 |  3 +-
 gdb/tracepoint.c                      | 26 +++++-----
 gdb/tui/tui-layout.c                  |  2 +-
 gdb/tui/tui-stack.c                   |  2 +-
 gdb/tui/tui-win.c                     | 24 +++++-----
 gdb/typeprint.c                       |  2 +-
 gdb/user-regs.c                       |  2 +-
 gdb/utils.c                           |  8 ++--
 gdb/valprint.c                        |  2 +-
 56 files changed, 318 insertions(+), 261 deletions(-)

-- 
2.20.1

Patch

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 22c51fbf08..ff19f76ce0 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -14376,7 +14376,7 @@  _initialize_ada_language (void)
   initialize_ada_catchpoint_ops ();
 
   add_prefix_cmd ("ada", no_class, set_ada_command,
-                  _("Prefix command for changing Ada-specific settings"),
+                  _("Prefix command for changing Ada-specific settings."),
                   &set_ada_list, "set ada ", 0, &setlist);
 
   add_prefix_cmd ("ada", no_class, show_ada_command,
@@ -14385,8 +14385,8 @@  _initialize_ada_language (void)
 
   add_setshow_boolean_cmd ("trust-PAD-over-XVS", class_obscure,
                            &trust_pad_over_xvs, _("\
-Enable or disable an optimization trusting PAD types over XVS types"), _("\
-Show whether an optimization trusting PAD types over XVS types is activated"),
+Enable or disable an optimization trusting PAD types over XVS types."), _("\
+Show whether an optimization trusting PAD types over XVS types is activated."),
                            _("\
 This is related to the encoding used by the GNAT compiler.  The debugger\n\
 should normally trust the contents of PAD types, but certain older versions\n\
@@ -14400,9 +14400,9 @@  this option to \"off\" unless necessary."),
   add_setshow_boolean_cmd ("print-signatures", class_vars,
 			   &print_signatures, _("\
 Enable or disable the output of formal and return types for functions in the \
-overloads selection menu"), _("\
+overloads selection menu."), _("\
 Show whether the output of formal and return types for functions in the \
-overloads selection menu is activated"),
+overloads selection menu is activated."),
 			   NULL, NULL, NULL, &set_ada_list, &show_ada_list);
 
   add_catch_command ("exception", _("\
@@ -14456,7 +14456,7 @@  the regular expression are listed."));
                   0/*allow-unknown*/, &maintenance_set_cmdlist);
 
   add_prefix_cmd ("ada", class_maintenance, maint_show_ada_cmd,
-		  _("Show Ada maintenance-related variables"),
+		  _("Show Ada maintenance-related variables."),
                   &maint_show_ada_cmdlist, "maintenance show ada ",
                   0/*allow-unknown*/, &maintenance_show_cmdlist);
 
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
index 9c07f0ca22..f34b5b81e7 100644
--- a/gdb/ada-tasks.c
+++ b/gdb/ada-tasks.c
@@ -1413,9 +1413,9 @@  _initialize_tasks (void)
 
   /* Some new commands provided by this module.  */
   add_info ("tasks", info_tasks_command,
-            _("Provide information about all known Ada tasks"));
+            _("Provide information about all known Ada tasks."));
   add_cmd ("task", class_run, task_command,
            _("Use this command to switch between Ada tasks.\n\
-Without argument, this command simply prints the current task ID"),
+Without argument, this command simply prints the current task ID."),
            &cmdlist);
 }
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index ae3dcc0a95..b2da93f95f 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -15114,7 +15114,7 @@  functions in all scopes.  For C++, this means in all namespaces and\n\
 classes.  For Ada, this means in all packages.  E.g., in C++,\n\
 \"func()\" matches \"A::func()\", \"A::B::func()\", etc.  The\n\
 \"-qualified\" flag overrides this behavior, making GDB interpret the\n\
-specified name as a complete fully-qualified name instead.\n"
+specified name as a complete fully-qualified name instead."
 
 /* This help string is used for the break, hbreak, tbreak and thbreak
    commands.  It is defined as a macro to prevent duplication.
@@ -15135,7 +15135,7 @@  stack frame.  This is useful for breaking on return to a stack frame.\n\
 \n\
 THREADNUM is the number from \"info threads\".\n\
 CONDITION is a boolean expression.\n\
-\n" LOCATION_HELP_STRING "\n\
+\n" LOCATION_HELP_STRING "\n\n\
 Multiple breakpoints at one place are permitted, and useful if their\n\
 conditions are different.\n\
 \n\
@@ -15494,7 +15494,8 @@  BREAK_ARGS_HELP ("thbreak")));
   set_cmd_completer (c, location_completer);
 
   add_prefix_cmd ("enable", class_breakpoint, enable_command, _("\
-Enable some breakpoints.\n\
+Enable all or some breakpoints.\n\
+Usage: enable [BREAKPOINTNUM]...\n\
 Give breakpoint numbers (separated by spaces) as arguments.\n\
 With no subcommand, breakpoints are enabled until you command otherwise.\n\
 This is used to cancel the effect of the \"disable\" command.\n\
@@ -15504,46 +15505,54 @@  With a subcommand you can enable temporarily."),
   add_com_alias ("en", "enable", class_breakpoint, 1);
 
   add_prefix_cmd ("breakpoints", class_breakpoint, enable_command, _("\
-Enable some breakpoints.\n\
+Enable all or some breakpoints.\n\
+Usage: enable breakpoints [BREAKPOINTNUM]...\n\
 Give breakpoint numbers (separated by spaces) as arguments.\n\
 This is used to cancel the effect of the \"disable\" command.\n\
-May be abbreviated to simply \"enable\".\n"),
+May be abbreviated to simply \"enable\"."),
 		   &enablebreaklist, "enable breakpoints ", 1, &enablelist);
 
   add_cmd ("once", no_class, enable_once_command, _("\
-Enable breakpoints for one hit.  Give breakpoint numbers.\n\
+Enable some breakpoints for one hit.\n\
+Usage: enable breakpoints once BREAKPOINTNUM...\n\
 If a breakpoint is hit while enabled in this fashion, it becomes disabled."),
 	   &enablebreaklist);
 
   add_cmd ("delete", no_class, enable_delete_command, _("\
-Enable breakpoints and delete when hit.  Give breakpoint numbers.\n\
+Enable some breakpoints and delete when hit.\n\
+Usage: enable breakpoints delete BREAKPOINTNUM...\n\
 If a breakpoint is hit while enabled in this fashion, it is deleted."),
 	   &enablebreaklist);
 
   add_cmd ("count", no_class, enable_count_command, _("\
-Enable breakpoints for COUNT hits.  Give count and then breakpoint numbers.\n\
+Enable some breakpoints for COUNT hits.\n\
+Usage: enable breakpoints count COUNT BREAKPOINTNUM...\n\
 If a breakpoint is hit while enabled in this fashion,\n\
 the count is decremented; when it reaches zero, the breakpoint is disabled."),
 	   &enablebreaklist);
 
   add_cmd ("delete", no_class, enable_delete_command, _("\
-Enable breakpoints and delete when hit.  Give breakpoint numbers.\n\
+Enable some breakpoints and delete when hit.\n\
+Usage: enable delete BREAKPOINTNUM...\n\
 If a breakpoint is hit while enabled in this fashion, it is deleted."),
 	   &enablelist);
 
   add_cmd ("once", no_class, enable_once_command, _("\
-Enable breakpoints for one hit.  Give breakpoint numbers.\n\
+Enable some breakpoints for one hit.\n\
+Usage: enable once BREAKPOINTNUM...\n\
 If a breakpoint is hit while enabled in this fashion, it becomes disabled."),
 	   &enablelist);
 
   add_cmd ("count", no_class, enable_count_command, _("\
-Enable breakpoints for COUNT hits.  Give count and then breakpoint numbers.\n\
+Enable some breakpoints for COUNT hits.\n\
+Usage: enable count COUNT BREAKPOINTNUM...\n\
 If a breakpoint is hit while enabled in this fashion,\n\
 the count is decremented; when it reaches zero, the breakpoint is disabled."),
 	   &enablelist);
 
   add_prefix_cmd ("disable", class_breakpoint, disable_command, _("\
-Disable some breakpoints.\n\
+Disable all or some breakpoints.\n\
+Usage: disable [BREAKPOINTNUM]...\n\
 Arguments are breakpoint numbers with spaces in between.\n\
 To disable all breakpoints, give no argument.\n\
 A disabled breakpoint is not forgotten, but has no effect until re-enabled."),
@@ -15552,7 +15561,8 @@  A disabled breakpoint is not forgotten, but has no effect until re-enabled."),
   add_com_alias ("disa", "disable", class_breakpoint, 1);
 
   add_cmd ("breakpoints", class_alias, disable_command, _("\
-Disable some breakpoints.\n\
+Disable all or some breakpoints.\n\
+Usage: disable breakpoints [BREAKPOINTNUM]...\n\
 Arguments are breakpoint numbers with spaces in between.\n\
 To disable all breakpoints, give no argument.\n\
 A disabled breakpoint is not forgotten, but has no effect until re-enabled.\n\
@@ -15560,7 +15570,8 @@  This command may be abbreviated \"disable\"."),
 	   &disablelist);
 
   add_prefix_cmd ("delete", class_breakpoint, delete_command, _("\
-Delete some breakpoints or auto-display expressions.\n\
+Delete all or some breakpoints or auto-display expressions.\n\
+Usage: delete [BREAKPOINTNUM]...\n\
 Arguments are breakpoint numbers with spaces in between.\n\
 To delete all breakpoints, give no argument.\n\
 \n\
@@ -15571,7 +15582,8 @@  The \"unset\" command is also an alias for \"delete\"."),
   add_com_alias ("del", "delete", class_breakpoint, 1);
 
   add_cmd ("breakpoints", class_alias, delete_command, _("\
-Delete some breakpoints or auto-display expressions.\n\
+Delete all or some breakpoints or auto-display expressions.\n\
+Usage: delete breakpoints [BREAKPOINTNUM]...\n\
 Arguments are breakpoint numbers with spaces in between.\n\
 To delete all breakpoints, give no argument.\n\
 This command may be abbreviated \"delete\"."),
@@ -15583,7 +15595,7 @@  Argument may be a linespec, explicit, or address location as described below.\n\
 \n\
 With no argument, clears all breakpoints in the line that the selected frame\n\
 is executing in.\n"
-"\n" LOCATION_HELP_STRING "\n\
+"\n" LOCATION_HELP_STRING "\n\n\
 See also the \"delete\" command which clears breakpoints by number."));
   add_com_alias ("cl", "clear", class_breakpoint, 1);
 
@@ -15783,7 +15795,7 @@  tracing library.  You can inspect it when analyzing the trace buffer,\n\
 by printing the $_sdata variable like any other convenience variable.\n\
 \n\
 CONDITION is a boolean expression.\n\
-\n" LOCATION_HELP_STRING "\n\
+\n" LOCATION_HELP_STRING "\n\n\
 Multiple tracepoints at one place are permitted, and useful if their\n\
 conditions are different.\n\
 \n\
@@ -15848,15 +15860,15 @@  Use the 'source' command in another debug session to restore them."),
   deprecate_cmd (c, "save tracepoints");
 
   add_prefix_cmd ("breakpoint", class_maintenance, set_breakpoint_cmd, _("\
-Breakpoint specific settings\n\
+Breakpoint specific settings.\n\
 Configure various breakpoint-specific variables such as\n\
-pending breakpoint behavior"),
+pending breakpoint behavior."),
 		  &breakpoint_set_cmdlist, "set breakpoint ",
 		  0/*allow-unknown*/, &setlist);
   add_prefix_cmd ("breakpoint", class_maintenance, show_breakpoint_cmd, _("\
-Breakpoint specific settings\n\
+Breakpoint specific settings.\n\
 Configure various breakpoint-specific variables such as\n\
-pending breakpoint behavior"),
+pending breakpoint behavior."),
 		  &breakpoint_show_cmdlist, "show breakpoint ",
 		  0/*allow-unknown*/, &showlist);
 
@@ -15957,16 +15969,16 @@  output stream by setting dprintf-function and dprintf-channel."),
   dprintf_function = xstrdup ("printf");
   add_setshow_string_cmd ("dprintf-function", class_support,
 			  &dprintf_function, _("\
-Set the function to use for dynamic printf"), _("\
-Show the function to use for dynamic printf"), NULL,
+Set the function to use for dynamic printf."), _("\
+Show the function to use for dynamic printf."), NULL,
 			  update_dprintf_commands, NULL,
 			  &setlist, &showlist);
 
   dprintf_channel = xstrdup ("");
   add_setshow_string_cmd ("dprintf-channel", class_support,
 			  &dprintf_channel, _("\
-Set the channel to use for dynamic printf"), _("\
-Show the channel to use for dynamic printf"), NULL,
+Set the channel to use for dynamic printf."), _("\
+Show the channel to use for dynamic printf."), NULL,
 			  update_dprintf_commands, NULL,
 			  &setlist, &showlist);
 
@@ -15981,8 +15993,10 @@  even if GDB disconnects or detaches from the target."),
 			   &setlist, &showlist);
 
   add_com ("agent-printf", class_vars, agent_printf_command, _("\
-agent-printf \"printf format string\", arg1, arg2, arg3, ..., argn\n\
-(target agent only) This is useful for formatted output in user-defined commands."));
+Target agent only formatted printing, like the C \"printf\" function.\n\
+Usage: agent-printf \"format string\", ARG1, ARG2, ARG3, ..., ARGN\n\
+This supports most C printf format specifications, like %s, %d, etc.\n\
+This is useful for formatted output in user-defined commands."));
 
   automatic_hardware_breakpoints = 1;
 
diff --git a/gdb/btrace.c b/gdb/btrace.c
index c6d564e706..2806b8c69d 100644
--- a/gdb/btrace.c
+++ b/gdb/btrace.c
@@ -3528,21 +3528,19 @@  One argument specifies the starting packet of a ten-line print.\n\
 Two arguments with comma between specify starting and ending packets to \
 print.\n\
 Preceded with '+'/'-' the second argument specifies the distance from the \
-first.\n"),
+first."),
 	   &maint_btrace_cmdlist);
 
   add_cmd ("clear-packet-history", class_maintenance,
 	   maint_btrace_clear_packet_history_cmd,
 	   _("Clears the branch tracing packet history.\n\
-Discards the raw branch tracing data but not the execution history data.\n\
-"),
+Discards the raw branch tracing data but not the execution history data."),
 	   &maint_btrace_cmdlist);
 
   add_cmd ("clear", class_maintenance, maint_btrace_clear_cmd,
 	   _("Clears the branch tracing data.\n\
 Discards the raw branch tracing data and the execution history data.\n\
-The next 'record' command will fetch the branch tracing data anew.\n\
-"),
+The next 'record' command will fetch the branch tracing data anew."),
 	   &maint_btrace_cmdlist);
 
 }
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 09f932c2d2..b2837a3362 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1772,7 +1772,8 @@  The commands below can be used to select other frames by number or address."),
   /* Define general commands.  */
 
   add_com ("pwd", class_files, pwd_command, _("\
-Print working directory.  This is used for your program as well."));
+Print working directory.\n\
+This is used for your program as well."));
 
   c = add_cmd ("cd", class_files, cd_command, _("\
 Set working directory to DIR for debugger.\n\
@@ -1884,11 +1885,11 @@  from the target."),
 				       &setlist, &showlist);
 
   add_prefix_cmd ("debug", no_class, set_debug,
-		  _("Generic command for setting gdb debugging flags"),
+		  _("Generic command for setting gdb debugging flags."),
 		  &setdebuglist, "set debug ", 0, &setlist);
 
   add_prefix_cmd ("debug", no_class, show_debug,
-		  _("Generic command for showing gdb debugging flags"),
+		  _("Generic command for showing gdb debugging flags."),
 		  &showdebuglist, "show debug ", 0, &showlist);
 
   c = add_com ("shell", class_support, shell_command, _("\
@@ -1987,7 +1988,7 @@  Show definitions of non-python/scheme user defined commands.\n\
 Argument is the name of the user defined command.\n\
 With no argument, show definitions of all user defined commands."), &showlist);
   add_com ("apropos", class_support, apropos_command, _("\
-Search for commands matching a REGEXP\n\
+Search for commands matching a REGEXP.\n\
 Usage: apropos [-v] REGEXP\n\
 Flag -v indicates to produce a verbose output, showing full documentation\n\
 of the matching commands."));
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index e59e0c7040..eadf2af59f 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -959,8 +959,15 @@  print_doc_of_command (struct cmd_list_element *c, const char *prefix,
   if (verbose)
     fputs_highlighted (c->doc, highlight, stream);
   else
-    print_doc_line (stream, c->doc);
+    print_doc_line (stream, c->doc, false);
   fputs_filtered ("\n", stream);
+
+  /* Checks that the documentation does not help with a new line.
+     If it does, output a special marker string that gdb.base/help.exp
+     will detect.  */
+  if (c->doc[strlen (c->doc) - 1] == '\n')
+    fprintf_filtered (stream, "END_OF_LINE@END_OF_DOC %s%s\n",
+		      prefix, c->name);
 }
 
 /* Recursively walk the commandlist structures, and print out the
@@ -1198,9 +1205,11 @@  help_all (struct ui_file *stream)
 
 }
 
-/* Print only the first line of STR on STREAM.  */
+/* See cli-decode.h.  */
+
 void
-print_doc_line (struct ui_file *stream, const char *str)
+print_doc_line (struct ui_file *stream, const char *str,
+		bool for_value_prefix)
 {
   static char *line_buffer = 0;
   static int line_size;
@@ -1212,11 +1221,9 @@  print_doc_line (struct ui_file *stream, const char *str)
       line_buffer = (char *) xmalloc (line_size);
     }
 
-  /* Keep printing '.' or ',' not followed by a whitespace for embedded strings
-     like '.gdbinit'.  */
+  /* Searches for the first end of line or the end of STR.  */
   p = str;
-  while (*p && *p != '\n'
-	 && ((*p != '.' && *p != ',') || (p[1] && !isspace (p[1]))))
+  while (*p && *p != '\n')
     p++;
   if (p - str > line_size - 1)
     {
@@ -1225,9 +1232,18 @@  print_doc_line (struct ui_file *stream, const char *str)
       line_buffer = (char *) xmalloc (line_size);
     }
   strncpy (line_buffer, str, p - str);
-  line_buffer[p - str] = '\0';
-  if (islower (line_buffer[0]))
-    line_buffer[0] = toupper (line_buffer[0]);
+  if (for_value_prefix)
+    {
+      if (islower (line_buffer[0]))
+	line_buffer[0] = toupper (line_buffer[0]);
+      gdb_assert (p > str);
+      if (line_buffer[p - str - 1] == '.')
+	line_buffer[p - str - 1] = '\0';
+      else
+	line_buffer[p - str] = '\0';
+    }
+  else
+    line_buffer[p - str] = '\0';
   fputs_filtered (line_buffer, stream);
 }
 
@@ -1241,7 +1257,7 @@  print_help_for_command (struct cmd_list_element *c, const char *prefix,
   fprintf_styled (stream, title_style.style (),
 		  "%s%s", prefix, c->name);
   fputs_filtered (" -- ", stream);
-  print_doc_line (stream, c->doc);
+  print_doc_line (stream, c->doc, false);
   fputs_filtered ("\n", stream);
 
   if (recurse
diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h
index a9f9cbfb31..1be9014e92 100644
--- a/gdb/cli/cli-decode.h
+++ b/gdb/cli/cli-decode.h
@@ -257,9 +257,14 @@  extern void apropos_cmd (struct ui_file *, struct cmd_list_element *,
 
 extern void not_just_help_class_command (const char *arg, int from_tty);
 
-/* Exported to cli/cli-setshow.c */
-
-extern void print_doc_line (struct ui_file *, const char *);
+/* Print only the first line of STR on STREAM.
+   FOR_VALUE_PREFIX true indicates that the first line is output
+   to be a prefix to show a value (see deprecated_show_value_hack):
+   the first character is printed in uppercase, and the trailing
+   dot character is not printed.  */
+
+extern void print_doc_line (struct ui_file *stream, const char *str,
+			    bool for_value_prefix);
 
 extern const char * const auto_boolean_enums[];
 
diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c
index bef5f3939b..c90c83e7ec 100644
--- a/gdb/cli/cli-logging.c
+++ b/gdb/cli/cli-logging.c
@@ -207,10 +207,10 @@  _initialize_cli_logging (void)
   static struct cmd_list_element *set_logging_cmdlist, *show_logging_cmdlist;
 
   add_prefix_cmd ("logging", class_support, set_logging_command,
-		  _("Set logging options"), &set_logging_cmdlist,
+		  _("Set logging options."), &set_logging_cmdlist,
 		  "set logging ", 0, &setlist);
   add_prefix_cmd ("logging", class_support, show_logging_command,
-		  _("Show logging options"), &show_logging_cmdlist,
+		  _("Show logging options."), &show_logging_cmdlist,
 		  "show logging ", 0, &showlist);
   add_setshow_boolean_cmd ("overwrite", class_support, &logging_overwrite, _("\
 Set whether logging overwrites or appends to the log file."), _("\
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 5b87f905d0..b95aa3224e 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -110,8 +110,9 @@  deprecated_show_value_hack (struct ui_file *ignore_file,
   /* If there's no command or value, don't try to print it out.  */
   if (c == NULL || value == NULL)
     return;
-  /* Print doc minus "show" at start.  */
-  print_doc_line (gdb_stdout, c->doc + 5);
+  /* Print doc minus "Show " at start.  Tell print_doc_line that
+     this is for a 'show value' prefix.  */
+  print_doc_line (gdb_stdout, c->doc + 5, true);
   switch (c->var_type)
     {
     case var_string:
diff --git a/gdb/cli/cli-style.c b/gdb/cli/cli-style.c
index fb6486bfdf..e594e38cd6 100644
--- a/gdb/cli/cli-style.c
+++ b/gdb/cli/cli-style.c
@@ -206,24 +206,24 @@  cli_style_option::add_setshow_commands (enum command_class theclass,
 
   add_setshow_enum_cmd ("foreground", theclass, cli_colors,
 			&m_foreground,
-			_("Set the foreground color for this property"),
-			_("Show the foreground color for this property"),
+			_("Set the foreground color for this property."),
+			_("Show the foreground color for this property."),
 			nullptr,
 			nullptr,
 			do_show_foreground,
 			&m_set_list, &m_show_list, (void *) this);
   add_setshow_enum_cmd ("background", theclass, cli_colors,
 			&m_background,
-			_("Set the background color for this property"),
-			_("Show the background color for this property"),
+			_("Set the background color for this property."),
+			_("Show the background color for this property."),
 			nullptr,
 			nullptr,
 			do_show_background,
 			&m_set_list, &m_show_list, (void *) this);
   add_setshow_enum_cmd ("intensity", theclass, cli_intensities,
 			&m_intensity,
-			_("Set the display intensity for this property"),
-			_("Show the display intensity for this property"),
+			_("Set the display intensity for this property."),
+			_("Show the display intensity for this property."),
 			nullptr,
 			nullptr,
 			do_show_intensity,
@@ -290,11 +290,11 @@  void
 _initialize_cli_style ()
 {
   add_prefix_cmd ("style", no_class, set_style, _("\
-Style-specific settings\n\
+Style-specific settings.\n\
 Configure various style-related variables, such as colors"),
 		  &style_set_list, "set style ", 0, &setlist);
   add_prefix_cmd ("style", no_class, show_style, _("\
-Style-specific settings\n\
+Style-specific settings.\n\
 Configure various style-related variables, such as colors"),
 		  &style_show_list, "show style ", 0, &showlist);
 
@@ -341,34 +341,34 @@  it was not linked against GNU Source Highlight."
 
   STYLE_ADD_SETSHOW_COMMANDS (file_name_style,
 			      _("\
-Filename display styling\n\
+Filename display styling.\n\
 Configure filename colors and display intensity."));
 
   STYLE_ADD_SETSHOW_COMMANDS (function_name_style,
 			      _("\
-Function name display styling\n\
+Function name display styling.\n\
 Configure function name colors and display intensity"));
 
   STYLE_ADD_SETSHOW_COMMANDS (variable_name_style,
 			      _("\
-Variable name display styling\n\
+Variable name display styling.\n\
 Configure variable name colors and display intensity"));
 
   STYLE_ADD_SETSHOW_COMMANDS (address_style,
 			      _("\
-Address display styling\n\
+Address display styling.\n\
 Configure address colors and display intensity"));
 
   STYLE_ADD_SETSHOW_COMMANDS (title_style,
 			      _("\
-Title display styling\n\
+Title display styling.\n\
 Configure title colors and display intensity\n\
 Some commands (such as \"apropos -v REGEXP\") use the title style to improve\n\
 readability."));
 
   STYLE_ADD_SETSHOW_COMMANDS (highlight_style,
 			      _("\
-Highlight display styling\n\
+Highlight display styling.\n\
 Configure highlight colors and display intensity\n\
 Some commands use the highlight style to draw the attention to a part\n\
 of their output."));
diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
index 72920642d1..069cab8f84 100644
--- a/gdb/compile/compile.c
+++ b/gdb/compile/compile.c
@@ -974,8 +974,8 @@  When on, compile command debugging is enabled."),
 
   add_setshow_string_cmd ("compile-args", class_support,
 			  &compile_args,
-			  _("Set compile command GCC command-line arguments"),
-			  _("Show compile command GCC command-line arguments"),
+			  _("Set compile command GCC command-line arguments."),
+			  _("Show compile command GCC command-line arguments."),
 			  _("\
 Use options like -I (include file directory) or ABI settings.\n\
 String quoting is parsed like in shell, for example:\n\
@@ -1003,9 +1003,9 @@  String quoting is parsed like in shell, for example:\n\
   add_setshow_optional_filename_cmd ("compile-gcc", class_support,
 				     &compile_gcc,
 				     _("Set compile command "
-				       "GCC driver filename"),
+				       "GCC driver filename."),
 				     _("Show compile command "
-				       "GCC driver filename"),
+				       "GCC driver filename."),
 				     _("\
 It should be absolute filename of the gcc executable.\n\
 If empty the default target triplet will be searched in $PATH."),
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 9fcc2d2372..511fea81fa 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -56,7 +56,8 @@  static core_fns *sniff_core_bfd (gdbarch *core_gdbarch,
 static const target_info core_target_info = {
   "core",
   N_("Local core dump file"),
-  N_("Use a core file as a target.  Specify the filename of the core file.")
+  N_("Use a core file as a target.\n\
+Specify the filename of the core file.")
 };
 
 class core_target final : public process_stratum_target
diff --git a/gdb/disasm.c b/gdb/disasm.c
index ed740c26e0..4e58cb67f9 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -1136,7 +1136,7 @@  _initialize_disasm (void)
 					 &prospective_options, _("\
 Set the disassembler options.\n\
 Usage: set disassembler-options OPTION [,OPTION]...\n\n\
-See: 'show disassembler-options' for valid option values.\n"), _("\
+See: 'show disassembler-options' for valid option values."), _("\
 Show the disassembler options."), NULL,
 					 set_disassembler_options_sfunc,
 					 show_disassembler_options_sfunc,
diff --git a/gdb/dwarf-index-cache.c b/gdb/dwarf-index-cache.c
index 9513891a45..a47c671a5a 100644
--- a/gdb/dwarf-index-cache.c
+++ b/gdb/dwarf-index-cache.c
@@ -317,12 +317,12 @@  _initialize_index_cache ()
 
   /* set index-cache */
   add_prefix_cmd ("index-cache", class_files, set_index_cache_command,
-		  _("Set index-cache options"), &set_index_cache_prefix_list,
+		  _("Set index-cache options."), &set_index_cache_prefix_list,
 		  "set index-cache ", false, &setlist);
 
   /* show index-cache */
   add_prefix_cmd ("index-cache", class_files, show_index_cache_command,
-		  _("Show index-cache options"), &show_index_cache_prefix_list,
+		  _("Show index-cache options."), &show_index_cache_prefix_list,
 		  "show index-cache ", false, &showlist);
 
   /* set index-cache on */
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index e1d6bb2d58..ad42f853b7 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -25789,13 +25789,13 @@  _initialize_dwarf2_read (void)
 {
   add_prefix_cmd ("dwarf", class_maintenance, set_dwarf_cmd, _("\
 Set DWARF specific variables.\n\
-Configure DWARF variables such as the cache size"),
+Configure DWARF variables such as the cache size."),
                   &set_dwarf_cmdlist, "maintenance set dwarf ",
                   0/*allow-unknown*/, &maintenance_set_cmdlist);
 
   add_prefix_cmd ("dwarf", class_maintenance, show_dwarf_cmd, _("\
-Show DWARF specific variables\n\
-Show DWARF variables such as the cache size"),
+Show DWARF specific variables.\n\
+Show DWARF variables such as the cache size."),
                   &show_dwarf_cmdlist, "maintenance show dwarf ",
                   0/*allow-unknown*/, &maintenance_show_cmdlist);
 
diff --git a/gdb/filesystem.c b/gdb/filesystem.c
index fdc4713007..a942e7067d 100644
--- a/gdb/filesystem.c
+++ b/gdb/filesystem.c
@@ -83,8 +83,8 @@  _initialize_filesystem (void)
 			class_files,
 			target_file_system_kinds,
 			&target_file_system_kind, _("\
-Set assumed file system kind for target reported file names"), _("\
-Show assumed file system kind for target reported file names"),
+Set assumed file system kind for target reported file names."), _("\
+Show assumed file system kind for target reported file names."),
 			_("\
 If `unix', target file names (e.g., loaded shared library file names)\n\
 starting the forward slash (`/') character are considered absolute,\n\
diff --git a/gdb/frame.c b/gdb/frame.c
index f4303d13cc..0e12bf3834 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -2911,8 +2911,8 @@  Configure backtrace variables such as the backtrace limit"),
 		  &set_backtrace_cmdlist, "set backtrace ",
 		  0/*allow-unknown*/, &setlist);
   add_prefix_cmd ("backtrace", class_maintenance, show_backtrace_cmd, _("\
-Show backtrace specific variables\n\
-Show backtrace variables such as the backtrace limit"),
+Show backtrace specific variables.\n\
+Show backtrace variables such as the backtrace limit."),
 		  &show_backtrace_cmdlist, "show backtrace ",
 		  0/*allow-unknown*/, &showlist);
 
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 5eeac9270a..5692ac5132 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -3312,15 +3312,15 @@  This is the same as setting `task pause', `exceptions', and\n\
 
   /* Commands to show information about the task's ports.  */
   add_info ("send-rights", info_send_rights_cmd,
-	    _("Show information about the task's send rights"));
+	    _("Show information about the task's send rights."));
   add_info ("receive-rights", info_recv_rights_cmd,
-	    _("Show information about the task's receive rights"));
+	    _("Show information about the task's receive rights."));
   add_info ("port-rights", info_port_rights_cmd,
-	    _("Show information about the task's port rights"));
+	    _("Show information about the task's port rights."));
   add_info ("port-sets", info_port_sets_cmd,
-	    _("Show information about the task's port sets"));
+	    _("Show information about the task's port sets."));
   add_info ("dead-names", info_dead_names_cmd,
-	    _("Show information about the task's dead names"));
+	    _("Show information about the task's dead names."));
   add_info_alias ("ports", "port-rights", 1);
   add_info_alias ("port", "port-rights", 1);
   add_info_alias ("psets", "port-sets", 1);
diff --git a/gdb/infcall.c b/gdb/infcall.c
index f99206c458..be99673f67 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -1388,14 +1388,14 @@  will result in an error."),
   add_setshow_boolean_cmd ("coerce-float-to-double", class_obscure,
 			   &coerce_float_to_double_p, _("\
 Set coercion of floats to doubles when calling functions."), _("\
-Show coercion of floats to doubles when calling functions"), _("\
+Show coercion of floats to doubles when calling functions."), _("\
 Variables of type float should generally be converted to doubles before\n\
 calling an unprototyped function, and left alone when calling a prototyped\n\
 function.  However, some older debug info formats do not provide enough\n\
 information to determine that a function is prototyped.  If this flag is\n\
 set, GDB will perform the conversion for a function it considers\n\
 unprototyped.\n\
-The default is to perform the conversion.\n"),
+The default is to perform the conversion."),
 			   NULL,
 			   show_coerce_float_to_double_p,
 			   &setlist, &showlist);
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 00b55c828a..5361f1c000 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -3319,6 +3319,7 @@  reason)."));
   add_com_alias ("s", "step", class_run, 1);
 
   c = add_com ("until", class_run, until_command, _("\
+Execute until past the current line or past a LOCATION.\n\
 Execute until the program reaches a source line greater than the current\n\
 or a specified location (same args as break command) within the current \
 frame."));
@@ -3394,10 +3395,10 @@  in the named register groups."));
 	    _("Execution status of the program."));
 
   add_info ("float", info_float_command,
-	    _("Print the status of the floating point unit\n"));
+	    _("Print the status of the floating point unit."));
 
   add_info ("vector", info_vector_command,
-	    _("Print the status of the vector unit\n"));
+	    _("Print the status of the vector unit."));
 
   add_prefix_cmd ("proc", class_info, info_proc_cmd,
 		  _("\
diff --git a/gdb/interps.c b/gdb/interps.c
index 372bd73bf8..f2f137ca91 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -378,7 +378,7 @@  interpreter_exec_cmd (const char *args, int from_tty)
   nrules = prules.count ();
 
   if (nrules < 2)
-    error (_("Usage: interpreter-exec INTERPRETER [ COMMAND... ]"));
+    error (_("Usage: interpreter-exec INTERPRETER COMMAND..."));
 
   old_interp = ui_interp->current_interpreter;
 
@@ -447,8 +447,9 @@  _initialize_interpreter (void)
 
   c = add_cmd ("interpreter-exec", class_support,
 	       interpreter_exec_cmd, _("\
-Execute a command in an interpreter.  It takes two arguments:\n\
+Execute a command in an interpreter.\n\
+Usage: interpreter-exec INTERPRETER COMMAND...\n\
 The first argument is the name of the interpreter to use.\n\
-The second argument is the command to execute.\n"), &cmdlist);
+The following arguments are the commands to execute."), &cmdlist);
   set_cmd_completer (c, interpreter_completer);
 }
diff --git a/gdb/language.c b/gdb/language.c
index 2f561c456e..6fd84a985e 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -559,7 +559,7 @@  add_set_language_command ()
 
   doc.printf (_("Set the current source language.\n"
 		"The currently understood settings are:\n\nlocal or "
-		"auto    Automatic setting based on source file\n"));
+		"auto    Automatic setting based on source file"));
 
   for (const auto &lang : languages)
     {
@@ -570,7 +570,7 @@  add_set_language_command ()
 
       /* FIXME: i18n: for now assume that the human-readable name is
 	 just a capitalization of the internal name.  */
-      doc.printf ("%-16s Use the %c%s language\n",
+      doc.printf ("\n%-16s Use the %c%s language",
 		  lang->la_name,
 		  /* Capitalize first letter of language name.  */
 		  toupper (lang->la_name[0]),
@@ -1170,16 +1170,16 @@  _initialize_language (void)
 
   add_setshow_enum_cmd ("range", class_support, type_or_range_names,
 			&range,
-			_("Set range checking.  (on/warn/off/auto)"),
-			_("Show range checking.  (on/warn/off/auto)"),
+			_("Set range checking (on/warn/off/auto)."),
+			_("Show range checking (on/warn/off/auto)."),
 			NULL, set_range_command,
 			show_range_command,
 			&setchecklist, &showchecklist);
 
   add_setshow_enum_cmd ("case-sensitive", class_support, case_sensitive_names,
 			&case_sensitive, _("\
-Set case sensitivity in name search.  (on/off/auto)"), _("\
-Show case sensitivity in name search.  (on/off/auto)"), _("\
+Set case sensitivity in name search (on/off/auto)."), _("\
+Show case sensitivity in name search (on/off/auto)."), _("\
 For Fortran the default is off; for other languages the default is on."),
 			set_case_command,
 			show_case_command,
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index d323a716e3..160ddb6cbc 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -765,7 +765,8 @@  Fork a duplicate process (experimental)."));
      process.  */
 
   add_com ("restart", class_obscure, restart_command, _("\
-restart N: restore program context from a checkpoint.\n\
+Restore program context from a checkpoint.\n\
+Usage: restart N\n\
 Argument N is checkpoint ID, as displayed by 'info checkpoints'."));
 
   /* Delete checkpoint command: kill the process and remove it from
diff --git a/gdb/maint.c b/gdb/maint.c
index aaabb35224..12e0e36ea9 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -993,7 +993,7 @@  Commands for showing internal info about the program being debugged."),
   add_alias_cmd ("i", "info", class_maintenance, 1, &maintenancelist);
 
   add_cmd ("sections", class_maintenance, maintenance_info_sections, _("\
-List the BFD sections of the exec and core files. \n\
+List the BFD sections of the exec and core files.\n\
 Arguments may be any combination of:\n\
 	[one or more section names]\n\
 	ALLOC LOAD RELOC READONLY CODE DATA ROM CONSTRUCTOR\n\
@@ -1137,21 +1137,22 @@  Commands for checking internal gdb state."),
 	   &maintenancelist);
 
   add_cmd ("deprecate", class_maintenance, maintenance_deprecate, _("\
-Deprecate a command.  Note that this is just in here so the \n\
-testsuite can check the command deprecator. You probably shouldn't use this,\n\
-rather you should use the C function deprecate_cmd().  If you decide you \n\
-want to use it: maintenance deprecate 'commandname' \"replacement\". The \n\
-replacement is optional."), &maintenancelist);
+Deprecate a command (for testing purposes).\n\
+Usage: maintenance deprecate COMMANDNAME [\"REPLACEMENT\"]\n\
+This is used by the testsuite to check the command deprecator.\n\
+You probably shouldn't use this,\n\
+rather you should use the C function deprecate_cmd()."), &maintenancelist);
 
   add_cmd ("undeprecate", class_maintenance, maintenance_undeprecate, _("\
-Undeprecate a command.  Note that this is just in here so the \n\
-testsuite can check the command deprecator. You probably shouldn't use this,\n\
-If you decide you want to use it: maintenance undeprecate 'commandname'"),
+Undeprecate a command (for testing purposes).\n\
+Usage: maintenance undeprecate COMMANDNAME\n\
+This is used by the testsuite to check the command deprecator.\n\
+You probably shouldn't use this."),
 	   &maintenancelist);
 
   add_cmd ("selftest", class_maintenance, maintenance_selftest, _("\
 Run gdb's unit tests.\n\
-Usage: maintenance selftest [filter]\n\
+Usage: maintenance selftest [FILTER]\n\
 This will run any unit tests that were built in to gdb.\n\
 If a filter is given, only the tests with that value in their name will ran."),
 	   &maintenancelist);
diff --git a/gdb/memattr.c b/gdb/memattr.c
index 858a41abfb..cf819866b8 100644
--- a/gdb/memattr.c
+++ b/gdb/memattr.c
@@ -598,8 +598,8 @@  void
 _initialize_mem (void)
 {
   add_com ("mem", class_vars, mem_command, _("\
-Define attributes for memory region or reset memory region handling to\n\
-target-based.\n\
+Define attributes for memory region or reset memory region handling to "
+"target-based.\n\
 Usage: mem auto\n\
        mem LOW HIGH [MODE WIDTH CACHE],\n\
 where MODE  may be rw (read/write), ro (read-only) or wo (write-only),\n\
@@ -625,14 +625,14 @@  Usage: delete mem [ID]...\n\
 Do \"info mem\" to see current list of IDs."), &deletelist);
 
   add_info ("mem", info_mem_command,
-	    _("Memory region attributes"));
+	    _("Memory region attributes."));
 
   add_prefix_cmd ("mem", class_vars, dummy_cmd, _("\
-Memory regions settings"),
+Memory regions settings."),
 		  &mem_set_cmdlist, "set mem ",
 		  0/* allow-unknown */, &setlist);
   add_prefix_cmd ("mem", class_vars, dummy_cmd, _("\
-Memory regions settings"),
+Memory regions settings."),
 		  &mem_show_cmdlist, "show mem  ",
 		  0/* allow-unknown */, &showlist);
 
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 9e84594fe6..089d8ebc90 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -2729,7 +2729,7 @@  Usage: output EXP\n\
 This is useful in user-defined commands."));
 
   add_prefix_cmd ("set", class_vars, set_command, _("\
-Evaluate expression EXP and assign result to variable VAR\n\
+Evaluate expression EXP and assign result to variable VAR.\n\
 Usage: set VAR = EXP\n\
 This uses assignment syntax appropriate for the current language\n\
 (VAR = EXP or VAR := EXP for example).\n\
@@ -2743,7 +2743,7 @@  You can see these environment settings with the \"show\" command."),
 		  &setlist, "set ", 1, &cmdlist);
   if (dbx_commands)
     add_com ("assign", class_vars, set_command, _("\
-Evaluate expression EXP and assign result to variable VAR\n\
+Evaluate expression EXP and assign result to variable VAR.\n\
 Usage: assign VAR = EXP\n\
 This uses assignment syntax appropriate for the current language\n\
 (VAR = EXP or VAR := EXP for example).\n\
@@ -2764,7 +2764,7 @@  history, if it is not void."));
   set_cmd_completer (c, expression_completer);
 
   add_cmd ("variable", class_vars, set_command, _("\
-Evaluate expression EXP and assign result to variable VAR\n\
+Evaluate expression EXP and assign result to variable VAR.\n\
 Usage: set variable VAR = EXP\n\
 This uses assignment syntax appropriate for the current language\n\
 (VAR = EXP or VAR := EXP for example).\n\
diff --git a/gdb/python/lib/gdb/function/strfns.py b/gdb/python/lib/gdb/function/strfns.py
index d29ff61d6c..c56957bdb2 100644
--- a/gdb/python/lib/gdb/function/strfns.py
+++ b/gdb/python/lib/gdb/function/strfns.py
@@ -21,7 +21,7 @@  import re
 
 
 class _MemEq(gdb.Function):
-  """$_memeq - compare bytes of memory
+  """$_memeq - compare bytes of memory.
 
 Usage: $_memeq (A, B, LEN)
 
@@ -44,7 +44,7 @@  Returns:
 
 
 class _StrLen(gdb.Function):
-  """$_strlen - compute string length
+  """$_strlen - compute string length.
 
 Usage: $_strlen (A)
 
@@ -59,7 +59,7 @@  Returns:
 
 
 class _StrEq(gdb.Function):
-  """$_streq - check string equality
+  """$_streq - check string equality.
 
 Usage: $_streq (A, B)
 
@@ -77,7 +77,7 @@  Example (amd64-linux):
 
 
 class _RegEx(gdb.Function):
-  """$_regex - check if a string matches a regular expression
+  """$_regex - check if a string matches a regular expression.
 
 Usage: $_regex (STRING, REGEX)
 
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 4dad8ec10d..7629c68945 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1759,8 +1759,7 @@  argument, and if the command is an expression, the result will be\n\
 printed.  For example:\n\
 \n\
     (gdb) python-interactive 2 + 3\n\
-    5\n\
-")
+    5")
 #else /* HAVE_PYTHON */
 	   _("\
 Start a Python interactive prompt.\n\
diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
index 6636a89554..f217d949f6 100644
--- a/gdb/ravenscar-thread.c
+++ b/gdb/ravenscar-thread.c
@@ -601,17 +601,17 @@  _initialize_ravenscar ()
   gdb::observers::inferior_created.attach (ravenscar_inferior_created);
 
   add_prefix_cmd ("ravenscar", no_class, set_ravenscar_command,
-                  _("Prefix command for changing Ravenscar-specific settings"),
+                  _("Prefix command for changing Ravenscar-specific settings."),
                   &set_ravenscar_list, "set ravenscar ", 0, &setlist);
 
   add_prefix_cmd ("ravenscar", no_class, show_ravenscar_command,
-                  _("Prefix command for showing Ravenscar-specific settings"),
+                  _("Prefix command for showing Ravenscar-specific settings."),
                   &show_ravenscar_list, "show ravenscar ", 0, &showlist);
 
   add_setshow_boolean_cmd ("task-switching", class_obscure,
                            &ravenscar_task_support, _("\
-Enable or disable support for GNAT Ravenscar tasks"), _("\
-Show whether support for GNAT Ravenscar tasks is enabled"),
+Enable or disable support for GNAT Ravenscar tasks."), _("\
+Show whether support for GNAT Ravenscar tasks is enabled."),
                            _("\
 Enable or disable support for task/thread switching with the GNAT\n\
 Ravenscar run-time library for bareboard configuration."),
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index 21085d5c62..a2a1e9c6dd 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -3170,11 +3170,11 @@  This format may not be available on all processors."),
   add_alias_cmd ("pt", "btrace pt", class_obscure, 1, &record_cmdlist);
 
   add_prefix_cmd ("btrace", class_support, cmd_set_record_btrace,
-		  _("Set record options"), &set_record_btrace_cmdlist,
+		  _("Set record options."), &set_record_btrace_cmdlist,
 		  "set record btrace ", 0, &set_record_cmdlist);
 
   add_prefix_cmd ("btrace", class_support, cmd_show_record_btrace,
-		  _("Show record options"), &show_record_btrace_cmdlist,
+		  _("Show record options."), &show_record_btrace_cmdlist,
 		  "show record btrace ", 0, &show_record_cmdlist);
 
   add_setshow_enum_cmd ("replay-memory-access", no_class,
@@ -3203,7 +3203,7 @@  When GDB does not support that cpu, this option can be used to enable\n\
 workarounds for a similar cpu that GDB supports.\n\n\
 When set to \"none\", errata workarounds are disabled."),
 		  &set_record_btrace_cpu_cmdlist,
-		  _("set record btrace cpu "), 1,
+		  "set record btrace cpu ", 1,
 		  &set_record_btrace_cmdlist);
 
   add_cmd ("auto", class_support, cmd_set_record_btrace_cpu_auto, _("\
@@ -3219,12 +3219,12 @@  Show the cpu to be used for trace decode."),
 	   &show_record_btrace_cmdlist);
 
   add_prefix_cmd ("bts", class_support, cmd_set_record_btrace_bts,
-		  _("Set record btrace bts options"),
+		  _("Set record btrace bts options."),
 		  &set_record_btrace_bts_cmdlist,
 		  "set record btrace bts ", 0, &set_record_btrace_cmdlist);
 
   add_prefix_cmd ("bts", class_support, cmd_show_record_btrace_bts,
-		  _("Show record btrace bts options"),
+		  _("Show record btrace bts options."),
 		  &show_record_btrace_bts_cmdlist,
 		  "show record btrace bts ", 0, &show_record_btrace_cmdlist);
 
@@ -3243,12 +3243,12 @@  The trace buffer size may not be changed while recording."), NULL,
 			    &show_record_btrace_bts_cmdlist);
 
   add_prefix_cmd ("pt", class_support, cmd_set_record_btrace_pt,
-		  _("Set record btrace pt options"),
+		  _("Set record btrace pt options."),
 		  &set_record_btrace_pt_cmdlist,
 		  "set record btrace pt ", 0, &set_record_btrace_cmdlist);
 
   add_prefix_cmd ("pt", class_support, cmd_show_record_btrace_pt,
-		  _("Show record btrace pt options"),
+		  _("Show record btrace pt options."),
 		  &show_record_btrace_pt_cmdlist,
 		  "show record btrace pt ", 0, &show_record_btrace_cmdlist);
 
diff --git a/gdb/record-full.c b/gdb/record-full.c
index 95a0353d75..4eb63b19cf 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -2832,11 +2832,11 @@  Argument is filename.  File must be created with 'record save'."),
   deprecate_cmd (c, "record full restore");
 
   add_prefix_cmd ("full", class_support, set_record_full_command,
-		  _("Set record options"), &set_record_full_cmdlist,
+		  _("Set record options."), &set_record_full_cmdlist,
 		  "set record full ", 0, &set_record_cmdlist);
 
   add_prefix_cmd ("full", class_support, show_record_full_command,
-		  _("Show record options"), &show_record_full_cmdlist,
+		  _("Show record options."), &show_record_full_cmdlist,
 		  "show record full ", 0, &show_record_cmdlist);
 
   /* Record instructions number limit command.  */
diff --git a/gdb/record.c b/gdb/record.c
index 828c19968a..071531db57 100644
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -808,15 +808,15 @@  A size of \"unlimited\" means unlimited lines.  The default is 10."),
 
   add_com_alias ("rec", "record", class_obscure, 1);
   add_prefix_cmd ("record", class_support, set_record_command,
-		  _("Set record options"), &set_record_cmdlist,
+		  _("Set record options."), &set_record_cmdlist,
 		  "set record ", 0, &setlist);
   add_alias_cmd ("rec", "record", class_obscure, 1, &setlist);
   add_prefix_cmd ("record", class_support, show_record_command,
-		  _("Show record options"), &show_record_cmdlist,
+		  _("Show record options."), &show_record_cmdlist,
 		  "show record ", 0, &showlist);
   add_alias_cmd ("rec", "record", class_obscure, 1, &showlist);
   add_prefix_cmd ("record", class_support, info_record_command,
-		  _("Info record options"), &info_record_cmdlist,
+		  _("Info record options."), &info_record_cmdlist,
 		  "info record ", 0, &infolist);
   add_alias_cmd ("rec", "record", class_obscure, 1, &infolist);
 
diff --git a/gdb/regcache-dump.c b/gdb/regcache-dump.c
index 1bcf9c3d17..c8ae912284 100644
--- a/gdb/regcache-dump.c
+++ b/gdb/regcache-dump.c
@@ -328,8 +328,8 @@  _initialize_regcache_dump (void)
 	   &maintenanceprintlist);
   add_cmd ("remote-registers", class_maintenance,
 	   maintenance_print_remote_registers, _("\
-Print the internal register configuration including each register's\n\
-remote register number and buffer offset in the g/G packets.\n\
+Print the internal register configuration including remote register number "
+"and g/G packets offset.\n\
 Takes an optional file parameter."),
 	   &maintenanceprintlist);
 }
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 6e3eee9663..9e94ecc092 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -1820,7 +1820,7 @@  _initialize_regcache (void)
     (regcache::regcache_thread_ptid_changed);
 
   add_com ("flushregs", class_maintenance, reg_flush_command,
-	   _("Force gdb to flush its register cache (maintainer command)"));
+	   _("Force gdb to flush its register cache (maintainer command)."));
 
 #if GDB_SELF_TEST
   selftests::register_test ("current_regcache", selftests::current_regcache_test);
diff --git a/gdb/remote.c b/gdb/remote.c
index 124d254478..24057a7f97 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1825,10 +1825,10 @@  add_packet_config_cmd (struct packet_config *config, const char *name,
 
   config->name = name;
   config->title = title;
-  set_doc = xstrprintf ("Set use of remote protocol `%s' (%s) packet",
+  set_doc = xstrprintf ("Set use of remote protocol `%s' (%s) packet.",
 			name, title);
   show_doc = xstrprintf ("Show current use of remote "
-			 "protocol `%s' (%s) packet",
+			 "protocol `%s' (%s) packet.",
 			 name, title);
   /* set/show TITLE-packet {auto,on,off} */
   cmd_name = xstrprintf ("%s-packet", title);
@@ -11386,15 +11386,15 @@  init_remote_threadtests (void)
 {
   add_com ("tlist", class_obscure, threadlist_test_cmd,
 	   _("Fetch and print the remote list of "
-	     "thread identifiers, one pkt only"));
+	     "thread identifiers, one pkt only."));
   add_com ("tinfo", class_obscure, threadinfo_test_cmd,
-	   _("Fetch and display info about one thread"));
+	   _("Fetch and display info about one thread."));
   add_com ("tset", class_obscure, threadset_test_cmd,
-	   _("Test setting to a different thread"));
+	   _("Test setting to a different thread."));
   add_com ("tupd", class_obscure, threadlist_update_test_cmd,
-	   _("Iterate through updating all remote thread info"));
+	   _("Iterate through updating all remote thread info."));
   add_com ("talive", class_obscure, threadalive_test,
-	   _(" Remote thread alive test "));
+	   _("Remote thread alive test."));
 }
 
 #endif /* 0 */
@@ -14278,15 +14278,15 @@  _initialize_remote (void)
   /* set/show remote ...  */
 
   add_prefix_cmd ("remote", class_maintenance, set_remote_cmd, _("\
-Remote protocol specific variables\n\
+Remote protocol specific variables.\n\
 Configure various remote-protocol specific variables such as\n\
-the packets being used"),
+the packets being used."),
 		  &remote_set_cmdlist, "set remote ",
 		  0 /* allow-unknown */, &setlist);
   add_prefix_cmd ("remote", class_maintenance, show_remote_cmd, _("\
-Remote protocol specific variables\n\
+Remote protocol specific variables.\n\
 Configure various remote-protocol specific variables such as\n\
-the packets being used"),
+the packets being used."),
 		  &remote_show_cmdlist, "show remote ",
 		  0 /* allow-unknown */, &showlist);
 
@@ -14330,8 +14330,8 @@  Valid value is \"Ctrl-C\", \"BREAK\" or \"BREAK-g\". The default is \"Ctrl-C\"."
 
   add_setshow_boolean_cmd ("interrupt-on-connect", class_support,
 			   &interrupt_on_connect, _("\
-Set whether interrupt-sequence is sent to remote target when gdb connects to."), _("		\
-Show whether interrupt-sequence is sent to remote target when gdb connects to."), _("		\
+Set whether interrupt-sequence is sent to remote target when gdb connects to."), _("\
+Show whether interrupt-sequence is sent to remote target when gdb connects to."), _("\
 If set, interrupt sequence is sent to remote target."),
 			   NULL, NULL,
 			   &remote_set_cmdlist, &remote_show_cmdlist);
@@ -14699,8 +14699,8 @@  Show the maximum size of the address (in bits) in a memory packet."), NULL,
      documentation).  */
   add_setshow_auto_boolean_cmd ("Z-packet", class_obscure,
 				&remote_Z_packet_detect, _("\
-Set use of remote protocol `Z' packets"), _("\
-Show use of remote protocol `Z' packets "), _("\
+Set use of remote protocol `Z' packets."), _("\
+Show use of remote protocol `Z' packets."), _("\
 When set, GDB will attempt to use the remote breakpoint and watchpoint\n\
 packets."),
 				set_remote_protocol_Z_packet_cmd,
@@ -14710,7 +14710,7 @@  packets."),
 				&remote_set_cmdlist, &remote_show_cmdlist);
 
   add_prefix_cmd ("remote", class_files, remote_command, _("\
-Manipulate files on the remote system\n\
+Manipulate files on the remote system.\n\
 Transfer files to and from the remote target system."),
 		  &remote_cmdlist, "remote ",
 		  0 /* allow-unknown */, &cmdlist);
@@ -14729,8 +14729,8 @@  Transfer files to and from the remote target system."),
 
   add_setshow_string_noescape_cmd ("exec-file", class_files,
 				   &remote_exec_file_var, _("\
-Set the remote pathname for \"run\""), _("\
-Show the remote pathname for \"run\""), NULL,
+Set the remote pathname for \"run\"."), _("\
+Show the remote pathname for \"run\"."), NULL,
 				   set_remote_exec_file,
 				   show_remote_exec_file,
 				   &remote_set_cmdlist,
diff --git a/gdb/reverse.c b/gdb/reverse.c
index 7add7d6815..f2d2bf029b 100644
--- a/gdb/reverse.c
+++ b/gdb/reverse.c
@@ -373,12 +373,12 @@  session."));
   add_cmd ("bookmark", class_bookmark, delete_bookmark_command, _("\
 Delete a bookmark from the bookmark list.\n\
 Argument is a bookmark number or numbers,\n\
- or no argument to delete all bookmarks.\n"),
+ or no argument to delete all bookmarks."),
 	   &deletelist);
   add_com ("goto-bookmark", class_bookmark, goto_bookmark_command, _("\
 Go to an earlier-bookmarked point in the program's execution history.\n\
 Argument is the bookmark number of a bookmark saved earlier by using \n\
 the 'bookmark' command, or the special arguments:\n\
   start (beginning of recording)\n\
-  end   (end of recording)\n"));
+  end   (end of recording)"));
 }
diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
index 5aa7105dc2..fa68656446 100644
--- a/gdb/ser-tcp.c
+++ b/gdb/ser-tcp.c
@@ -480,27 +480,27 @@  _initialize_ser_tcp (void)
 #endif /* USE_WIN32API */
 
   add_prefix_cmd ("tcp", class_maintenance, set_tcp_cmd, _("\
-TCP protocol specific variables\n\
-Configure variables specific to remote TCP connections"),
+TCP protocol specific variables.\n\
+Configure variables specific to remote TCP connections."),
 		  &tcp_set_cmdlist, "set tcp ",
 		  0 /* allow-unknown */, &setlist);
   add_prefix_cmd ("tcp", class_maintenance, show_tcp_cmd, _("\
-TCP protocol specific variables\n\
-Configure variables specific to remote TCP connections"),
+TCP protocol specific variables.\n\
+Configure variables specific to remote TCP connections."),
 		  &tcp_show_cmdlist, "show tcp ",
 		  0 /* allow-unknown */, &showlist);
 
   add_setshow_boolean_cmd ("auto-retry", class_obscure,
 			   &tcp_auto_retry, _("\
-Set auto-retry on socket connect"), _("\
-Show auto-retry on socket connect"), 
+Set auto-retry on socket connect."), _("\
+Show auto-retry on socket connect."),
 			   NULL, NULL, NULL,
 			   &tcp_set_cmdlist, &tcp_show_cmdlist);
 
   add_setshow_uinteger_cmd ("connect-timeout", class_obscure,
 			    &tcp_retry_limit, _("\
-Set timeout limit in seconds for socket connection"), _("\
-Show timeout limit in seconds for socket connection"), _("\
+Set timeout limit in seconds for socket connection."), _("\
+Show timeout limit in seconds for socket connection."), _("\
 If set to \"unlimited\", GDB will keep attempting to establish a\n\
 connection forever, unless interrupted with Ctrl-c.\n\
 The default is 15 seconds."),
diff --git a/gdb/serial.c b/gdb/serial.c
index bc8d910a5a..a881bbc97c 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -706,8 +706,8 @@  using remote targets."),
 
   add_setshow_enum_cmd ("parity", no_class, parity_enums,
                         &parity, _("\
-Set parity for remote serial I/O"), _("\
-Show parity for remote serial I/O"), NULL,
+Set parity for remote serial I/O."), _("\
+Show parity for remote serial I/O."), NULL,
                         set_parity,
                         NULL, /* FIXME: i18n: */
                         &serial_set_cmdlist, &serial_show_cmdlist);
@@ -723,8 +723,8 @@  by gdbserver."),
 
   add_setshow_enum_cmd ("remotelogbase", no_class, logbase_enums,
 			&serial_logbase, _("\
-Set numerical base for remote session logging"), _("\
-Show numerical base for remote session logging"), NULL,
+Set numerical base for remote session logging."), _("\
+Show numerical base for remote session logging."), NULL,
 			NULL,
 			NULL, /* FIXME: i18n: */
 			&setlist, &showlist);
diff --git a/gdb/skip.c b/gdb/skip.c
index 127b11dc44..22bb35f995 100644
--- a/gdb/skip.c
+++ b/gdb/skip.c
@@ -696,41 +696,45 @@  If no function name is given, skip the current function."),
   set_cmd_completer (c, location_completer);
 
   c = add_cmd ("enable", class_breakpoint, skip_enable_command, _("\
-Enable skip entries.  You can specify numbers (e.g. \"skip enable 1 3\"), \
+Enable skip entries.\n\
+Usage: skip enable [NUMBER | RANGE]...\n\
+You can specify numbers (e.g. \"skip enable 1 3\"),\n\
 ranges (e.g. \"skip enable 4-8\"), or both (e.g. \"skip enable 1 3 4-8\").\n\n\
-If you don't specify any numbers or ranges, we'll enable all skip entries.\n\n\
-Usage: skip enable [NUMBER | RANGE]..."),
+If you don't specify any numbers or ranges, we'll enable all skip entries."),
 	       &skiplist);
   set_cmd_completer (c, complete_skip_number);
 
   c = add_cmd ("disable", class_breakpoint, skip_disable_command, _("\
-Disable skip entries.  You can specify numbers (e.g. \"skip disable 1 3\"), \
+Disable skip entries.\n\
+Usage: skip disable [NUMBER | RANGE]...\n\
+You can specify numbers (e.g. \"skip disable 1 3\"),\n\
 ranges (e.g. \"skip disable 4-8\"), or both (e.g. \"skip disable 1 3 4-8\").\n\n\
-If you don't specify any numbers or ranges, we'll disable all skip entries.\n\n\
-Usage: skip disable [NUMBER | RANGE]..."),
+If you don't specify any numbers or ranges, we'll disable all skip entries."),
 	       &skiplist);
   set_cmd_completer (c, complete_skip_number);
 
   c = add_cmd ("delete", class_breakpoint, skip_delete_command, _("\
-Delete skip entries.  You can specify numbers (e.g. \"skip delete 1 3\"), \
+Delete skip entries.\n\
+Usage: skip delete [NUMBER | RANGES]...\n\
+You can specify numbers (e.g. \"skip delete 1 3\"),\n\
 ranges (e.g. \"skip delete 4-8\"), or both (e.g. \"skip delete 1 3 4-8\").\n\n\
-If you don't specify any numbers or ranges, we'll delete all skip entries.\n\n\
-Usage: skip delete [NUMBER | RANGES]..."),
+If you don't specify any numbers or ranges, we'll delete all skip entries."),
 	       &skiplist);
   set_cmd_completer (c, complete_skip_number);
 
   add_info ("skip", info_skip_command, _("\
-Display the status of skips.  You can specify numbers (e.g. \"info skip 1 3\"), \
+Display the status of skips.\n\
+Usage: info skip [NUMBER | RANGES]...\n\
+You can specify numbers (e.g. \"info skip 1 3\"), \n\
 ranges (e.g. \"info skip 4-8\"), or both (e.g. \"info skip 1 3 4-8\").\n\n\
-If you don't specify any numbers or ranges, we'll show all skips.\n\n\
-Usage: info skip [NUMBER | RANGES]..."));
+If you don't specify any numbers or ranges, we'll show all skips."));
   set_cmd_completer (c, complete_skip_number);
 
   add_setshow_boolean_cmd ("skip", class_maintenance,
 			   &debug_skip, _("\
 Set whether to print the debug output about skipping files and functions."),
 			   _("\
-Show whether the debug output about skipping files and functions is printed"),
+Show whether the debug output about skipping files and functions is printed."),
 			   _("\
 When non-zero, debug output about skipping files and functions is displayed."),
 			   NULL, NULL,
diff --git a/gdb/source.c b/gdb/source.c
index 00052e67cb..7c6084fa8d 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1956,6 +1956,7 @@  A value of \"unlimited\", or zero, means there's no limit."),
 
   add_cmd ("substitute-path", class_files, set_substitute_path_command,
            _("\
+Add a substitution rule to rewrite source files names directories.\n\
 Usage: set substitute-path FROM TO\n\
 Add a substitution rule replacing FROM into TO in source file names.\n\
 If a substitution rule was previously set for FROM, the old rule\n\
@@ -1964,6 +1965,7 @@  is replaced by the new one."),
 
   add_cmd ("substitute-path", class_files, unset_substitute_path_command,
            _("\
+Delete one or all substitution rules rewriting source files names directories.\n\
 Usage: unset substitute-path [FROM]\n\
 Delete the rule for substituting FROM in source file names.  If FROM\n\
 is not specified, all substituting rules are deleted.\n\
@@ -1972,6 +1974,7 @@  If the debugger cannot find a rule for FROM, it will display a warning."),
 
   add_cmd ("substitute-path", class_files, show_substitute_path_command,
            _("\
+Show one or all substitution rules rewriting source files names directories.\n\
 Usage: show substitute-path [FROM]\n\
 Print the rule for substituting FROM in source file names. If FROM\n\
 is not specified, print all substitution rules."),
diff --git a/gdb/stack.c b/gdb/stack.c
index 408c795e38..b9a5369cde 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -2957,7 +2957,7 @@  A single numerical argument specifies the frame to select."),
 
   add_cmd ("address", class_stack, &frame_cmd.address,
 	   _("\
-Select and print a stack frame by stack address\n\
+Select and print a stack frame by stack address.\n\
 \n\
 Usage: frame address STACK-ADDRESS"),
 	   &frame_cmd_list);
@@ -3102,8 +3102,8 @@  Usage: func NAME"));
 
   add_setshow_enum_cmd ("frame-arguments", class_stack,
 			print_frame_arguments_choices, &print_frame_arguments,
-			_("Set printing of non-scalar frame arguments"),
-			_("Show printing of non-scalar frame arguments"),
+			_("Set printing of non-scalar frame arguments."),
+			_("Show printing of non-scalar frame arguments."),
 			NULL, NULL, NULL, &setprintlist, &showprintlist);
 
   add_setshow_boolean_cmd ("frame-arguments", no_class,
@@ -3138,9 +3138,9 @@  source line."),
   add_setshow_enum_cmd ("entry-values", class_stack,
 			print_entry_values_choices, &print_entry_values,
 			_("Set printing of function arguments at function "
-			  "entry"),
+			  "entry."),
 			_("Show printing of function arguments at function "
-			  "entry"),
+			  "entry."),
 			_("\
 GDB can sometimes determine the values of function arguments at entry,\n\
 in addition to their current values.  This option tells GDB whether\n\
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 26762d289c..ca4ef6aec3 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -3947,8 +3947,8 @@  that lies within the boundaries of this symbol file in memory."),
 	       &cmdlist);
 
   c = add_cmd ("load", class_files, load_command, _("\
-Dynamically load FILE into the running program, and record its symbols\n\
-for access from GDB.\n\
+Dynamically load FILE into the running program.\n\
+FILE symbols are recorded for access from GDB.\n\
 Usage: load [FILE] [OFFSET]\n\
 An optional load OFFSET may also be given as a literal address.\n\
 When OFFSET is provided, FILE must also be provided.  FILE can be provided\n\
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 130d5cd48f..7d088c0b16 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -6048,8 +6048,7 @@  Prints the functions.\n"),
   add_setshow_enum_cmd ("multiple-symbols", no_class,
                         multiple_symbols_modes, &multiple_symbols_mode,
                         _("\
-Set the debugger behavior when more than one symbol are possible matches\n\
-in an expression."), _("\
+Set how the debugger handles ambiguities in expressions."), _("\
 Show how the debugger handles ambiguities in expressions."), _("\
 Valid values are \"ask\", \"all\", \"cancel\", and the default is \"all\"."),
                         NULL, NULL, &setlist, &showlist);
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index bd33091ba9..6805d9e415 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -1845,8 +1845,8 @@  Unset target description specific variables."),
   add_setshow_filename_cmd ("filename", class_obscure,
 			    &tdesc_filename_cmd_string,
 			    _("\
-Set the file to read for an XML target description"), _("\
-Show the file to read for an XML target description"), _("\
+Set the file to read for an XML target description."), _("\
+Show the file to read for an XML target description."), _("\
 When set, GDB will read the target description from a local\n\
 file instead of querying the remote target."),
 			    set_tdesc_filename_cmd,
@@ -1854,8 +1854,8 @@  file instead of querying the remote target."),
 			    &tdesc_set_cmdlist, &tdesc_show_cmdlist);
 
   add_cmd ("filename", class_obscure, unset_tdesc_filename_cmd, _("\
-Unset the file to read for an XML target description.  When unset,\n\
-GDB will read the description from the target."),
+Unset the file to read for an XML target description.\n\
+When unset, GDB will read the description from the target."),
 	   &tdesc_unset_cmdlist);
 
   add_cmd ("c-tdesc", class_maintenance, maint_print_c_tdesc_cmd, _("\
@@ -1866,6 +1866,7 @@  Print the current target description as a C source file."),
 
   cmd = add_cmd ("xml-descriptions", class_maintenance,
 		 maintenance_check_xml_descriptions, _("\
+Check equality of GDB target descriptions and XML created descriptions.\n\
 Check the target descriptions created in GDB equal the descriptions\n\
 created from XML files in the directory.\n\
 The parameter is the directory name."),
diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp
index e65f7c875f..921b3807f6 100644
--- a/gdb/testsuite/gdb.base/help.exp
+++ b/gdb/testsuite/gdb.base/help.exp
@@ -80,7 +80,8 @@  gdb_test "help commands" "Set commands to be executed when the given breakpoints
 # Test a prefix command.  "delete" is picked at random.
 # test help delete "d" abbreviation
 set expected_help_delete {
-    "Delete some breakpoints or auto-display expressions\.\[\r\n\]+"
+    "Delete all or some breakpoints or auto-display expressions\.\[\r\n\]+"
+    "Usage: delete \\\[BREAKPOINTNUM\\\]...\[\r\n\]+"
     "Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+"
     "To delete all breakpoints, give no argument\.\[\r\n\]+"
     "Also a prefix command for deletion of other GDB objects\.\[\r\n\]+"
@@ -117,8 +118,18 @@  gdb_test "help info bogus-gdb-command" "Undefined info command: \"bogus-gdb-comm
 gdb_test "help gotcha" "Undefined command: \"gotcha\"\.  Try \"help\"\." "help gotcha"
 
 # test apropos regex
-gdb_test "apropos \\\(print\[\^\[ bsiedf\\\".-\]\\\)" "handle -- Specify how to handle signals"
+gdb_test "apropos \\\(print\[\^\[ bsiedf\\\".-\]\\\)" "handle -- Specify how to handle signals\."
 # test apropos >1 word string
-gdb_test "apropos handle signal" "handle -- Specify how to handle signals"
+gdb_test "apropos handle signal" "handle -- Specify how to handle signals\."
 # test apropos apropos
 gdb_test "apropos apropos" "apropos -- Search for commands matching a REGEXP.*"
+
+# Verify the following invariants for the doc help of all commands:
+#   First line is terminated by a '.' character.
+#   The last character of the doc is not a new line.
+# To test this last invariant, GDB apropos command outputs a line
+# that starts with END_OF_LINE@END_OF_DOC when it finds such
+# a new line at the end of a help doc.
+gdb_test_no_output \
+    "|apropos .| grep -e '\[^\.\]$' -e '^END_OF_LINE@END_OF_DOC '" \
+    "command help doc first line ends with a dot, doc does not end with eol"
diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp
index a17f201486..5de1ad64c6 100644
--- a/gdb/testsuite/gdb.base/style.exp
+++ b/gdb/testsuite/gdb.base/style.exp
@@ -101,8 +101,8 @@  save_vars { env(TERM) } {
 	[multi_line \
 	     "List of classes of commands:" \
 	     "" \
-	     "${aliases_expr} -- Aliases of other commands" \
-	     "${breakpoints_expr} -- Making program stop at certain points" \
+	     "${aliases_expr} -- Aliases of other commands\." \
+	     "${breakpoints_expr} -- Making program stop at certain points\." \
 	     ".*" \
 	    ] \
 	"help classes of commands styled with title"
diff --git a/gdb/top.c b/gdb/top.c
index 4f55d6af1e..9cf318f010 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -2113,8 +2113,8 @@  init_main (void)
 
   add_setshow_string_cmd ("prompt", class_support,
 			  &top_prompt,
-			  _("Set gdb's prompt"),
-			  _("Show gdb's prompt"),
+			  _("Set gdb's prompt."),
+			  _("Show gdb's prompt."),
 			  NULL, NULL,
 			  show_prompt,
 			  &setlist, &showlist);
@@ -2146,9 +2146,9 @@  Without an argument, saving is enabled."),
 
   add_setshow_zuinteger_unlimited_cmd ("size", no_class,
 				       &history_size_setshow_var, _("\
-Set the size of the command history,"), _("\
-Show the size of the command history,"), _("\
-ie. the number of previous commands to keep a record of.\n\
+Set the size of the command history."), _("\
+Show the size of the command history."), _("\
+This is the number of previous commands to keep a record of.\n\
 If set to \"unlimited\", the number of commands kept in the history\n\
 list is unlimited.  This defaults to the value of the environment\n\
 variable \"GDBHISTSIZE\", or to 256 if this variable is not set."),
@@ -2172,8 +2172,8 @@  By default this option is set to 0."),
 			   &sethistlist, &showhistlist);
 
   add_setshow_filename_cmd ("filename", no_class, &history_filename, _("\
-Set the filename in which to record the command history"), _("\
-Show the filename in which to record the command history"), _("\
+Set the filename in which to record the command history."), _("\
+Show the filename in which to record the command history."), _("\
 (the list of previous commands of which a record is kept)."),
 			    set_history_filename,
 			    show_history_filename,
@@ -2228,9 +2228,10 @@  input settings."),
                         &setlist, &showlist);
 
   c = add_cmd ("new-ui", class_support, new_ui_command, _("\
-Create a new UI.  It takes two arguments:\n\
+Create a new UI.\n\
+Usage: new-ui INTERPRETER TTY\n\
 The first argument is the name of the interpreter to run.\n\
-The second argument is the terminal the UI runs on.\n"), &cmdlist);
+The second argument is the terminal the UI runs on."), &cmdlist);
   set_cmd_completer (c, interpreter_completer);
 }
 
diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c
index 593556a8ba..4f0c41bce5 100644
--- a/gdb/tracefile-tfile.c
+++ b/gdb/tracefile-tfile.c
@@ -43,7 +43,8 @@ 
 static const target_info tfile_target_info = {
   "tfile",
   N_("Local trace dump file"),
-  N_("Use a trace file as a target.  Specify the filename of the trace file.")
+  N_("Use a trace file as a target.\n\
+Specify the filename of the trace file.")
 };
 
 class tfile_target final : public tracefile_target
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index c7585c6783..5a499227e5 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -4001,7 +4001,7 @@  _initialize_tracepoint (void)
   tracepoint_number = -1;
 
   add_info ("scope", info_scope_command,
-	    _("List the variables local to a scope"));
+	    _("List the variables local to a scope."));
 
   add_cmd ("tracepoints", class_trace,
 	   _("Tracing of program execution without stopping the program."),
@@ -4024,16 +4024,14 @@  If no arguments are supplied, delete all variables."), &deletelist);
   /* FIXME add a trace variable completer.  */
 
   add_info ("tvariables", info_tvariables_command, _("\
-Status of trace state variables and their values.\n\
-"));
+Status of trace state variables and their values."));
 
   add_info ("static-tracepoint-markers",
 	    info_static_tracepoint_markers_command, _("\
-List target static tracepoints markers.\n\
-"));
+List target static tracepoints markers."));
 
   add_prefix_cmd ("tfind", class_trace, tfind_command, _("\
-Select a trace frame;\n\
+Select a trace frame.\n\
 No argument means forward by one frame; '-' means backward by one frame."),
 		  &tfindlist, "tfind ", 1, &cmdlist);
 
@@ -4134,8 +4132,8 @@  depending on target's capabilities."));
   default_collect = xstrdup ("");
   add_setshow_string_cmd ("default-collect", class_trace,
 			  &default_collect, _("\
-Set the list of expressions to collect by default"), _("\
-Show the list of expressions to collect by default"), NULL,
+Set the list of expressions to collect by default."), _("\
+Show the list of expressions to collect by default."), NULL,
 			  NULL, NULL,
 			  &setlist, &showlist);
 
@@ -4175,22 +4173,22 @@  disables any attempt to set the buffer size and lets the target choose."),
 
   add_setshow_string_cmd ("trace-user", class_trace,
 			  &trace_user, _("\
-Set the user name to use for current and future trace runs"), _("\
-Show the user name to use for current and future trace runs"), NULL,
+Set the user name to use for current and future trace runs."), _("\
+Show the user name to use for current and future trace runs."), NULL,
 			  set_trace_user, NULL,
 			  &setlist, &showlist);
 
   add_setshow_string_cmd ("trace-notes", class_trace,
 			  &trace_notes, _("\
-Set notes string to use for current and future trace runs"), _("\
-Show the notes string to use for current and future trace runs"), NULL,
+Set notes string to use for current and future trace runs."), _("\
+Show the notes string to use for current and future trace runs."), NULL,
 			  set_trace_notes, NULL,
 			  &setlist, &showlist);
 
   add_setshow_string_cmd ("trace-stop-notes", class_trace,
 			  &trace_stop_notes, _("\
-Set notes string to use for future tstop commands"), _("\
-Show the notes string to use for future tstop commands"), NULL,
+Set notes string to use for future tstop commands."), _("\
+Show the notes string to use for future tstop commands."), NULL,
 			  set_trace_stop_notes, NULL,
 			  &setlist, &showlist);
 }
diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index f4e926e706..da50ced607 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -384,7 +384,7 @@  Layout names are:\n\
            register window is displayed. If the\n\
            source/assembly/command (split) is displayed, \n\
            the register window is displayed with \n\
-           the window that has current logical focus.\n"));
+           the window that has current logical focus."));
   set_cmd_completer (cmd, layout_completer);
 }
 
diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c
index b85b7a5d43..79f1f6fbbe 100644
--- a/gdb/tui/tui-stack.c
+++ b/gdb/tui/tui-stack.c
@@ -495,7 +495,7 @@  _initialize_tui_stack (void)
 {
   add_com ("update", class_tui, tui_update_command,
 	   _("Update the source window and locator to "
-	     "display the current execution point.\n"));
+	     "display the current execution point."));
 }
 
 /* Command to update the display with the current execution point.  */
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index a24f25928e..d0797c985e 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -1657,20 +1657,20 @@  _initialize_tui_win (void)
   /* Define the classes of commands.
      They will appear in the help list in the reverse of this order.  */
   add_prefix_cmd ("tui", class_tui, set_tui_cmd,
-                  _("TUI configuration variables"),
+                  _("TUI configuration variables."),
 		  &tui_setlist, "set tui ",
 		  0 /* allow-unknown */, &setlist);
   add_prefix_cmd ("tui", class_tui, show_tui_cmd,
-                  _("TUI configuration variables"),
+                  _("TUI configuration variables."),
 		  &tui_showlist, "show tui ",
 		  0 /* allow-unknown */, &showlist);
 
   add_com ("refresh", class_tui, tui_refresh_all_command,
-           _("Refresh the terminal display.\n"));
+           _("Refresh the terminal display."));
 
   cmd = add_com ("tabset", class_tui, tui_set_tab_width_command, _("\
 Set the width (in characters) of tab stops.\n\
-Usage: tabset N\n"));
+Usage: tabset N"));
   deprecate_cmd (cmd, "set tui tab-width");
 
   cmd = add_com ("winheight", class_tui, tui_set_win_height_command, _("\
@@ -1680,11 +1680,11 @@  WIN_HEIGHT_USAGE
 src  : the source window\n\
 cmd  : the command window\n\
 asm  : the disassembly window\n\
-regs : the register display\n"));
+regs : the register display"));
   add_com_alias ("wh", "winheight", class_tui, 0);
   set_cmd_completer (cmd, winheight_completer);
   add_info ("win", tui_all_windows_info,
-	    _("List of all displayed windows.\n"));
+	    _("List of all displayed windows."));
   cmd = add_com ("focus", class_tui, tui_set_focus_command, _("\
 Set focus to named window or next/prev window.\n"
 FOCUS_USAGE
@@ -1692,21 +1692,21 @@  FOCUS_USAGE
 src  : the source window\n\
 asm  : the disassembly window\n\
 regs : the register display\n\
-cmd  : the command window\n"));
+cmd  : the command window"));
   add_com_alias ("fs", "focus", class_tui, 0);
   set_cmd_completer (cmd, focus_completer);
   add_com ("+", class_tui, tui_scroll_forward_command, _("\
 Scroll window forward.\n\
-Usage: + [WIN] [N]\n"));
+Usage: + [WIN] [N]"));
   add_com ("-", class_tui, tui_scroll_backward_command, _("\
 Scroll window backward.\n\
-Usage: - [WIN] [N]\n"));
+Usage: - [WIN] [N]"));
   add_com ("<", class_tui, tui_scroll_left_command, _("\
 Scroll window text to the left.\n\
-Usage: < [WIN] [N]\n"));
+Usage: < [WIN] [N]"));
   add_com (">", class_tui, tui_scroll_right_command, _("\
 Scroll window text to the right.\n\
-Usage: > [WIN] [N]\n"));
+Usage: > [WIN] [N]"));
 
   /* Define the tui control variables.  */
   add_setshow_enum_cmd ("border-kind", no_class, tui_border_kind_enums,
@@ -1756,7 +1756,7 @@  bold-standout   use extra bright or bold with standout mode"),
   add_setshow_zuinteger_cmd ("tab-width", no_class,
 			     &internal_tab_width, _("\
 Set the tab width, in characters, for the TUI."), _("\
-Show the tab witdh, in characters, for the TUI"), _("\
+Show the tab witdh, in characters, for the TUI."), _("\
 This variable controls how many spaces are used to display a tab character."),
 			     tui_set_tab_width, tui_show_tab_width,
 			     &tui_setlist, &tui_showlist);
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index 7a44dbdb31..6a052005d4 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -817,7 +817,7 @@  Available FLAGS are:\n\
   /M    print methods defined in a class\n\
   /t    do not print typedefs defined in a class\n\
   /T    print typedefs defined in a class\n\
-  /o    print offsets and sizes of fields in a struct (like pahole)\n"));
+  /o    print offsets and sizes of fields in a struct (like pahole)"));
   set_cmd_completer (c, expression_completer);
 
   c = add_com ("whatis", class_vars, whatis_command,
diff --git a/gdb/user-regs.c b/gdb/user-regs.c
index 44a82ff587..d961d1be4c 100644
--- a/gdb/user-regs.c
+++ b/gdb/user-regs.c
@@ -240,6 +240,6 @@  _initialize_user_regs (void)
 
   add_cmd ("user-registers", class_maintenance,
 	   maintenance_print_user_registers,
-	   _("List the names of the current user registers.\n"),
+	   _("List the names of the current user registers."),
 	   &maintenanceprintlist);
 }
diff --git a/gdb/utils.c b/gdb/utils.c
index f55661287e..88450cccba 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -530,10 +530,10 @@  add_internal_problem_command (struct internal_problem *problem)
   if (problem->user_settable_should_quit)
     {
       set_doc = xstrprintf (_("Set whether GDB should quit "
-			      "when an %s is detected"),
+			      "when an %s is detected."),
 			    problem->name);
       show_doc = xstrprintf (_("Show whether GDB will quit "
-			       "when an %s is detected"),
+			       "when an %s is detected."),
 			     problem->name);
       add_setshow_enum_cmd ("quit", class_maintenance,
 			    internal_problem_modes,
@@ -553,10 +553,10 @@  add_internal_problem_command (struct internal_problem *problem)
   if (problem->user_settable_should_dump_core)
     {
       set_doc = xstrprintf (_("Set whether GDB should create a core "
-			      "file of GDB when %s is detected"),
+			      "file of GDB when %s is detected."),
 			    problem->name);
       show_doc = xstrprintf (_("Show whether GDB will create a core "
-			       "file of GDB when %s is detected"),
+			       "file of GDB when %s is detected."),
 			     problem->name);
       add_setshow_enum_cmd ("corefile", class_maintenance,
 			    internal_problem_modes,
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 4c3d67a9ff..8a42f954a3 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -3196,7 +3196,7 @@  Use 'show input-radix' or 'show output-radix' to independently show each."),
   add_setshow_boolean_cmd ("array-indexes", class_support,
                            &user_print_options.print_array_indexes, _("\
 Set printing of array indexes."), _("\
-Show printing of array indexes"), NULL, NULL, show_print_array_indexes,
+Show printing of array indexes."), NULL, NULL, show_print_array_indexes,
                            &setprintlist, &showprintlist);
 
   add_setshow_zuinteger_unlimited_cmd ("max-depth", class_support,