public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] Fix crash with "maint print arc"
@ 2022-05-27 13:53 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-05-27 13:53 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

Luis noticed that "maint print arc" would crash, because the command
handler did not find "show" in the command name, violating an
invariant.  This patch fixes the bug by changing the registration to
use add_basic_prefix_cmd instead.
---
 gdb/arc-tdep.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index 98bd1c4bc0a..3edfd466f3b 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -2474,11 +2474,11 @@ _initialize_arc_tdep ()
   /* Register ARC-specific commands with gdb.  */
 
   /* Add root prefix command for "maintenance print arc" commands.  */
-  add_show_prefix_cmd ("arc", class_maintenance,
-		       _("ARC-specific maintenance commands for printing GDB "
-			 "internal state."),
-		       &maintenance_print_arc_list,
-		       0, &maintenanceprintlist);
+  add_basic_prefix_cmd ("arc", class_maintenance,
+			_("ARC-specific maintenance commands for printing GDB "
+			  "internal state."),
+			&maintenance_print_arc_list,
+			0, &maintenanceprintlist);
 
   add_cmd ("arc-instruction", class_maintenance,
 	   dump_arc_instruction_command,
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-27 13:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-27 13:53 [pushed] Fix crash with "maint print arc" Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).