aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2001-05-09 09:58:45 +0000
committerMark Kettenis <kettenis@gnu.org>2001-05-09 09:58:45 +0000
commitd7a0d72c953815f254dbaa7745deb63d28e93aec (patch)
tree910276f5642edeea584406469d13fec4fbb5026e /gdb/i386-tdep.c
parent6e0ce711e9cab49c7bace01123d05731edc562c4 (diff)
downloadgdb-d7a0d72c953815f254dbaa7745deb63d28e93aec.zip
gdb-d7a0d72c953815f254dbaa7745deb63d28e93aec.tar.gz
gdb-d7a0d72c953815f254dbaa7745deb63d28e93aec.tar.bz2
* i386-tdep.c (i386_register_virtual_type): New function.
(i386_register_convertible): New function. * config/i386/tm-i386.h (REGISTER_VIRTUAL_TYPE): Redefine in terms of i386_register_virtual_type. (REGISTER_CONVERTIBLE): Redefine in terms of i386_register_convertible. (i386_register_virtual_type, i386_register_convertible): New prototypes.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 7477266..446b268 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -905,6 +905,37 @@ i386_extract_struct_value_address (char *regbuf)
}
+/* Return the GDB type object for the "standard" data type of data in
+ register REGNUM. Perhaps %esi and %edi should go here, but
+ potentially they could be used for things other than address. */
+
+struct type *
+i386_register_virtual_type (int regnum)
+{
+ if (regnum == PC_REGNUM || regnum == FP_REGNUM || regnum == SP_REGNUM)
+ return lookup_pointer_type (builtin_type_void);
+
+ if (IS_FP_REGNUM (regnum))
+ return builtin_type_long_double;
+
+ if (IS_SSE_REGNUM (regnum))
+ return builtin_type_v4sf;
+
+ return builtin_type_int;
+}
+
+/* Return true iff register REGNUM's virtual format is different from
+ its raw format. Note that this definition assumes that the host
+ supports IEEE 32-bit floats, since it doesn't say that SSE
+ registers need conversion. Even if we can't find a counterexample,
+ this is still sloppy. */
+
+int
+i386_register_convertible (int regnum)
+{
+ return IS_FP_REGNUM (regnum);
+}
+
/* Convert data from raw format for register REGNUM in buffer FROM to
virtual format with type TYPE in buffer TO. In principle both
formats are identical except that the virtual format has two extra