diff options
| author | christos <christos@NetBSD.org> | 2003-10-26 17:45:13 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2003-10-26 17:45:13 +0000 |
| commit | 34e2db4a3c99aae3d5ec70f2c10774de79d15f77 (patch) | |
| tree | a3b1bcde524d4dbc0a0f30efad8624a938c7a6e3 /gnu | |
| parent | f9f34b91b1ca3ec4717c5d782c99f516a1c7872c (diff) | |
Make this link and work again (from Christian Limpach)
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/dist/gdb/gdb/sparc64nbsd-nat.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/gnu/dist/gdb/gdb/sparc64nbsd-nat.c b/gnu/dist/gdb/gdb/sparc64nbsd-nat.c index e6b0fcad2ea..5f519a669c7 100644 --- a/gnu/dist/gdb/gdb/sparc64nbsd-nat.c +++ b/gnu/dist/gdb/gdb/sparc64nbsd-nat.c @@ -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) ®s, 0) == -1) + (PTRACE_ARG3_TYPE) ®s, 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) ®s, 0) == -1) + (PTRACE_ARG3_TYPE) ®s, 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 *) ®s.regs64, regno); if (ptrace (PT_SETREGS, PIDGET (inferior_ptid), - (PTRACE_ARG3_TYPE) ®s, 0) == -1) + (PTRACE_ARG3_TYPE) ®s, 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; +fill_gregset (gregset_t *gregsetp, int regno) { - 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); - } + sparcnbsd_fill_reg32((char *)gregsetp, regno); + else + sparcnbsd_fill_reg64((char *)gregsetp, regno); } void -nbsd_internal_to_reg (regs) - char *regs; +supply_fpregset (fpregset_t *fpregsetp) { + int i; + if (gdbarch_ptr_bit (current_gdbarch) == 32) - sparcnbsd_fill_reg32(regs, -1); - else - sparcnbsd_fill_reg64(regs, -1); + sparcnbsd_supply_fpreg32((char *)fpregsetp, -1); + else + sparcnbsd_supply_fpreg64((char *)fpregsetp, -1); } void -nbsd_internal_to_fpreg (fpregs) - char *fpregs; +fill_fpregset (fpregset_t *fpregsetp, int regno) { 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_fill_fpreg32((char *)fpregsetp, regno); + else + sparcnbsd_fill_fpreg64((char *)fpregsetp, regno); } |
