OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [sparc-nat.c] - Diff between revs 105 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 105 Rev 1765
/* Functions specific to running gdb native on a SPARC running SunOS4.
/* Functions specific to running gdb native on a SPARC running SunOS4.
   Copyright 1989, 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
   Copyright 1989, 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
 
 
   This file is part of GDB.
   This file is part of GDB.
 
 
   This program is free software; you can redistribute it and/or modify
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   (at your option) any later version.
 
 
   This program is distributed in the hope that it will be useful,
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   GNU General Public License for more details.
 
 
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330,
   Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */
   Boston, MA 02111-1307, USA.  */
 
 
#include "defs.h"
#include "defs.h"
#include "inferior.h"
#include "inferior.h"
#include "target.h"
#include "target.h"
#include "gdbcore.h"
#include "gdbcore.h"
 
 
#include <signal.h>
#include <signal.h>
#include <sys/ptrace.h>
#include <sys/ptrace.h>
#include <sys/wait.h>
#include <sys/wait.h>
#ifdef __linux__
#ifdef __linux__
#include <asm/reg.h>
#include <asm/reg.h>
#else
#else
#include <machine/reg.h>
#include <machine/reg.h>
#endif
#endif
#include <sys/user.h>
#include <sys/user.h>
 
 
/* We don't store all registers immediately when requested, since they
/* We don't store all registers immediately when requested, since they
   get sent over in large chunks anyway.  Instead, we accumulate most
   get sent over in large chunks anyway.  Instead, we accumulate most
   of the changes and send them over once.  "deferred_stores" keeps
   of the changes and send them over once.  "deferred_stores" keeps
   track of which sets of registers we have locally-changed copies of,
   track of which sets of registers we have locally-changed copies of,
   so we only need send the groups that have changed.  */
   so we only need send the groups that have changed.  */
 
 
#define INT_REGS        1
#define INT_REGS        1
#define STACK_REGS      2
#define STACK_REGS      2
#define FP_REGS         4
#define FP_REGS         4
 
 
static void
static void
fetch_core_registers PARAMS ((char *, unsigned int, int, CORE_ADDR));
fetch_core_registers PARAMS ((char *, unsigned int, int, CORE_ADDR));
 
 
/* Fetch one or more registers from the inferior.  REGNO == -1 to get
/* Fetch one or more registers from the inferior.  REGNO == -1 to get
   them all.  We actually fetch more than requested, when convenient,
   them all.  We actually fetch more than requested, when convenient,
   marking them as valid so we won't fetch them again.  */
   marking them as valid so we won't fetch them again.  */
 
 
