aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386gnu-nat.c
diff options
context:
space:
mode:
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 9188ea4..e82fe0d 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)