Make this link and work again (from Christian Limpach)

This commit is contained in:
christos 2003-10-26 17:45:13 +00:00
parent f9f34b91b1
commit 34e2db4a3c
1 changed files with 37 additions and 37 deletions

View File

@ -29,6 +29,16 @@
#include <sys/ptrace.h>
#include <machine/reg.h>
#ifndef HAVE_GREGSET_T
typedef struct reg gregset_t;
#endif
#ifndef HAVE_FPREGSET_T
typedef struct fpreg fpregset_t;
#endif
#include "gregset.h"
/* NOTE: We don't bother with any of the deferred_store nonsense; it
makes things a lot more complicated than they need to be. */
@ -71,7 +81,7 @@ fetch_inferior_registers (int regno)
} regs;
if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) &regs, 0) == -1)
(PTRACE_ARG3_TYPE) &regs, TIDGET (inferior_ptid)) == -1)
perror_with_name ("Couldn't get registers");
if (gdbarch_ptr_bit (current_gdbarch) == 32)
@ -90,7 +100,7 @@ fetch_inferior_registers (int regno)
} fpregs;
if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
(PTRACE_ARG3_TYPE) &fpregs, TIDGET (inferior_ptid)) == -1)
perror_with_name ("Couldn't get floating point registers");
if (gdbarch_ptr_bit (current_gdbarch) == 32)
@ -118,7 +128,7 @@ store_inferior_registers (int regno)
} regs;
if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) &regs, 0) == -1)
(PTRACE_ARG3_TYPE) &regs, TIDGET (inferior_ptid)) == -1)
perror_with_name ("Couldn't get registers");
if (gdbarch_ptr_bit (current_gdbarch) == 32)
@ -127,7 +137,7 @@ store_inferior_registers (int regno)
sparcnbsd_fill_reg64 ((char *) &regs.regs64, regno);
if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) &regs, 0) == -1)
(PTRACE_ARG3_TYPE) &regs, TIDGET (inferior_ptid)) == -1)
perror_with_name ("Couldn't write registers");
/* Deal with the stack regs. */
@ -189,7 +199,7 @@ store_inferior_registers (int regno)
} fpregs;
if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
(PTRACE_ARG3_TYPE) &fpregs, TIDGET (inferior_ptid)) == -1)
perror_with_name ("Couldn't get floating point registers");
if (gdbarch_ptr_bit (current_gdbarch) == 32)
@ -198,7 +208,7 @@ store_inferior_registers (int regno)
sparcnbsd_fill_fpreg64 ((char *) &fpregs.fpregs64, regno);
if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
(PTRACE_ARG3_TYPE) &fpregs, TIDGET (inferior_ptid)) == -1)
perror_with_name ("Couldn't write floating point registers");
if (regno != -1)
@ -207,52 +217,42 @@ store_inferior_registers (int regno)
}
void
nbsd_reg_to_internal (rgs)
char *rgs;
supply_gregset (gregset_t *gregsetp)
{
if (gdbarch_ptr_bit (current_gdbarch) == 32)
sparcnbsd_supply_reg32(rgs, -1);
sparcnbsd_supply_reg32((char *)gregsetp, -1);
else
sparcnbsd_supply_reg64(rgs, -1);
sparcnbsd_supply_reg64((char *)gregsetp, -1);
}
void
nbsd_fpreg_to_internal (frgs)
char *frgs;
{
int i;
if (gdbarch_ptr_bit (current_gdbarch) == 32)
sparcnbsd_supply_fpreg32(frgs, -1);
else {
for (i = 0; i < 32; i++)
sparcnbsd_supply_fpreg64(frgs + i*8, FP0_REGNUM+i);
sparcnbsd_supply_fpreg64(frgs + 32*8, FSR_REGNUM);
}
}
void
nbsd_internal_to_reg (regs)
char *regs;
fill_gregset (gregset_t *gregsetp, int regno)
{
if (gdbarch_ptr_bit (current_gdbarch) == 32)
sparcnbsd_fill_reg32(regs, -1);
sparcnbsd_fill_reg32((char *)gregsetp, regno);
else
sparcnbsd_fill_reg64(regs, -1);
sparcnbsd_fill_reg64((char *)gregsetp, regno);
}
void
nbsd_internal_to_fpreg (fpregs)
char *fpregs;
supply_fpregset (fpregset_t *fpregsetp)
{
int i;
if (gdbarch_ptr_bit (current_gdbarch) == 32)
sparcnbsd_fill_fpreg32(fpregs, -1);
else {
for (i = 0; i < 32; i++)
sparcnbsd_fill_fpreg64(fpregs + i*8, FP0_REGNUM+i);
sparcnbsd_fill_fpreg64(fpregs + 32*8, FSR_REGNUM);
}
sparcnbsd_supply_fpreg32((char *)fpregsetp, -1);
else
sparcnbsd_supply_fpreg64((char *)fpregsetp, -1);
}
void
fill_fpregset (fpregset_t *fpregsetp, int regno)
{
int i;
if (gdbarch_ptr_bit (current_gdbarch) == 32)
sparcnbsd_fill_fpreg32((char *)fpregsetp, regno);
else
sparcnbsd_fill_fpreg64((char *)fpregsetp, regno);
}