void
void
fetch_inferior_registers (regno)
fetch_inferior_registers (regno)
     int regno;
     int regno;
{
{
  struct regs inferior_registers;
  struct regs inferior_registers;
  struct fp_status inferior_fp_registers;
  struct fp_status inferior_fp_registers;
  int i;
  int i;
 
 
  /* We should never be called with deferred stores, because a prerequisite
  /* We should never be called with deferred stores, because a prerequisite
     for writing regs is to have fetched them all (PREPARE_TO_STORE), sigh.  */
     for writing regs is to have fetched them all (PREPARE_TO_STORE), sigh.  */
  if (deferred_stores)
  if (deferred_stores)
    abort ();
    abort ();
 
 
  DO_DEFERRED_STORES;
  DO_DEFERRED_STORES;
 
 
  /* Global and Out regs are fetched directly, as well as the control
  /* Global and Out regs are fetched directly, as well as the control
     registers.  If we're getting one of the in or local regs,
     registers.  If we're getting one of the in or local regs,
     and the stack pointer has not yet been fetched,
     and the stack pointer has not yet been fetched,
     we have to do that first, since they're found in memory relative
     we have to do that first, since they're found in memory relative
     to the stack pointer.  */
     to the stack pointer.  */
  if (regno < O7_REGNUM         /* including -1 */
  if (regno < O7_REGNUM         /* including -1 */
      || regno >= Y_REGNUM
      || regno >= Y_REGNUM
      || (!register_valid[SP_REGNUM] && regno < I7_REGNUM))
      || (!register_valid[SP_REGNUM] && regno < I7_REGNUM))
    {
    {
      if (0 != ptrace (PTRACE_GETREGS, inferior_pid,
      if (0 != ptrace (PTRACE_GETREGS, inferior_pid,
                       (PTRACE_ARG3_TYPE) & inferior_registers, 0))
                       (PTRACE_ARG3_TYPE) & inferior_registers, 0))
        perror ("ptrace_getregs");
        perror ("ptrace_getregs");
 
 
      registers[REGISTER_BYTE (0)] = 0;
      registers[REGISTER_BYTE (0)] = 0;
      memcpy (&registers[REGISTER_BYTE (1)], &inferior_registers.r_g1,
      memcpy (&registers[REGISTER_BYTE (1)], &inferior_registers.r_g1,
              15 * REGISTER_RAW_SIZE (G0_REGNUM));
              15 * REGISTER_RAW_SIZE (G0_REGNUM));
      *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
      *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
      *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
      *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
      *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc;
      *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc;
      *(int *) &registers[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y;
      *(int *) &registers[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y;
 
 
      for (i = G0_REGNUM; i <= O7_REGNUM; i++)
      for (i = G0_REGNUM; i <= O7_REGNUM; i++)
        register_valid[i] = 1;
        register_valid[i] = 1;
      register_valid[Y_REGNUM] = 1;
      register_valid[Y_REGNUM] = 1;
      register_valid[PS_REGNUM] = 1;
      register_valid[PS_REGNUM] = 1;
      register_valid[PC_REGNUM] = 1;
      register_valid[PC_REGNUM] = 1;
      register_valid[NPC_REGNUM] = 1;
      register_valid[NPC_REGNUM] = 1;
      /* If we don't set these valid, read_register_bytes() rereads
      /* If we don't set these valid, read_register_bytes() rereads
         all the regs every time it is called!  FIXME.  */
         all the regs every time it is called!  FIXME.  */
      register_valid[WIM_REGNUM] = 1;   /* Not true yet, FIXME */
      register_valid[WIM_REGNUM] = 1;   /* Not true yet, FIXME */
      register_valid[TBR_REGNUM] = 1;   /* Not true yet, FIXME */
      register_valid[TBR_REGNUM] = 1;   /* Not true yet, FIXME */
      register_valid[CPS_REGNUM] = 1;   /* Not true yet, FIXME */
      register_valid[CPS_REGNUM] = 1;   /* Not true yet, FIXME */
    }
    }
 
 
  /* Floating point registers */
  /* Floating point registers */
  if (regno == -1 ||
  if (regno == -1 ||
      regno == FPS_REGNUM ||
      regno == FPS_REGNUM ||
      (regno >= FP0_REGNUM && regno <= FP0_REGNUM + 31))
      (regno >= FP0_REGNUM && regno <= FP0_REGNUM + 31))
    {
    {
      if (0 != ptrace (PTRACE_GETFPREGS, inferior_pid,
      if (0 != ptrace (PTRACE_GETFPREGS, inferior_pid,
                       (PTRACE_ARG3_TYPE) & inferior_fp_registers,
                       (PTRACE_ARG3_TYPE) & inferior_fp_registers,
                       0))
                       0))
        perror ("ptrace_getfpregs");
        perror ("ptrace_getfpregs");
      memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
      memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
              sizeof inferior_fp_registers.fpu_fr);
              sizeof inferior_fp_registers.fpu_fr);
      memcpy (&registers[REGISTER_BYTE (FPS_REGNUM)],
      memcpy (&registers[REGISTER_BYTE (FPS_REGNUM)],
              &inferior_fp_registers.Fpu_fsr,
              &inferior_fp_registers.Fpu_fsr,
              sizeof (FPU_FSR_TYPE));
              sizeof (FPU_FSR_TYPE));
      for (i = FP0_REGNUM; i <= FP0_REGNUM + 31; i++)
      for (i = FP0_REGNUM; i <= FP0_REGNUM + 31; i++)
        register_valid[i] = 1;
        register_valid[i] = 1;
      register_valid[FPS_REGNUM] = 1;
      register_valid[FPS_REGNUM] = 1;
    }
    }
 
 
  /* These regs are saved on the stack by the kernel.  Only read them
  /* These regs are saved on the stack by the kernel.  Only read them
     all (16 ptrace calls!) if we really need them.  */
     all (16 ptrace calls!) if we really need them.  */
  if (regno == -1)
  if (regno == -1)
    {
    {
      target_read_memory (*(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)],
      target_read_memory (*(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)],
                          &registers[REGISTER_BYTE (L0_REGNUM)],
                          &registers[REGISTER_BYTE (L0_REGNUM)],
                          16 * REGISTER_RAW_SIZE (L0_REGNUM));
                          16 * REGISTER_RAW_SIZE (L0_REGNUM));
      for (i = L0_REGNUM; i <= I7_REGNUM; i++)
      for (i = L0_REGNUM; i <= I7_REGNUM; i++)
        register_valid[i] = 1;
        register_valid[i] = 1;
    }
    }
  else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
  else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
    {
    {
      CORE_ADDR sp = *(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)];
      CORE_ADDR sp = *(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)];
      i = REGISTER_BYTE (regno);
      i = REGISTER_BYTE (regno);
      if (register_valid[regno])
      if (register_valid[regno])
        printf_unfiltered ("register %d valid and read\n", regno);
        printf_unfiltered ("register %d valid and read\n", regno);
      target_read_memory (sp + i - REGISTER_BYTE (L0_REGNUM),
      target_read_memory (sp + i - REGISTER_BYTE (L0_REGNUM),
                          &registers[i], REGISTER_RAW_SIZE (regno));
                          &registers[i], REGISTER_RAW_SIZE (regno));
      register_valid[regno] = 1;
      register_valid[regno] = 1;
    }
    }
}
}
 
 
/* Store our register values back into the inferior.
/* Store our register values back into the inferior.
   If REGNO is -1, do this for all registers.
   If REGNO is -1, do this for all registers.
   Otherwise, REGNO specifies which register (so we can save time).  */
   Otherwise, REGNO specifies which register (so we can save time).  */
 
 
