From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11285 invoked by alias); 8 Aug 2008 15:18:33 -0000 Received: (qmail 11093 invoked by uid 22791); 8 Aug 2008 15:18:32 -0000 X-Spam-Check-By: sourceware.org Received: from igw3.br.ibm.com (HELO igw3.br.ibm.com) (32.104.18.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 08 Aug 2008 15:17:45 +0000 Received: from mailhub3.br.ibm.com (unknown [9.18.232.110]) by igw3.br.ibm.com (Postfix) with ESMTP id B42B0390253 for ; Fri, 8 Aug 2008 11:58:19 -0300 (BRST) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m78FHccv1446054 for ; Fri, 8 Aug 2008 12:17:38 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m78FHWFo015708 for ; Fri, 8 Aug 2008 12:17:32 -0300 Received: from [9.8.15.69] ([9.8.15.69]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m78FHVdh015667 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 8 Aug 2008 12:17:32 -0300 Subject: Re: [PATCH-ppc 2/5] Add VSX support for core-files From: Luis Machado Reply-To: luisgpm@linux.vnet.ibm.com To: gdb-patches@sourceware.org In-Reply-To: <1217016947.29012.76.camel@gargoyle> References: <1217016947.29012.76.camel@gargoyle> Content-Type: text/plain Date: Fri, 08 Aug 2008 15:18:00 -0000 Message-Id: <1218208649.24254.12.camel@gargoyle> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00201.txt.bz2 Ping? On Fri, 2008-07-25 at 17:15 -0300, Luis Machado wrote: > This patch adds the required support to dump VSX registers and read them > them back from a specific VSX notes section. This is in sync with the > format used by the Kernel. > > --- > 2008-07-25 Luis Machado > > * ppc-linux-tdep.c (ppc_linux_regset_sections): Add new ".reg-ppc-vsx" field. > (ppc32_linux_vsxregset): New 32-bit VSX-enabled regset. > (ppc_linux_regset_from_core_section): Handle VSX core section. > (ppc_linux_core_read_description): Support VSX-enabled core files. > > * corelow.c (get_core_register_section): Support VSX-enabled > core files. > > > Index: gdb/ppc-linux-tdep.c > =================================================================== > --- gdb.orig/ppc-linux-tdep.c 2008-07-23 09:28:09.000000000 -0700 > +++ gdb/ppc-linux-tdep.c 2008-07-23 09:31:44.000000000 -0700 > @@ -496,6 +496,7 @@ > { ".reg", 268 }, > { ".reg2", 264 }, > { ".reg-ppc-vmx", 544 }, > + { ".reg-ppc-vsx", 256 }, > { NULL, 0} > }; > > @@ -743,6 +744,13 @@ > NULL > }; > > +static const struct regset ppc32_linux_vsxregset = { > + &ppc32_linux_reg_offsets, > + ppc_supply_vsxregset, > + ppc_collect_vsxregset, > + NULL > +}; > + > const struct regset * > ppc_linux_gregset (int wordsize) > { > @@ -771,6 +779,8 @@ > return &ppc32_linux_fpregset; > if (strcmp (sect_name, ".reg-ppc-vmx") == 0) > return &ppc32_linux_vrregset; > + if (strcmp (sect_name, ".reg-ppc-vsx") == 0) > + return &ppc32_linux_vsxregset; > return NULL; > } > > @@ -974,6 +984,7 @@ > bfd *abfd) > { > asection *altivec = bfd_get_section_by_name (abfd, ".reg-ppc-vmx"); > + asection *vsx = bfd_get_section_by_name (abfd, ".reg-ppc-vsx"); > asection *section = bfd_get_section_by_name (abfd, ".reg"); > if (! section) > return NULL; > @@ -981,10 +992,20 @@ > switch (bfd_section_size (abfd, section)) > { > case 48 * 4: > - return altivec? tdesc_powerpc_altivec32l : tdesc_powerpc_32l; > + if (vsx) > + return tdesc_powerpc_vsx32l; > + else if (altivec) > + return tdesc_powerpc_altivec32l; > + else > + return tdesc_powerpc_32l; > > case 48 * 8: > - return altivec? tdesc_powerpc_altivec64l : tdesc_powerpc_64l; > + if (vsx) > + return tdesc_powerpc_vsx64l; > + else if (altivec) > + return tdesc_powerpc_altivec64l; > + else > + return tdesc_powerpc_64l; > > default: > return NULL; > Index: gdb/corelow.c > =================================================================== > --- gdb.orig/corelow.c 2008-07-23 09:28:09.000000000 -0700 > +++ gdb/corelow.c 2008-07-23 09:31:44.000000000 -0700 > @@ -499,6 +499,8 @@ > ".reg-xfp", 3, "extended floating-point", 0); > get_core_register_section (regcache, > ".reg-ppc-vmx", 3, "ppc Altivec", 0); > + get_core_register_section (regcache, > + ".reg-ppc-vsx", 4, "POWER7 VSX", 0); > > /* Supply dummy value for all registers not found in the core. */ > for (i = 0; i < gdbarch_num_regs (get_regcache_arch (regcache)); i++) > >