summaryrefslogtreecommitdiff
path: root/gdb/i386gnu-nat.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2002-04-24 21:44:47 +0000
committerMichael Snyder <msnyder@specifix.com>2002-04-24 21:44:47 +0000
commit24a689046fd39ea8563d5f6a0c778cb5a5a5c8f9 (patch)
tree5345d4b1aca6714213bcdb55d96f1ca64ce21634 /gdb/i386gnu-nat.c
parentfab6099251acd51b0c8bce77de961df8ed36b32f (diff)
downloadgdb-24a689046fd39ea8563d5f6a0c778cb5a5a5c8f9.tar.gz
2002-04-24 Roland McGrath <roland@frob.com>
* config/i386/i386gnu.mh (NATDEPFILES): Add core-regset.o here. * i386gnu-nat.c [HAVE_SYS_PROCFS_H] (supply_gregset, supply_fpregset): New functions. * gnu-nat.c (gnu_find_memory_regions): New function. (init_gnu_ops): Set `to_find_memory_regions' hook to that. (gnu_xfer_memory): Add a cast.
Diffstat (limited to 'gdb/i386gnu-nat.c')
-rw-r--r--gdb/i386gnu-nat.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gdb/i386gnu-nat.c b/gdb/i386gnu-nat.c
index 9188ea4c654..e82fe0d9786 100644
--- a/gdb/i386gnu-nat.c
+++ b/gdb/i386gnu-nat.c
@@ -38,6 +38,10 @@
#include "gnu-nat.h"
#include "i387-nat.h"
+#ifdef HAVE_SYS_PROCFS_H
+# include <sys/procfs.h>
+# include "gregset.h"
+#endif
/* Offset to the thread_state_t location where REG is stored. */
#define REG_OFFSET(reg) offsetof (struct i386_thread_state, reg)
@@ -88,6 +92,24 @@ fetch_fpregs (struct proc *thread)
i387_supply_fsave (state.hw_state);
}
+#ifdef HAVE_SYS_PROCFS_H
+/* These two calls are used by the core-regset.c code for
+ reading ELF core files. */
+void
+supply_gregset (gdb_gregset_t *gregs)
+{
+ int i;
+ for (i = 0; i < NUM_GREGS; i++)
+ supply_register (i, REG_ADDR (gregs, i));
+}
+
+void
+supply_fpregset (gdb_fpregset_t *fpregs)
+{
+ i387_supply_fsave ((char *) fpregs);
+}
+#endif
+
/* Fetch register REGNO, or all regs if REGNO is -1. */
void
gnu_fetch_registers (int regno)