diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2007-05-06 14:12:13 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2007-05-06 14:12:13 +0000 |
commit | 390c15228a6b8663389bed8206e1b6e0f5434194 (patch) | |
tree | d594dcbfbc744d17896dbb219604cefb934c780b | |
parent | 647478e0682504636c2bc9de109a44f70826cbb6 (diff) | |
download | binutils-390c15228a6b8663389bed8206e1b6e0f5434194.zip binutils-390c15228a6b8663389bed8206e1b6e0f5434194.tar.gz binutils-390c15228a6b8663389bed8206e1b6e0f5434194.tar.bz2 |
* alpha-tdep.c (alpha_supply_int_regs, alpha_fill_int_regs,
alpha_supply_fp_regs, alpha_fill_fp_regs): Add REGCACHE parameter,
use it instead of current_regcache.
* alpha-tdep.h (struct regcache): Add forward declaration.
(alpha_supply_int_regs, alpha_fill_int_regs, alpha_supply_fp_regs,
alpha_fill_fp_regs): Update prototypes.
* alpha-nat.c: (supply_gregset, fill_gregset, supply_fpregset,
fill_fpregset): Pass current_regcache to alpha_supply/fill_ routines.
* alpha-linux-nat.c: Include "regcache.h".
(supply_gregset, fill_gregset, supply_fpregset, fill_fpregset): Pass
current_regcache to alpha_supply/fill_ routines.
* alphabsd-tdep.c: Include "regcache.h".
(alphabsd_supply_reg, alphabsd_supply_fpreg): Add REGCACHE paramter,
pass it to alpha_supply_ routines. Make REGS const.
(alphabsd_fill_reg, alphabsd_fill_fpreg): Add REGCACHE parameter,
pass it to alpha_fill_ routines.
* alphabsd-tdep.h (struct regcache): Add forward declaration.
(alphabsd_supply_reg, alphabsd_fill_reg, alphabsd_supply_fpreg,
alphabsd_fill_fpreg): Update prototypes.
* alphanbsd-nat.c (supply_gregset, fill_gregset, supply_fpregset,
fill_fpregset, alphabsd_fetch_inferior_registers,
alphabsd_store_inferior_registers): Pass current_regcache to
alphabsd_supply/fill_ routines.
* Makefile.in (alpha-linux-nat.o, alphabsd-tdep.o): Update
dependencies.
-rw-r--r-- | gdb/ChangeLog | 32 | ||||
-rw-r--r-- | gdb/Makefile.in | 6 | ||||
-rw-r--r-- | gdb/alpha-linux-nat.c | 9 | ||||
-rw-r--r-- | gdb/alpha-nat.c | 8 | ||||
-rw-r--r-- | gdb/alpha-tdep.c | 35 | ||||
-rw-r--r-- | gdb/alpha-tdep.h | 15 | ||||
-rw-r--r-- | gdb/alphabsd-nat.c | 16 | ||||
-rw-r--r-- | gdb/alphabsd-tdep.c | 17 | ||||
-rw-r--r-- | gdb/alphabsd-tdep.h | 10 |
9 files changed, 96 insertions, 52 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3d7af90..138a019 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,37 @@ 2007-05-06 Ulrich Weigand <uweigand@de.ibm.com> + * alpha-tdep.c (alpha_supply_int_regs, alpha_fill_int_regs, + alpha_supply_fp_regs, alpha_fill_fp_regs): Add REGCACHE parameter, + use it instead of current_regcache. + * alpha-tdep.h (struct regcache): Add forward declaration. + (alpha_supply_int_regs, alpha_fill_int_regs, alpha_supply_fp_regs, + alpha_fill_fp_regs): Update prototypes. + + * alpha-nat.c: (supply_gregset, fill_gregset, supply_fpregset, + fill_fpregset): Pass current_regcache to alpha_supply/fill_ routines. + * alpha-linux-nat.c: Include "regcache.h". + (supply_gregset, fill_gregset, supply_fpregset, fill_fpregset): Pass + current_regcache to alpha_supply/fill_ routines. + + * alphabsd-tdep.c: Include "regcache.h". + (alphabsd_supply_reg, alphabsd_supply_fpreg): Add REGCACHE paramter, + pass it to alpha_supply_ routines. Make REGS const. + (alphabsd_fill_reg, alphabsd_fill_fpreg): Add REGCACHE parameter, + pass it to alpha_fill_ routines. + * alphabsd-tdep.h (struct regcache): Add forward declaration. + (alphabsd_supply_reg, alphabsd_fill_reg, alphabsd_supply_fpreg, + alphabsd_fill_fpreg): Update prototypes. + + * alphanbsd-nat.c (supply_gregset, fill_gregset, supply_fpregset, + fill_fpregset, alphabsd_fetch_inferior_registers, + alphabsd_store_inferior_registers): Pass current_regcache to + alphabsd_supply/fill_ routines. + + * Makefile.in (alpha-linux-nat.o, alphabsd-tdep.o): Update + dependencies. + +2007-05-06 Ulrich Weigand <uweigand@de.ibm.com> + * aix-thread.c (supply_gprs64, supply_reg32, supply_fprs, supply_sprs64, supply_sprs32): Add REGCACHE parameter, use it instead of current_regcache. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 3725ef4..b85ffbc 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1712,12 +1712,12 @@ aix-thread.o: aix-thread.c $(defs_h) $(gdb_assert_h) $(gdbthread_h) \ alphabsd-nat.o: alphabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ $(alpha_tdep_h) $(alphabsd_tdep_h) $(inf_ptrace_h) $(gregset_h) \ $(bsd_kvm_h) -alphabsd-tdep.o: alphabsd-tdep.c $(defs_h) $(alpha_tdep_h) \ +alphabsd-tdep.o: alphabsd-tdep.c $(defs_h) $(regcache_h) $(alpha_tdep_h) \ $(alphabsd_tdep_h) alphafbsd-tdep.o: alphafbsd-tdep.c $(defs_h) $(value_h) $(osabi_h) \ $(alpha_tdep_h) $(solib_svr4_h) -alpha-linux-nat.o: alpha-linux-nat.c $(defs_h) $(target_h) $(linux_nat_h) \ - $(alpha_tdep_h) $(gregset_h) +alpha-linux-nat.o: alpha-linux-nat.c $(defs_h) $(target_h) $(regcache_h) \ + $(linux_nat_h) $(alpha_tdep_h) $(gregset_h) alpha-linux-tdep.o: alpha-linux-tdep.c $(defs_h) $(frame_h) $(gdb_assert_h) \ $(gdb_string_h) $(osabi_h) $(solib_svr4_h) $(symtab_h) $(regset_h) \ $(regcache_h) $(alpha_tdep_h) diff --git a/gdb/alpha-linux-nat.c b/gdb/alpha-linux-nat.c index b2a1fc7..3b020ba 100644 --- a/gdb/alpha-linux-nat.c +++ b/gdb/alpha-linux-nat.c @@ -20,6 +20,7 @@ #include "defs.h" #include "target.h" +#include "regcache.h" #include "linux-nat.h" #include "alpha-tdep.h" @@ -44,7 +45,7 @@ supply_gregset (gdb_gregset_t *gregsetp) long *regp = (long *)gregsetp; /* PC is in slot 32, UNIQUE is in slot 33. */ - alpha_supply_int_regs (-1, regp, regp + 31, regp + 32); + alpha_supply_int_regs (current_regcache, -1, regp, regp + 31, regp + 32); } void @@ -53,7 +54,7 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno) long *regp = (long *)gregsetp; /* PC is in slot 32, UNIQUE is in slot 33. */ - alpha_fill_int_regs (regno, regp, regp + 31, regp + 32); + alpha_fill_int_regs (current_regcache, regno, regp, regp + 31, regp + 32); } /* @@ -67,7 +68,7 @@ supply_fpregset (gdb_fpregset_t *fpregsetp) long *regp = (long *)fpregsetp; /* FPCR is in slot 32. */ - alpha_supply_fp_regs (-1, regp, regp + 31); + alpha_supply_fp_regs (current_regcache, -1, regp, regp + 31); } void @@ -76,7 +77,7 @@ fill_fpregset (gdb_fpregset_t *fpregsetp, int regno) long *regp = (long *)fpregsetp; /* FPCR is in slot 32. */ - alpha_fill_fp_regs (regno, regp, regp + 31); + alpha_fill_fp_regs (current_regcache, regno, regp, regp + 31); } diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c index b30f661..9a41dd1 100644 --- a/gdb/alpha-nat.c +++ b/gdb/alpha-nat.c @@ -158,7 +158,7 @@ supply_gregset (gdb_gregset_t *gregsetp) long *regp = gregsetp->regs; /* PC is in slot 32. */ - alpha_supply_int_regs (-1, regp, regp + 31, NULL); + alpha_supply_int_regs (current_regcache, -1, regp, regp + 31, NULL); } void @@ -167,7 +167,7 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno) long *regp = gregsetp->regs; /* PC is in slot 32. */ - alpha_fill_int_regs (regno, regp, regp + 31, NULL); + alpha_fill_int_regs (current_regcache, regno, regp, regp + 31, NULL); } /* @@ -181,7 +181,7 @@ supply_fpregset (gdb_fpregset_t *fpregsetp) long *regp = fpregsetp->regs; /* FPCR is in slot 32. */ - alpha_supply_fp_regs (-1, regp, regp + 31); + alpha_supply_fp_regs (current_regcache, -1, regp, regp + 31); } void @@ -190,7 +190,7 @@ fill_fpregset (gdb_fpregset_t *fpregsetp, int regno) long *regp = fpregsetp->regs; /* FPCR is in slot 32. */ - alpha_fill_fp_regs (regno, regp, regp + 31); + alpha_fill_fp_regs (current_regcache, regno, regp, regp + 31); } #endif diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 92a654f..00eaeb9 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -1296,71 +1296,74 @@ alpha_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) targets don't supply this value in their core files. */ void -alpha_supply_int_regs (int regno, const void *r0_r30, - const void *pc, const void *unique) +alpha_supply_int_regs (struct regcache *regcache, int regno, + const void *r0_r30, const void *pc, const void *unique) { const gdb_byte *regs = r0_r30; int i; for (i = 0; i < 31; ++i) if (regno == i || regno == -1) - regcache_raw_supply (current_regcache, i, regs + i * 8); + regcache_raw_supply (regcache, i, regs + i * 8); if (regno == ALPHA_ZERO_REGNUM || regno == -1) - regcache_raw_supply (current_regcache, ALPHA_ZERO_REGNUM, NULL); + regcache_raw_supply (regcache, ALPHA_ZERO_REGNUM, NULL); if (regno == ALPHA_PC_REGNUM || regno == -1) - regcache_raw_supply (current_regcache, ALPHA_PC_REGNUM, pc); + regcache_raw_supply (regcache, ALPHA_PC_REGNUM, pc); if (regno == ALPHA_UNIQUE_REGNUM || regno == -1) - regcache_raw_supply (current_regcache, ALPHA_UNIQUE_REGNUM, unique); + regcache_raw_supply (regcache, ALPHA_UNIQUE_REGNUM, unique); } void -alpha_fill_int_regs (int regno, void *r0_r30, void *pc, void *unique) +alpha_fill_int_regs (const struct regcache *regcache, + int regno, void *r0_r30, void *pc, void *unique) { gdb_byte *regs = r0_r30; int i; for (i = 0; i < 31; ++i) if (regno == i || regno == -1) - regcache_raw_collect (current_regcache, i, regs + i * 8); + regcache_raw_collect (regcache, i, regs + i * 8); if (regno == ALPHA_PC_REGNUM || regno == -1) - regcache_raw_collect (current_regcache, ALPHA_PC_REGNUM, pc); + regcache_raw_collect (regcache, ALPHA_PC_REGNUM, pc); if (unique && (regno == ALPHA_UNIQUE_REGNUM || regno == -1)) - regcache_raw_collect (current_regcache, ALPHA_UNIQUE_REGNUM, unique); + regcache_raw_collect (regcache, ALPHA_UNIQUE_REGNUM, unique); } void -alpha_supply_fp_regs (int regno, const void *f0_f30, const void *fpcr) +alpha_supply_fp_regs (struct regcache *regcache, int regno, + const void *f0_f30, const void *fpcr) { const gdb_byte *regs = f0_f30; int i; for (i = ALPHA_FP0_REGNUM; i < ALPHA_FP0_REGNUM + 31; ++i) if (regno == i || regno == -1) - regcache_raw_supply (current_regcache, i, + regcache_raw_supply (regcache, i, regs + (i - ALPHA_FP0_REGNUM) * 8); if (regno == ALPHA_FPCR_REGNUM || regno == -1) - regcache_raw_supply (current_regcache, ALPHA_FPCR_REGNUM, fpcr); + regcache_raw_supply (regcache, ALPHA_FPCR_REGNUM, fpcr); } void -alpha_fill_fp_regs (int regno, void *f0_f30, void *fpcr) +alpha_fill_fp_regs (const struct regcache *regcache, + int regno, void *f0_f30, void *fpcr) { gdb_byte *regs = f0_f30; int i; for (i = ALPHA_FP0_REGNUM; i < ALPHA_FP0_REGNUM + 31; ++i) if (regno == i || regno == -1) - regcache_raw_collect (current_regcache, i, + regcache_raw_collect (regcache, i, regs + (i - ALPHA_FP0_REGNUM) * 8); if (regno == ALPHA_FPCR_REGNUM || regno == -1) - regcache_raw_collect (current_regcache, ALPHA_FPCR_REGNUM, fpcr); + regcache_raw_collect (regcache, ALPHA_FPCR_REGNUM, fpcr); } diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h index 6cb6e7f..87aaf84 100644 --- a/gdb/alpha-tdep.h +++ b/gdb/alpha-tdep.h @@ -22,6 +22,8 @@ #ifndef ALPHA_TDEP_H #define ALPHA_TDEP_H +struct regcache; + /* Say how long (ordinary) registers are. This is a piece of bogosity used in push_word and a few other places; register_size() is the real way to know how big a register is. */ @@ -113,10 +115,13 @@ extern CORE_ADDR alpha_after_prologue (CORE_ADDR pc); extern void alpha_mdebug_init_abi (struct gdbarch_info, struct gdbarch *); extern void alpha_dwarf2_init_abi (struct gdbarch_info, struct gdbarch *); -extern void alpha_supply_int_regs (int, const void *, const void *, - const void *); -extern void alpha_fill_int_regs (int, void *, void *, void *); -extern void alpha_supply_fp_regs (int, const void *, const void *); -extern void alpha_fill_fp_regs (int, void *, void *); +extern void alpha_supply_int_regs (struct regcache *, int, const void *, + const void *, const void *); +extern void alpha_fill_int_regs (const struct regcache *, int, + void *, void *, void *); +extern void alpha_supply_fp_regs (struct regcache *, int, + const void *, const void *); +extern void alpha_fill_fp_regs (const struct regcache *, + int, void *, void *); #endif /* ALPHA_TDEP_H */ diff --git a/gdb/alphabsd-nat.c b/gdb/alphabsd-nat.c index fc0f0ad..a8bf532 100644 --- a/gdb/alphabsd-nat.c +++ b/gdb/alphabsd-nat.c @@ -52,25 +52,25 @@ typedef struct fpreg fpregset_t; void supply_gregset (gregset_t *gregsetp) { - alphabsd_supply_reg ((char *) gregsetp, -1); + alphabsd_supply_reg (current_regcache, (char *) gregsetp, -1); } void fill_gregset (gregset_t *gregsetp, int regno) { - alphabsd_fill_reg ((char *) gregsetp, regno); + alphabsd_fill_reg (current_regcache, (char *) gregsetp, regno); } void supply_fpregset (fpregset_t *fpregsetp) { - alphabsd_supply_fpreg ((char *) fpregsetp, -1); + alphabsd_supply_fpreg (current_regcache, (char *) fpregsetp, -1); } void fill_fpregset (fpregset_t *fpregsetp, int regno) { - alphabsd_fill_fpreg ((char *) fpregsetp, regno); + alphabsd_fill_fpreg (current_regcache, (char *) fpregsetp, regno); } /* Determine if PT_GETREGS fetches this register. */ @@ -96,7 +96,7 @@ alphabsd_fetch_inferior_registers (int regno) (PTRACE_TYPE_ARG3) &gregs, 0) == -1) perror_with_name (_("Couldn't get registers")); - alphabsd_supply_reg ((char *) &gregs, regno); + alphabsd_supply_reg (current_regcache, (char *) &gregs, regno); if (regno != -1) return; } @@ -109,7 +109,7 @@ alphabsd_fetch_inferior_registers (int regno) (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name (_("Couldn't get floating point status")); - alphabsd_supply_fpreg ((char *) &fpregs, regno); + alphabsd_supply_fpreg (current_regcache, (char *) &fpregs, regno); } } @@ -126,7 +126,7 @@ alphabsd_store_inferior_registers (int regno) (PTRACE_TYPE_ARG3) &gregs, 0) == -1) perror_with_name (_("Couldn't get registers")); - alphabsd_fill_reg ((char *) &gregs, regno); + alphabsd_fill_reg (current_regcache, (char *) &gregs, regno); if (ptrace (PT_SETREGS, PIDGET (inferior_ptid), (PTRACE_TYPE_ARG3) &gregs, 0) == -1) @@ -144,7 +144,7 @@ alphabsd_store_inferior_registers (int regno) (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name (_("Couldn't get floating point status")); - alphabsd_fill_fpreg ((char *) &fpregs, regno); + alphabsd_fill_fpreg (current_regcache, (char *) &fpregs, regno); if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid), (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) diff --git a/gdb/alphabsd-tdep.c b/gdb/alphabsd-tdep.c index 69187ec..cfb3982 100644 --- a/gdb/alphabsd-tdep.c +++ b/gdb/alphabsd-tdep.c @@ -20,6 +20,7 @@ Boston, MA 02110-1301, USA. */ #include "defs.h" +#include "regcache.h" #include "alpha-tdep.h" #include "alphabsd-tdep.h" @@ -28,29 +29,29 @@ ptrace register structure used by BSD on Alpha. */ void -alphabsd_supply_reg (char *regs, int regno) +alphabsd_supply_reg (struct regcache *regcache, const char *regs, int regno) { /* PC is at slot 32; UNIQUE not present. */ - alpha_supply_int_regs (regno, regs, regs + 31 * 8, NULL); + alpha_supply_int_regs (regcache, regno, regs, regs + 31 * 8, NULL); } void -alphabsd_fill_reg (char *regs, int regno) +alphabsd_fill_reg (const struct regcache *regcache, char *regs, int regno) { /* PC is at slot 32; UNIQUE not present. */ - alpha_fill_int_regs (regno, regs, regs + 31 * 8, NULL); + alpha_fill_int_regs (regcache, regno, regs, regs + 31 * 8, NULL); } void -alphabsd_supply_fpreg (char *fpregs, int regno) +alphabsd_supply_fpreg (struct regcache *regcache, const char *fpregs, int regno) { /* FPCR is at slot 33; slot 32 unused. */ - alpha_supply_fp_regs (regno, fpregs, fpregs + 32 * 8); + alpha_supply_fp_regs (regcache, regno, fpregs, fpregs + 32 * 8); } void -alphabsd_fill_fpreg (char *fpregs, int regno) +alphabsd_fill_fpreg (const struct regcache *regcache, char *fpregs, int regno) { /* FPCR is at slot 33; slot 32 unused. */ - alpha_fill_fp_regs (regno, fpregs, fpregs + 32 * 8); + alpha_fill_fp_regs (regcache, regno, fpregs, fpregs + 32 * 8); } diff --git a/gdb/alphabsd-tdep.h b/gdb/alphabsd-tdep.h index 134a24d..802b229 100644 --- a/gdb/alphabsd-tdep.h +++ b/gdb/alphabsd-tdep.h @@ -22,11 +22,13 @@ #ifndef ALPHABSD_TDEP_H #define ALPHABSD_TDEP_H -void alphabsd_supply_reg (char *, int); -void alphabsd_fill_reg (char *, int); +struct regcache; -void alphabsd_supply_fpreg (char *, int); -void alphabsd_fill_fpreg (char *, int); +void alphabsd_supply_reg (struct regcache *, const char *, int); +void alphabsd_fill_reg (const struct regcache *, char *, int); + +void alphabsd_supply_fpreg (struct regcache *, const char *, int); +void alphabsd_fill_fpreg (const struct regcache *, char *, int); /* Functions exported from alphanbsd-tdep.c. */ |