void
void
store_inferior_registers (regno)
store_inferior_registers (regno)
     int regno;
     int regno;
{
{
  struct regs inferior_registers;
  struct regs inferior_registers;
  struct fp_status inferior_fp_registers;
  struct fp_status inferior_fp_registers;
  int wanna_store = INT_REGS + STACK_REGS + FP_REGS;
  int wanna_store = INT_REGS + STACK_REGS + FP_REGS;
 
 
  /* First decide which pieces of machine-state we need to modify.
  /* First decide which pieces of machine-state we need to modify.
     Default for regno == -1 case is all pieces.  */
     Default for regno == -1 case is all pieces.  */
  if (regno >= 0)
  if (regno >= 0)
    if (FP0_REGNUM <= regno && regno < FP0_REGNUM + 32)
    if (FP0_REGNUM <= regno && regno < FP0_REGNUM + 32)
      {
      {
        wanna_store = FP_REGS;
        wanna_store = FP_REGS;
      }
      }
    else
    else
      {
      {
        if (regno == SP_REGNUM)
        if (regno == SP_REGNUM)
          wanna_store = INT_REGS + STACK_REGS;
          wanna_store = INT_REGS + STACK_REGS;
        else if (regno < L0_REGNUM || regno > I7_REGNUM)
        else if (regno < L0_REGNUM || regno > I7_REGNUM)
          wanna_store = INT_REGS;
          wanna_store = INT_REGS;
        else if (regno == FPS_REGNUM)
        else if (regno == FPS_REGNUM)
          wanna_store = FP_REGS;
          wanna_store = FP_REGS;
        else
        else
          wanna_store = STACK_REGS;
          wanna_store = STACK_REGS;
      }
      }
 
 
  /* See if we're forcing the stores to happen now, or deferring. */
  /* See if we're forcing the stores to happen now, or deferring. */
  if (regno == -2)
  if (regno == -2)
    {
    {
      wanna_store = deferred_stores;
      wanna_store = deferred_stores;
      deferred_stores = 0;
      deferred_stores = 0;
    }
    }
  else
  else
    {
    {
      if (wanna_store == STACK_REGS)
      if (wanna_store == STACK_REGS)
        {
        {
          /* Fall through and just store one stack reg.  If we deferred
          /* Fall through and just store one stack reg.  If we deferred
             it, we'd have to store them all, or remember more info.  */
             it, we'd have to store them all, or remember more info.  */
        }
        }
      else
      else
        {
        {
          deferred_stores |= wanna_store;
          deferred_stores |= wanna_store;
          return;
          return;
        }
        }
    }
    }
 
 
  if (wanna_store & STACK_REGS)
  if (wanna_store & STACK_REGS)
    {
    {
      CORE_ADDR sp = *(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)];
      CORE_ADDR sp = *(CORE_ADDR *) & registers[REGISTER_BYTE (SP_REGNUM)];
 
 
      if (regno < 0 || regno == SP_REGNUM)
      if (regno < 0 || regno == SP_REGNUM)
        {
        {
          if (!register_valid[L0_REGNUM + 5])
          if (!register_valid[L0_REGNUM + 5])
            abort ();
            abort ();
          target_write_memory (sp,
          target_write_memory (sp,
                               &registers[REGISTER_BYTE (L0_REGNUM)],
                               &registers[REGISTER_BYTE (L0_REGNUM)],
                               16 * REGISTER_RAW_SIZE (L0_REGNUM));
                               16 * REGISTER_RAW_SIZE (L0_REGNUM));
        }
        }
      else
      else
        {
        {
          if (!register_valid[regno])
          if (!register_valid[regno])
            abort ();
            abort ();
          target_write_memory (sp + REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM),
          target_write_memory (sp + REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM),
                               &registers[REGISTER_BYTE (regno)],
                               &registers[REGISTER_BYTE (regno)],
                               REGISTER_RAW_SIZE (regno));
                               REGISTER_RAW_SIZE (regno));
        }
        }
 
 
    }
    }
 
 
  if (wanna_store & INT_REGS)
  if (wanna_store & INT_REGS)
    {
    {
      if (!register_valid[G1_REGNUM])
      if (!register_valid[G1_REGNUM])
        abort ();
        abort ();
 
 
      memcpy (&inferior_registers.r_g1, &registers[REGISTER_BYTE (G1_REGNUM)],
      memcpy (&inferior_registers.r_g1, &registers[REGISTER_BYTE (G1_REGNUM)],
              15 * REGISTER_RAW_SIZE (G1_REGNUM));
              15 * REGISTER_RAW_SIZE (G1_REGNUM));
 
 
      inferior_registers.r_ps =
      inferior_registers.r_ps =
        *(int *) &registers[REGISTER_BYTE (PS_REGNUM)];
        *(int *) &registers[REGISTER_BYTE (PS_REGNUM)];
      inferior_registers.r_pc =
      inferior_registers.r_pc =
        *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
        *(int *) &registers[REGISTER_BYTE (PC_REGNUM)];
      inferior_registers.r_npc =
      inferior_registers.r_npc =
        *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)];
        *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)];
      inferior_registers.r_y =
      inferior_registers.r_y =
        *(int *) &registers[REGISTER_BYTE (Y_REGNUM)];
        *(int *) &registers[REGISTER_BYTE (Y_REGNUM)];
 
 
      if (0 != ptrace (PTRACE_SETREGS, inferior_pid,
      if (0 != ptrace (PTRACE_SETREGS, inferior_pid,
                       (PTRACE_ARG3_TYPE) & inferior_registers, 0))
                       (PTRACE_ARG3_TYPE) & inferior_registers, 0))
        perror ("ptrace_setregs");
        perror ("ptrace_setregs");
    }
    }
 
 
  if (wanna_store & FP_REGS)
  if (wanna_store & FP_REGS)
    {
    {
      if (!register_valid[FP0_REGNUM + 9])
      if (!register_valid[FP0_REGNUM + 9])
        abort ();
        abort ();
      memcpy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
      memcpy (&inferior_fp_registers, &registers[REGISTER_BYTE (FP0_REGNUM)],
              sizeof inferior_fp_registers.fpu_fr);
              sizeof inferior_fp_registers.fpu_fr);
      memcpy (&inferior_fp_registers.Fpu_fsr,
      memcpy (&inferior_fp_registers.Fpu_fsr,
              &registers[REGISTER_BYTE (FPS_REGNUM)], sizeof (FPU_FSR_TYPE));
              &registers[REGISTER_BYTE (FPS_REGNUM)], sizeof (FPU_FSR_TYPE));
      if (0 !=
      if (0 !=
          ptrace (PTRACE_SETFPREGS, inferior_pid,
          ptrace (PTRACE_SETFPREGS, inferior_pid,
                  (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0))
                  (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0))
        perror ("ptrace_setfpregs");
        perror ("ptrace_setfpregs");
    }
    }
}
}
 
 
 
 
static void
static void
fetch_core_registers (core_reg_sect, core_reg_size, which, ignore)
fetch_core_registers (core_reg_sect, core_reg_size, which, ignore)
     char *core_reg_sect;
     char *core_reg_sect;
     unsigned core_reg_size;
     unsigned core_reg_size;
     int which;
     int which;
     CORE_ADDR ignore;          /* reg addr, unused in this version */
     CORE_ADDR ignore;          /* reg addr, unused in this version */
{
{
 
 
  if (which == 0)
  if (which == 0)
    {
    {
 
 
      /* Integer registers */
      /* Integer registers */
 
 
#define gregs ((struct regs *)core_reg_sect)
#define gregs ((struct regs *)core_reg_sect)
      /* G0 *always* holds 0.  */
      /* G0 *always* holds 0.  */
      *(int *) &registers[REGISTER_BYTE (0)] = 0;
      *(int *) &registers[REGISTER_BYTE (0)] = 0;
 
 
      /* The globals and output registers.  */
      /* The globals and output registers.  */
      memcpy (&registers[REGISTER_BYTE (G1_REGNUM)], &gregs->r_g1,
      memcpy (&registers[REGISTER_BYTE (G1_REGNUM)], &gregs->r_g1,
              15 * REGISTER_RAW_SIZE (G1_REGNUM));
              15 * REGISTER_RAW_SIZE (G1_REGNUM));
      *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps;
      *(int *) &registers[REGISTER_BYTE (PS_REGNUM)] = gregs->r_ps;
      *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc;
      *(int *) &registers[REGISTER_BYTE (PC_REGNUM)] = gregs->r_pc;
      *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc;
      *(int *) &registers[REGISTER_BYTE (NPC_REGNUM)] = gregs->r_npc;
      *(int *) &registers[REGISTER_BYTE (Y_REGNUM)] = gregs->r_y;
      *(int *) &registers[REGISTER_BYTE (Y_REGNUM)] = gregs->r_y;
 
 
      /* My best guess at where to get the locals and input
      /* My best guess at where to get the locals and input
         registers is exactly where they usually are, right above
         registers is exactly where they usually are, right above
         the stack pointer.  If the core dump was caused by a bus error
         the stack pointer.  If the core dump was caused by a bus error
         from blowing away the stack pointer (as is possible) then this
         from blowing away the stack pointer (as is possible) then this
         won't work, but it's worth the try. */
         won't work, but it's worth the try. */
      {
      {
        int sp;
        int sp;
 
 
        sp = *(int *) &registers[REGISTER_BYTE (SP_REGNUM)];
        sp = *(int *) &registers[REGISTER_BYTE (SP_REGNUM)];
        if (0 != target_read_memory (sp, &registers[REGISTER_BYTE (L0_REGNUM)],
        if (0 != target_read_memory (sp, &registers[REGISTER_BYTE (L0_REGNUM)],
                                     16 * REGISTER_RAW_SIZE (L0_REGNUM)))
                                     16 * REGISTER_RAW_SIZE (L0_REGNUM)))
          {
          {
            /* fprintf_unfiltered so user can still use gdb */
            /* fprintf_unfiltered so user can still use gdb */
            fprintf_unfiltered (gdb_stderr,
            fprintf_unfiltered (gdb_stderr,
                "Couldn't read input and local registers from core file\n");
                "Couldn't read input and local registers from core file\n");
          }
          }
      }
      }
    }
    }
  else if (which == 2)
  else if (which == 2)
    {
    {
 
 
      /* Floating point registers */
      /* Floating point registers */
 
 
#define fpuregs  ((struct fpu *) core_reg_sect)
#define fpuregs  ((struct fpu *) core_reg_sect)
      if (core_reg_size >= sizeof (struct fpu))
      if (core_reg_size >= sizeof (struct fpu))
        {
        {
          memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], fpuregs->fpu_regs,
          memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], fpuregs->fpu_regs,
                  sizeof (fpuregs->fpu_regs));
                  sizeof (fpuregs->fpu_regs));
          memcpy (&registers[REGISTER_BYTE (FPS_REGNUM)], &fpuregs->fpu_fsr,
          memcpy (&registers[REGISTER_BYTE (FPS_REGNUM)], &fpuregs->fpu_fsr,
                  sizeof (FPU_FSR_TYPE));
                  sizeof (FPU_FSR_TYPE));
        }
        }
      else
      else
        fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
        fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
    }
    }
}
}
 
 
int
int
kernel_u_size ()
kernel_u_size ()
{
{
  return (sizeof (struct user));
  return (sizeof (struct user));
}
}


 
 
/* Register that we are able to handle sparc core file formats.
/* Register that we are able to handle sparc core file formats.
   FIXME: is this really bfd_target_unknown_flavour? */
   FIXME: is this really bfd_target_unknown_flavour? */
 
 
static struct core_fns sparc_core_fns =
static struct core_fns sparc_core_fns =
{
{
  bfd_target_unknown_flavour,           /* core_flavour */
  bfd_target_unknown_flavour,           /* core_flavour */
  default_check_format,                 /* check_format */
  default_check_format,                 /* check_format */
  default_core_sniffer,                 /* core_sniffer */
  default_core_sniffer,                 /* core_sniffer */
  fetch_core_registers,                 /* core_read_registers */
  fetch_core_registers,                 /* core_read_registers */
  NULL                                  /* next */
  NULL                                  /* next */
};
};
 
 
void
void
_initialize_core_sparc ()
_initialize_core_sparc ()
{
{
  add_core_fns (&sparc_core_fns);
  add_core_fns (&sparc_core_fns);
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.