btrace: fix output of "set record btrace"
authorMarkus Metzger <markus.t.metzger@intel.com>
Thu, 1 Feb 2018 13:31:18 +0000 (14:31 +0100)
committerMarkus Metzger <markus.t.metzger@intel.com>
Fri, 13 Apr 2018 09:30:15 +0000 (11:30 +0200)
Instead of giving a message that "set record btrace" needs a sub-command,
GDB crashed.  Fix it.  A regression test comes with the next patch.

gdb/
* record-btrace.c (cmd_set_record_btrace): Print sub-commands.

gdb/ChangeLog
gdb/record-btrace.c

index f379680b2cb7c8722aba82dbe63ef376de2f3b11..c3f59e6b93a2c76538c7ea23cd0d53a0f7e01853 100644 (file)
@@ -1,3 +1,7 @@
+2018-04-13  Markus Metzger  <markus.t.metzger@intel.com>
+
+       * record-btrace.c (cmd_set_record_btrace): Print sub-commands.
+
 2018-04-13  Markus Metzger  <markus.t.metzger@intel.com>
 
        * infrun.c (process_event_stop_test): Call
index 7264b8ed2b6d0f753c585ff7c4558a7a7f7be2fb..455e25456bea12474f920c70cfea246e4a6b5841 100644 (file)
@@ -2958,7 +2958,10 @@ cmd_record_btrace_start (const char *args, int from_tty)
 static void
 cmd_set_record_btrace (const char *args, int from_tty)
 {
-  cmd_show_list (set_record_btrace_cmdlist, from_tty, "");
+  printf_unfiltered (_("\"set record btrace\" must be followed "
+                      "by an appropriate subcommand.\n"));
+  help_list (set_record_btrace_cmdlist, "set record btrace ",
+            all_commands, gdb_stdout);
 }
 
 /* The "show record btrace" command.  */