[1/2] btrace: fix output of "set record btrace"

Message ID 1519379570-16643-1-git-send-email-markus.t.metzger@intel.com
State New, archived
Headers

Commit Message

Metzger, Markus T Feb. 23, 2018, 9:52 a.m. UTC
  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.

2018-02-23  Markus Metzger  <markus.t.metzger@intel.com>

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


---
 gdb/record-btrace.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index 2464672..bc4566c 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -2955,7 +2955,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 apporpriate subcommand.\n"));
+  help_list (set_record_btrace_cmdlist, "set record btrace ", all_commands,
+	     gdb_stdout);
 }
 
 /* The "show record btrace" command.  */