/* Intel 386 native support for SYSV systems (pre-SVR4).
- Copyright (C) 1988, 1989, 1991, 1992, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1988, 1989, 1991, 1992, 1994, 1996 Free Software Foundation, Inc.
This file is part of GDB.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "frame.h"
#endif
#include <sys/file.h>
-#include <sys/stat.h>
+#include "gdb_stat.h"
#ifndef NO_SYS_REG_H
#include <sys/reg.h>
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]);
+ }
}
\f
+int
+kernel_u_size ()
+{
+ return (sizeof (struct user));
+}
+\f
#ifdef TARGET_HAS_HARDWARE_WATCHPOINTS
#if !defined (offsetof)
if (i > DR_LASTADDR)
return -1;
- read_write_bits = ((rw & 1) ? DR_RW_READ : 0) | ((rw & 2) ? DR_RW_WRITE : 0);
+ read_write_bits = (rw & 1) ? DR_RW_READ : DR_RW_WRITE;
if (len == 1)
len_bits = DR_LEN_1;