aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386v-nat.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1995-11-02 15:31:46 +0000
committerFred Fish <fnf@specifix.com>1995-11-02 15:31:46 +0000
commit183e1f0d7cfee05ed0c39f36a1934e4476546436 (patch)
tree7496d32d38054e24b08057da7f35869c870423a4 /gdb/i386v-nat.c
parent7ee7dc27b0a8283399607e7efce8a46a6565fc8c (diff)
downloadgdb-183e1f0d7cfee05ed0c39f36a1934e4476546436.zip
gdb-183e1f0d7cfee05ed0c39f36a1934e4476546436.tar.gz
gdb-183e1f0d7cfee05ed0c39f36a1934e4476546436.tar.bz2
* i386-tdep.c (i386_extract_return_value): Make function visible
for all i386 targets, but only assume floating point values returned in floating point registers for I386_AIX_TARGET. * i386v-nat.c (i386_register_u_addr): Enable code to locate floating point regs in user struct.
Diffstat (limited to 'gdb/i386v-nat.c')
-rw-r--r--gdb/i386v-nat.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/gdb/i386v-nat.c b/gdb/i386v-nat.c
index b5b2a30..e2ca832 100644
--- a/gdb/i386v-nat.c
+++ b/gdb/i386v-nat.c
@@ -69,22 +69,27 @@ i386_register_u_addr (blockend, regnum)
int blockend;
int regnum;
{
-#if 0
- /* this will be needed if fp registers are reinstated */
- /* for now, you can look at them with 'info float'
- * sys5 wont let you change them with ptrace anyway
- */
- if (regnum >= FP0_REGNUM && regnum <= FP7_REGNUM)
+ struct user u;
+ int fpstate;
+ int ubase;
+
+ ubase = blockend;
+ /* FIXME: Should have better way to test floating point range */
+ if (regnum >= FP0_REGNUM && regnum <= (FP0_REGNUM + 7))
{
- int ubase, fpstate;
- struct user u;
- ubase = blockend + 4 * (SS + 1) - KSTKSZ;
- fpstate = ubase + ((char *)&u.u_fpstate - (char *)&u);
+#ifdef KSTKSZ /* SCO, and others? */
+ ubase += 4 * (SS + 1) - KSTKSZ;
+ fpstate = ubase + ((char *)&u.u_fps.u_fpstate - (char *)&u);
return (fpstate + 0x1c + 10 * (regnum - FP0_REGNUM));
+#else
+ fpstate = ubase + ((char *)&u.i387.st_space - (char *)&u);
+ return (fpstate + 10 * (regnum - FP0_REGNUM));
+#endif
}
else
-#endif
- return (blockend + 4 * regmap[regnum]);
+ {
+ return (ubase + 4 * regmap[regnum]);
+ }
}