This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch/rfc?] Less ``info register''
- From: Andrew Cagney <ac131313 at ges dot redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 28 Aug 2002 20:12:58 -0400
- Subject: [patch/rfc?] Less ``info register''
Hello,
Following on from ElenaZ's patch, this modifies print_registers_info()
so that it only prints both natural and hex forms of registers when the
register is an int or float.
This means that any register, with a composite type, is printed in just hex.
For instance:
mxcsr {mxcsr = 0x1f80, bits = {FZ = 0x0, RC = 0x0, PM = 0x1,
UM = 0x1, OM = 0x1, ZM = 0x1, DM = 0x1, IM = 0x1, PE = 0x0, UE = 0x0,
OE = 0x0, ZE = 0x0, DE = 0x0, IE = 0x0}}
Another variation would be to test for a register with a union, vector,
or struct type.
Or just customize the mxcsr register display.
thoughts?
Andrew
2002-08-28 Andrew Cagney <cagney@redhat.com>
* infcmd.c (default_print_registers_info): Only print simply typed
registers in both hex and their natural form.
Index: infcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/infcmd.c,v
retrieving revision 1.54
diff -u -r1.54 infcmd.c
--- infcmd.c 21 Aug 2002 16:34:09 -0000 1.54
+++ infcmd.c 29 Aug 2002 00:04:08 -0000
@@ -1654,9 +1654,9 @@
/* Print the register in hex. */
val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,
gdb_stdout, 'x', 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)
+ /* If a simple type, also print in its natural form. */
+ if (TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_INT
+ || TYPE_CODE (REGISTER_VIRTUAL_TYPE (i)) == TYPE_CODE_FLT)
{
printf_filtered ("\t");
val_print (REGISTER_VIRTUAL_TYPE (i), virtual_buffer, 0, 0,