This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch/in] ``info vector''
- From: Andrew Cagney <ac131313 at ges dot redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 15 Aug 2002 20:28:42 -0400
- Subject: [patch/in] ``info vector''
Hello,
This patch adds the command ``info vector''. The doco was pre-approved.
committed,
enjoy, Andrew
2002-08-15 Andrew Cagney <ac131313@redhat.com>
* infcmd.c (vector_info): New function.
(_initialize_infcmd): Add command "info vector".
(print_vector_info): New function.
* gdbarch.sh (PRINT_VECTOR_INFO): New method
* gdbarch.h, gdbarch.c: Regenerate.
Index: doc/ChangeLog
2002-08-15 Andrew Cagney <ac131313@redhat.com>
* gdbint.texinfo (Target Architecture Definition): Document
PRINT_VECTOR_INFO.
* gdb.texinfo (Vector Unit): Document "info vectors" command.
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.154
diff -u -r1.154 gdbarch.sh
--- gdbarch.sh 15 Aug 2002 23:41:20 -0000 1.154
+++ gdbarch.sh 16 Aug 2002 00:25:18 -0000
@@ -469,6 +469,7 @@
f:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0
f:2:DO_REGISTERS_INFO:void:do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs:::do_registers_info::0
M:2:PRINT_FLOAT_INFO:void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
+M:2:PRINT_VECTOR_INFO:void:print_vector_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
# MAP a GDB RAW register number onto a simulator register number. See
# also include/...-sim.h.
f:2:REGISTER_SIM_REGNO:int:register_sim_regno:int reg_nr:reg_nr:::legacy_register_sim_regno::0
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.51
diff -u -r1.51 infcmd.c
--- infcmd.c 16 Aug 2002 00:13:03 -0000 1.51
+++ infcmd.c 16 Aug 2002 00:25:19 -0000
@@ -1710,6 +1710,39 @@
{
registers_info (addr_exp, 0);
}
+
+static void
+print_vector_info (struct gdbarch *gdbarch, struct ui_file *file,
+ struct frame_info *frame, const char *args)
+{
+ if (gdbarch_print_vector_info_p (gdbarch))
+ gdbarch_print_vector_info (gdbarch, file, frame, args);
+ else
+ {
+ int regnum;
+ int printed_something = 0;
+ for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
+ {
+ if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (regnum)))
+ {
+ printed_something = 1;
+#if 0
+ gdbarch_print_registers_info (gdbarch, file, frame, regnum, 1);
+#else
+ do_registers_info (regnum, 1);
+#endif
+ }
+ }
+ if (!printed_something)
+ fprintf_filtered (file, "No vector information\n");
+ }
+}
+
+static void
+vector_info (char *args, int from_tty)
+{
+ print_vector_info (current_gdbarch, gdb_stdout, selected_frame, args);
+}
/*
@@ -2082,6 +2115,9 @@
add_info ("float", float_info,
"Print the status of the floating point unit\n");
+
+ add_info ("vector", vector_info,
+ "Print the status of the vector unit\n");
inferior_environ = make_environ ();
init_environ (inferior_environ);
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.111
diff -u -r1.111 gdb.texinfo
--- doc/gdb.texinfo 13 Aug 2002 21:39:00 -0000 1.111
+++ doc/gdb.texinfo 16 Aug 2002 00:25:21 -0000
@@ -5583,6 +5583,20 @@
the ARM and x86 machines.
@end table
+@node Vector Unit
+@section Vector Unit
+@cindex vector unit
+
+Depending on the configuration, @value{GDBN} may be able to give you
+more information about the status of the vector unit.
+
+@table @code
+@kindex info vector
+@item info vector
+Display information about the vector unit. The exact contents and
+layout vary depending on the hardware.
+@end table
+
@node Memory Region Attributes
@section Memory region attributes
@cindex memory region attributes
Index: doc/gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.97
diff -u -r1.97 gdbint.texinfo
--- doc/gdbint.texinfo 1 Aug 2002 17:18:34 -0000 1.97
+++ doc/gdbint.texinfo 16 Aug 2002 00:25:22 -0000
@@ -3099,6 +3099,14 @@
If defined, then the @samp{info float} command will print information about
the processor's floating point unit.
+@item PRINT_VECTOR_INFO()
+@findex PRINT_VECTOR_INFO
+If defined, then the @samp{info vector} command will call this function
+to print information about the processor's vector unit.
+
+By default, the @samp{info vector} command will print all vector
+registers (the register's type having the vector attribute).
+
@item DWARF_REG_TO_REGNUM
@findex DWARF_REG_TO_REGNUM
Convert DWARF register number into @value{GDBN} regnum. If not defined,