diff options
author | Jim Blandy <jimb@codesourcery.com> | 2004-05-05 01:48:37 +0000 |
---|---|---|
committer | Jim Blandy <jimb@codesourcery.com> | 2004-05-05 01:48:37 +0000 |
commit | 32b99774f760000a23e301739edbc3d88086a008 (patch) | |
tree | 2659ed7c2a7f199146af78553ec662b87ad759fc /gdb | |
parent | 366f009f23b0e5fc1668d1f728b4cda533df5cb5 (diff) | |
download | binutils-32b99774f760000a23e301739edbc3d88086a008.zip binutils-32b99774f760000a23e301739edbc3d88086a008.tar.gz binutils-32b99774f760000a23e301739edbc3d88086a008.tar.bz2 |
* ppc-linux-nat.c (fetch_ppc_registers, store_ppc_registers):
Don't assume that the gprs, fprs, and UISA sprs are
contiguous, start at register number zero, and end with fpscr.
Instead, use the numbers from the tdep structure.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/ppc-linux-nat.c | 40 |
2 files changed, 41 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0862f2c..7e4c9ef 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2004-05-04 Jim Blandy <jimb@redhat.com> + * ppc-linux-nat.c (fetch_ppc_registers, store_ppc_registers): + Don't assume that the gprs, fprs, and UISA sprs are + contiguous, start at register number zero, and end with fpscr. + Instead, use the numbers from the tdep structure. + * config/rs6000/tm-rs6000.h (FP0_REGNUM): Document that this should no longer be used in code specific to the RS6000 and its derivatives. diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index b6dbbc9..6d64665 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -314,10 +314,26 @@ fetch_ppc_registers (int tid) int i; struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - for (i = 0; i <= tdep->ppc_fpscr_regnum; i++) - fetch_register (tid, i); + for (i = 0; i < ppc_num_gprs; i++) + fetch_register (tid, tdep->ppc_gp0_regnum + i); + if (tdep->ppc_fp0_regnum >= 0) + for (i = 0; i < ppc_num_fprs; i++) + fetch_register (tid, tdep->ppc_fp0_regnum + i); + fetch_register (tid, PC_REGNUM); + if (tdep->ppc_ps_regnum != -1) + fetch_register (tid, tdep->ppc_ps_regnum); + if (tdep->ppc_cr_regnum != -1) + fetch_register (tid, tdep->ppc_cr_regnum); + if (tdep->ppc_lr_regnum != -1) + fetch_register (tid, tdep->ppc_lr_regnum); + if (tdep->ppc_ctr_regnum != -1) + fetch_register (tid, tdep->ppc_ctr_regnum); + if (tdep->ppc_xer_regnum != -1) + fetch_register (tid, tdep->ppc_xer_regnum); if (tdep->ppc_mq_regnum != -1) fetch_register (tid, tdep->ppc_mq_regnum); + if (tdep->ppc_fpscr_regnum != -1) + fetch_register (tid, tdep->ppc_fpscr_regnum); if (have_ptrace_getvrregs) if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1) fetch_altivec_registers (tid); @@ -485,10 +501,26 @@ store_ppc_registers (int tid) int i; struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); - for (i = 0; i <= tdep->ppc_fpscr_regnum; i++) - store_register (tid, i); + for (i = 0; i < ppc_num_gprs; i++) + store_register (tid, tdep->ppc_gp0_regnum + i); + if (tdep->ppc_fp0_regnum >= 0) + for (i = 0; i < ppc_num_fprs; i++) + store_register (tid, tdep->ppc_fp0_regnum + i); + store_register (tid, PC_REGNUM); + if (tdep->ppc_ps_regnum != -1) + store_register (tid, tdep->ppc_ps_regnum); + if (tdep->ppc_cr_regnum != -1) + store_register (tid, tdep->ppc_cr_regnum); + if (tdep->ppc_lr_regnum != -1) + store_register (tid, tdep->ppc_lr_regnum); + if (tdep->ppc_ctr_regnum != -1) + store_register (tid, tdep->ppc_ctr_regnum); + if (tdep->ppc_xer_regnum != -1) + store_register (tid, tdep->ppc_xer_regnum); if (tdep->ppc_mq_regnum != -1) store_register (tid, tdep->ppc_mq_regnum); + if (tdep->ppc_fpscr_regnum != -1) + store_register (tid, tdep->ppc_fpscr_regnum); if (have_ptrace_getvrregs) if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1) store_altivec_registers (tid); |