2005-09-14 Paul Gilliam * rs6000-tdep.c (_initialize_rs6000_tdep): Remember the cmd_list_element for the 'info powerpc altivec' command. (rs6000_info_powerpc_altivec_command): New. Replaces itself with 'info vector'. Index: rs6000-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v retrieving revision 1.242 diff -u -a -r1.242 rs6000-tdep.c --- rs6000-tdep.c 1 Sep 2005 18:09:41 -0000 1.242 +++ rs6000-tdep.c 14 Sep 2005 21:29:04 -0000 @@ -59,6 +59,8 @@ #include "frame-unwind.h" #include "frame-base.h" +#include "cli/cli-decode.h" + #include "reggroups.h" /* If the kernel has to deliver a signal, it pushes a sigcontext @@ -3399,6 +3401,8 @@ } static struct cmd_list_element *info_powerpc_cmdlist = NULL; +static char inf_vec_name[] = "vector"; +static struct cmd_list_element *inf_ppc_altivec_cmd; static void rs6000_info_powerpc_command (char *args, int from_tty) @@ -3406,6 +3410,32 @@ help_list (info_powerpc_cmdlist, "info powerpc ", class_info, gdb_stdout); } +static void +rs6000_info_powerpc_altivec_command (char *args, int from_tty) +{ + char *copied_name; + struct cmd_list_element *inf_vec_cmd; + copied_name = (char *) alloca (strlen (inf_vec_name) + 1); + strcpy (copied_name, inf_vec_name); + inf_vec_cmd = lookup_cmd (&copied_name, infolist, "", 1, 1); + + if (!inf_vec_cmd) { + help_list (info_powerpc_cmdlist, "info powerpc ", class_info, gdb_stdout); + return; + } + + /* NOTE: Both FUNC and all the FUNCTIONs need to be copied. */ + inf_ppc_altivec_cmd->func = inf_vec_cmd->func; + inf_ppc_altivec_cmd->function = inf_vec_cmd->function; + inf_ppc_altivec_cmd->prefixlist = inf_vec_cmd->prefixlist; + inf_ppc_altivec_cmd->prefixname = inf_vec_cmd->prefixname; + inf_ppc_altivec_cmd->allow_unknown = inf_vec_cmd->allow_unknown; + inf_ppc_altivec_cmd->abbrev_flag = 0; + inf_ppc_altivec_cmd->cmd_pointer = inf_vec_cmd; + + (*inf_vec_cmd->func)(inf_vec_cmd, args, from_tty); +} + /* Initialization code. */ extern initialize_file_ftype _initialize_rs6000_tdep; /* -Wmissing-prototypes */ @@ -3420,4 +3450,7 @@ add_prefix_cmd ("powerpc", class_info, rs6000_info_powerpc_command, _("Various POWERPC info specific commands."), &info_powerpc_cmdlist, "info powerpc ", 0, &infolist); + inf_ppc_altivec_cmd = add_cmd ("altivec", class_info, + rs6000_info_powerpc_altivec_command, + _("See 'info vector'"), &info_powerpc_cmdlist); }