From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31756 invoked by alias); 4 May 2004 21:30:00 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 31733 invoked from network); 4 May 2004 21:29:59 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 4 May 2004 21:29:59 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i44LTxkG001046 for ; Tue, 4 May 2004 17:29:59 -0400 Received: from zenia.home.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i44LTuv11041; Tue, 4 May 2004 17:29:57 -0400 To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: don't assume gprs, fprs, some SPRS are contiguous References: <20040504090609.5fb4501b@saguaro> From: Jim Blandy Date: Tue, 04 May 2004 21:30:00 -0000 In-Reply-To: <20040504090609.5fb4501b@saguaro> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SW-Source: 2004-05/txt/msg00120.txt.bz2 --=-=-= Content-length: 828 Kevin Buettner writes: > On 03 May 2004 20:09:31 -0500 > Jim Blandy wrote: > > > 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 > > > > * 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. > > The FPLAST_REGNUM portion of the ChangeLog entry doesn't make sense anymore. > > Otherwise it looks okay provided the > s/FP0_REGNUM/tdep->ppc_fp0_regnum/ change is made. Here's the revised patch; I'll commit after the FP0_REGNUM elimination patch is done. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=jimb.gdb-ppc-linux-nat-regs-not-contiguous.patch Content-Description: remove assumption that gprs, fprs, and uisa sprs are contiguous Content-length: 3425 2004-04-20 Jim Blandy * 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. *** gdb/ppc-linux-nat.c 2004-05-04 13:32:34.000000000 -0500 --- gdb/ppc-linux-nat.c 2004-05-04 15:46:55.000000000 -0500 *************** *** 314,323 **** 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); --- 314,339 ---- 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 (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,494 **** 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); --- 501,526 ---- 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 (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); --=-=-=--