+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.
+
2002-08-15 Andrew Cagney <ac131313@redhat.com>
* infcmd.c (do_registers_info): Rename parameter ``fpregs'' to
+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.
+
2002-08-13 Andrew Cagney <ac131313@redhat.com>
* gdb.texinfo (Maintenance Commands): Document "maint print
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
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,
gdbarch_register_virtual_type_ftype *register_virtual_type;
gdbarch_do_registers_info_ftype *do_registers_info;
gdbarch_print_float_info_ftype *print_float_info;
+ gdbarch_print_vector_info_ftype *print_vector_info;
gdbarch_register_sim_regno_ftype *register_sim_regno;
gdbarch_register_bytes_ok_ftype *register_bytes_ok;
gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
0,
0,
0,
+ 0,
generic_in_function_epilogue_p,
construct_inferior_arguments,
0,
fprintf_unfiltered (log, "\n\tregister_virtual_type");
/* Skip verify of do_registers_info, invalid_p == 0 */
/* Skip verify of print_float_info, has predicate */
+ /* Skip verify of print_vector_info, has predicate */
/* Skip verify of register_sim_regno, invalid_p == 0 */
/* Skip verify of register_bytes_ok, has predicate */
/* Skip verify of cannot_fetch_register, invalid_p == 0 */
fprintf_unfiltered (file,
"gdbarch_dump: print_float_info = 0x%08lx\n",
(long) current_gdbarch->print_float_info);
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: print_vector_info = 0x%08lx\n",
+ (long) current_gdbarch->print_vector_info);
#ifdef PROLOGUE_FRAMELESS_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
gdbarch->print_float_info = print_float_info;
}
+int
+gdbarch_print_vector_info_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->print_vector_info != 0;
+}
+
+void
+gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args)
+{
+ gdb_assert (gdbarch != NULL);
+ if (gdbarch->print_vector_info == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_print_vector_info invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_print_vector_info called\n");
+ gdbarch->print_vector_info (gdbarch, file, frame, args);
+}
+
+void
+set_gdbarch_print_vector_info (struct gdbarch *gdbarch,
+ gdbarch_print_vector_info_ftype print_vector_info)
+{
+ gdbarch->print_vector_info = print_vector_info;
+}
+
int
gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr)
{
extern void gdbarch_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
extern void set_gdbarch_print_float_info (struct gdbarch *gdbarch, gdbarch_print_float_info_ftype *print_float_info);
+extern int gdbarch_print_vector_info_p (struct gdbarch *gdbarch);
+
+typedef void (gdbarch_print_vector_info_ftype) (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
+extern void gdbarch_print_vector_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, const char *args);
+extern void set_gdbarch_print_vector_info (struct gdbarch *gdbarch, gdbarch_print_vector_info_ftype *print_vector_info);
+
/* MAP a GDB RAW register number onto a simulator register number. See
also include/...-sim.h. */
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
{
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);
+}
\f
/*
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);
}