From 2a0c26370c2d6bf343287ae8dd39858f43239db7 Mon Sep 17 00:00:00 2001 From: Richard Earnshaw Date: Sat, 22 Mar 2003 18:01:38 +0000 Subject: * arm-tdep.c (show_arm_command): Don't print out help. Instead, show the current setting of each value. (_initialize_arm_tdep): Delete variable new_cmd and add new vars new_set and new_show. Use add_setshow_cmd_full and add_setshow_boolean_cmd as appropriate. Deprecate "set/show apcs32" commands and add new version as subcommands of "set/show arm". --- gdb/ChangeLog | 9 +++++++++ gdb/arm-tdep.c | 55 +++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0f13e14a5d1..18904e1f66e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2003-03-22 Richard Earnshaw + + * arm-tdep.c (show_arm_command): Don't print out help. Instead, show + the current setting of each value. + (_initialize_arm_tdep): Delete variable new_cmd and add new vars + new_set and new_show. Use add_setshow_cmd_full and + add_setshow_boolean_cmd as appropriate. Deprecate "set/show apcs32" + commands and add new version as subcommands of "set/show arm". + 2003-03-22 Richard Earnshaw * arm-tdep.c (setarmcmdlist, showarmcmdlist): New command lists. diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 583400c0ee5..53a36929147 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -2530,7 +2530,7 @@ set_arm_command (char *args, int from_tty) static void show_arm_command (char *args, int from_tty) { - help_list (showarmcmdlist, "show arm ", all_commands, gdb_stdout); + cmd_show_list (showarmcmdlist, from_tty, ""); } /* If the user changes the register disassembly style used for info @@ -3015,7 +3015,7 @@ _initialize_arm_tdep (void) { struct ui_file *stb; long length; - struct cmd_list_element *new_cmd; + struct cmd_list_element *new_set, *new_show; const char *setname; const char *setdesc; const char **regnames; @@ -3088,27 +3088,39 @@ _initialize_arm_tdep (void) ui_file_delete (stb); /* Add the deprecated disassembly-flavor command. */ - new_cmd = add_set_enum_cmd ("disassembly-flavor", no_class, + new_set = add_set_enum_cmd ("disassembly-flavor", no_class, valid_disassembly_styles, &disassembly_style, helptext, &setlist); - set_cmd_sfunc (new_cmd, set_disassembly_style_sfunc); - deprecate_cmd (new_cmd, "set arm disassembly"); - deprecate_cmd (add_show_from_set (new_cmd, &showlist), + set_cmd_sfunc (new_set, set_disassembly_style_sfunc); + deprecate_cmd (new_set, "set arm disassembly"); + deprecate_cmd (add_show_from_set (new_set, &showlist), "show arm disassembly"); /* And now add the new interface. */ - new_cmd = add_set_enum_cmd ("disassembly", no_class, valid_disassembly_styles, - &disassembly_style, helptext, &setarmcmdlist); - - add_show_from_set (new_cmd, &showarmcmdlist); - - /* ??? Maybe this should be a boolean. */ - add_show_from_set (add_set_cmd ("apcs32", no_class, - var_zinteger, (char *) &arm_apcs_32, - "Set usage of ARM 32-bit mode.\n", &setlist), - &showlist); + new_set = add_set_enum_cmd ("disassembly", no_class, + valid_disassembly_styles, &disassembly_style, + helptext, &setarmcmdlist); + + add_show_from_set (new_set, &showarmcmdlist); + + add_setshow_cmd_full ("apcs32", no_class, + var_boolean, (char *) &arm_apcs_32, + "Set usage of ARM 32-bit mode.", + "Show usage of ARM 32-bit mode.", + NULL, NULL, + &setlist, &showlist, &new_set, &new_show); + deprecate_cmd (new_set, "set arm apcs32"); + deprecate_cmd (new_show, "show arm apcs32"); + + add_setshow_boolean_cmd ("apcs32", no_class, &arm_apcs_32, + "Set usage of ARM 32-bit mode. " + "When off, a 26-bit PC will be used.", + "Show usage of ARM 32-bit mode. " + "When off, a 26-bit PC will be used.", + NULL, NULL, + &setarmcmdlist, &showarmcmdlist); /* Add the deprecated "othernames" command. */ deprecate_cmd (add_com ("othernames", class_obscure, arm_othernames, @@ -3116,8 +3128,11 @@ _initialize_arm_tdep (void) "set arm disassembly"); /* Debugging flag. */ - add_show_from_set (add_set_cmd ("arm", class_maintenance, var_zinteger, - &arm_debug, "Set arm debugging.\n" - "When non-zero, arm specific debugging is enabled.", - &setdebuglist), &showdebuglist); + add_setshow_boolean_cmd ("arm", class_maintenance, &arm_debug, + "Set ARM debugging. " + "When on, arm-specific debugging is enabled.", + "Show ARM debugging. " + "When on, arm-specific debugging is enabled.", + NULL, NULL, + &setdebuglist, &showdebuglist); } -- cgit v1.2.1