From: Jim Blandy <jimb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: RFA: don't assume gprs, fprs, some SPRS are contiguous
Date: Tue, 04 May 2004 01:14:00 -0000 [thread overview]
Message-ID: <vt2pt9lgfqs.fsf@zenia.home> (raw)
Here's a revision of a patch I posted previously, in light of the
other patches I've posted today.
2004-04-20 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, FP0_REGNUM,
and FPLAST_REGNUM.
*** gdb/ppc-linux-nat.c 2004-05-03 18:50:56.000000000 -0500
--- gdb/ppc-linux-nat.c 2004-05-03 19:00:50.000000000 -0500
***************
*** 311,320 ****
int i;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
! for (i = 0; i <= tdep->ppc_fpscr_regnum; i++)
! fetch_register (tid, i);
if (tdep->ppc_mq_regnum != -1)
fetch_register (tid, tdep->ppc_mq_regnum);
if (have_ptrace_getvrregs)
if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
fetch_altivec_registers (tid);
--- 311,336 ----
int i;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
! for (i = 0; i < ppc_num_gprs; i++)
! fetch_register (tid, tdep->ppc_gp0_regnum + i);
! if (FP0_REGNUM >= 0)
! for (i = 0; i < ppc_num_fprs; i++)
! fetch_register (tid, 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);
***************
*** 480,489 ****
int i;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
! for (i = 0; i <= tdep->ppc_fpscr_regnum; i++)
! store_register (tid, i);
if (tdep->ppc_mq_regnum != -1)
store_register (tid, tdep->ppc_mq_regnum);
if (have_ptrace_getvrregs)
if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
store_altivec_registers (tid);
--- 496,521 ----
int i;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
! for (i = 0; i < ppc_num_gprs; i++)
! store_register (tid, tdep->ppc_gp0_regnum + i);
! if (FP0_REGNUM >= 0)
! for (i = 0; i < ppc_num_fprs; i++)
! store_register (tid, 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);
next reply other threads:[~2004-05-04 1:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-04 1:14 Jim Blandy [this message]
2004-05-04 16:06 ` Kevin Buettner
2004-05-04 21:30 ` Jim Blandy
2004-05-04 22:06 ` Kevin Buettner
2004-05-05 1:48 ` Jim Blandy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vt2pt9lgfqs.fsf@zenia.home \
--to=jimb@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox