From 57e76facc3ddc7822ff71a3fcc55b324c1f0bb1d Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Wed, 24 Apr 2002 21:44:47 +0000 Subject: 2002-04-24 Roland McGrath * 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. --- gdb/i386gnu-nat.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gdb/i386gnu-nat.c') 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 +# 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) -- cgit v1.1