From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31656 invoked by alias); 7 Jun 2004 17:19:40 -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 31642 invoked from network); 7 Jun 2004 17:19:39 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 7 Jun 2004 17:19:39 -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 i57HJdi5017902 for ; Mon, 7 Jun 2004 13:19:39 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i57HJd011706 for ; Mon, 7 Jun 2004 13:19:39 -0400 Received: from localhost.localdomain (vpn50-15.rdu.redhat.com [172.16.50.15]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id i57HJc17029422 for ; Mon, 7 Jun 2004 13:19:39 -0400 Received: from saguaro (saguaro.lan [192.168.64.2]) by localhost.localdomain (8.12.11/8.12.10) with SMTP id i57HJX9i024642 for ; Mon, 7 Jun 2004 10:19:33 -0700 Date: Mon, 07 Jun 2004 17:19:00 -0000 From: Kevin Buettner To: gdb-patches@sources.redhat.com Subject: Re: RFA: Add support for Linux native on the PowerPC E500 Message-Id: <20040607101933.4b4841c9@saguaro> In-Reply-To: References: Organization: Red Hat Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2004-06/txt/msg00129.txt.bz2 On 05 Jun 2004 01:17:34 -0500 Jim Blandy wrote: > 2004-06-02 Jim Blandy > > Add native Linux support for the PowerPC E500. > * ppc-tdep.h (struct gdbarch_tdep): New member: 'ppc_gprs_pseudo_p'. > * rs6000-tdep.c (rs6000_gdbarch_init): Initialize it to false on > all architectures except the E500. > * ppc-linux-nat.c: (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): New > #definitions. > (struct gdb_evrregset_t): New type. > (have_ptrace_getsetevrregs): New variable. > (get_spe_registers, read_spliced_spe_reg, fetch_spe_register, > fetch_spe_registers): New functions. > (fetch_register): Call fetch_spe_register as appropriate. > Assert that we're only passed raw register numbers. > (fetch_ppc_registers): Call fetch_spe_registers as appropriate. > Don't fetch gprs if they're pseudoregisters. > (set_spe_registers, write_spliced_spe_reg, store_spe_register, > store_spe_registers): New functions. > (store_register): Call store_spe_register as appropriate. > Assert that we're only passed raw register numbers. > (store_ppc_registers): Call store_spe_registers as appropriate. > Don't store gprs if they're pseudoregisters. Okay, except for: > *************** store_register (int tid, int regno) > *** 413,423 **** > --- 764,784 ---- > size_t bytes_to_transfer; > char buf[MAX_REGISTER_SIZE]; > > + /* Sanity check: this function should only be called to store raw > + registers' values, never pseudoregisters' values. */ > + if (tdep->ppc_gp0_regnum <= regno > + && regno < tdep->ppc_gp0_regnum + ppc_num_gprs) > + gdb_assert (! tdep->ppc_gprs_pseudo_p); > + > if (altivec_register_p (regno)) > { > store_altivec_register (tid, regno); > return; > } > + else if (spe_register_p (regno)) > + { > + store_spe_register (tid, regno); > + } Is an early `return' needed after the call to store_spe_register()? (I noticed that the altivec case does this. Also, the corresponding code in fetch_register() does this.) Kevin