1999-01-19 Fernando Nasser <fnasser@totem.to.cygnus.com>
[deliverable/binutils-gdb.git] / gdb / mips-nat.c
index 4d1b4a00c45ad1047a817c08c781b7d077106564..9f5717475e11db578b74adf582d33be14a6f4b88 100644 (file)
@@ -17,7 +17,7 @@ GNU General Public License for more details.
 
 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 "inferior.h"
@@ -61,6 +61,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 static char zerobuf[MAX_REGISTER_RAW_SIZE] = {0};
 
+static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR));
+
 /* Get all registers from the inferior */
 
 void
@@ -162,12 +164,12 @@ get_longjmp_target(pc)
            Original upage address X is at location core_reg_sect+x+reg_addr.
  */
 
-void
+static void
 fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
      char *core_reg_sect;
      unsigned core_reg_size;
      int which;
-     unsigned reg_addr;
+     CORE_ADDR reg_addr;
 {
   register int regno;
   register unsigned int addr;
@@ -199,7 +201,7 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
     }
   if (bad_reg >= 0)
     {
-      error ("Register %s not found in core file.", reg_names[bad_reg]);
+      error ("Register %s not found in core file.", REGISTER_NAME (bad_reg));
     }
   supply_register (ZERO_REGNUM, zerobuf);
   /* Frame ptr reg must appear to be 0; it is faked by stack handling code. */
@@ -209,12 +211,12 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
 /* Return the address in the core dump or inferior of register REGNO.
    BLOCKEND is the address of the end of the user structure.  */
 
-unsigned int
+CORE_ADDR
 register_addr (regno, blockend)
      int regno;
-     int blockend;
+     CORE_ADDR blockend;
 {
-  int addr;
+  CORE_ADDR addr;
 
   if (regno < 0 || regno >= NUM_REGS)
     error ("Invalid register number %d.", regno);
@@ -223,3 +225,20 @@ register_addr (regno, blockend)
 
   return addr;
 }
+
+\f
+/* Register that we are able to handle mips core file formats.
+   FIXME: is this really bfd_target_unknown_flavour? */
+
+static struct core_fns mips_core_fns =
+{
+  bfd_target_unknown_flavour,
+  fetch_core_registers,
+  NULL
+};
+
+void
+_initialize_core_mips ()
+{
+  add_core_fns (&mips_core_fns);
+}
This page took 0.023888 seconds and 4 git commands to generate.