aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2002-08-20 16:33:32 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2002-08-20 16:33:32 +0000
commitab4327e008a60a717cf2d0480ade932889a3677e (patch)
tree7010fc1676e425627001af277335b1bcc522a0ba
parentcb1d2653f9ed49397cfb241068e44ca795e62e06 (diff)
downloadgdb-ab4327e008a60a717cf2d0480ade932889a3677e.zip
gdb-ab4327e008a60a717cf2d0480ade932889a3677e.tar.gz
gdb-ab4327e008a60a717cf2d0480ade932889a3677e.tar.bz2
2002-08-20 Elena Zannoni <ezannoni@redhat.com>
* infcmd.c (do_registers_info): Print vector registers in hex format only. (print_vector_info): Check that printing registers makes sense. (print_float_info): Ditto.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/infcmd.c25
2 files changed, 29 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e316d86..a1a497b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2002-08-20 Elena Zannoni <ezannoni@redhat.com>
+
+ * infcmd.c (do_registers_info): Print vector registers in hex
+ format only.
+ (print_vector_info): Check that printing registers
+ makes sense.
+ (print_float_info): Ditto.
+
2002-08-20 Andrew Cagney <ac131313@redhat.com>
* mips-tdep.c (mips_gdbarch_init): Update.
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 95ee3e6..9aa8542 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1632,14 +1632,19 @@ do_registers_info (int regnum, int print_all)
}
printf_filtered (")");
}
- /* Else print as integer in hex and in decimal. */
else
{
+ /* Print the register in hex. */
val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
gdb_stdout, 'x', 1, 0, Val_pretty_default);
- printf_filtered ("\t");
- val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
- gdb_stdout, 0, 1, 0, Val_pretty_default);
+ /* If not a vector register, print it also according to its
+ natural format. */
+ if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (i)) == 0)
+ {
+ printf_filtered ("\t");
+ val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
+ gdb_stdout, 0, 1, 0, Val_pretty_default);
+ }
}
/* The SPARC wants to print even-numbered float regs as doubles
@@ -1721,6 +1726,12 @@ print_vector_info (struct gdbarch *gdbarch, struct ui_file *file,
{
int regnum;
int printed_something = 0;
+
+ if (!target_has_registers)
+ error ("The program has no registers now.");
+ if (selected_frame == NULL)
+ error ("No selected frame.");
+
for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
{
if (TYPE_VECTOR (REGISTER_VIRTUAL_TYPE (regnum)))
@@ -1899,6 +1910,12 @@ print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
#else
int regnum;
int printed_something = 0;
+
+ if (!target_has_registers)
+ error ("The program has no registers now.");
+ if (selected_frame == NULL)
+ error ("No selected frame.");
+
for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
{
if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (regnum)) == TYPE_CODE_FLT)