From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10753 invoked by alias); 21 May 2008 15:26:14 -0000 Received: (qmail 10745 invoked by uid 22791); 21 May 2008 15:26:13 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate4.de.ibm.com (HELO mtagate4.de.ibm.com) (195.212.29.153) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 21 May 2008 15:25:47 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.13.8/8.13.8) with ESMTP id m4LFPiqE200030 for ; Wed, 21 May 2008 15:25:44 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m4LFPix83190824 for ; Wed, 21 May 2008 17:25:44 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m4LFPhXD018411 for ; Wed, 21 May 2008 17:25:44 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id m4LFPhuB018406; Wed, 21 May 2008 17:25:43 +0200 Message-Id: <200805211525.m4LFPhuB018406@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 21 May 2008 17:25:43 +0200 Subject: Re: [RFC] Add support for PPC Altivec registers in gcore To: cseo@linux.vnet.ibm.com (Carlos Eduardo Seo) Date: Wed, 21 May 2008 18:46:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org (GDB Patches Mailing List) In-Reply-To: <48330475.1070102@linux.vnet.ibm.com> from "Carlos Eduardo Seo" at May 20, 2008 02:03:49 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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-05/txt/msg00637.txt.bz2 Carlos Eduardo Seo wrote: > Here are the patches revised. Testsuite runs show no regressions in ppc > and i386. Thanks for making those changes. > 2008-05-14 Carlos Eduardo Seo > > * gdbarch.sh: Added new gdbarch struct > core_regset_sections. > * gdbarch.c: Refreshed. > * gdbarch.h: Refreshed. > * regset.h (core_regset_section): Declared. > * linux-nat.c (linux_nat_do_thread_registers): Added > support to the new gdbarch struct core_regset_sections. This should read "Added support for ...", not "to ...". > + /* The loop below uses the new struct core_regset_section, which stores > + the supported section names and sizes for the core file. Note that Two spaces after '.' here as well, please. > + note PRSTATUS needs to be treated specially. But the other notes are > + structurally the same, so they can benefit from the new struct. */ > + if (core_regset_p && sect_list != NULL) > + while (sect_list->sect_name != NULL) > + { > + /* .reg was already handled above. */ > + if (strcmp (sect_list->sect_name, ".reg") == 0) > + { > + sect_list++; > + continue; > + } > + regset = gdbarch_regset_from_core_section (gdbarch, > + sect_list->sect_name, > + sect_list->size); Please add an assertion gdb_assert (regset && regset->collect_regset) here, so we don't just crash on the call below if a gdbarch doesn't provide those functions as it should ... > + gdb_regset = xmalloc (sect_list->size); > + regset->collect_regset (regset, regcache, -1, > + gdb_regset, sect_list->size); > + note_data = (char *) elfcore_write_register_note (obfd, > + note_data, > + note_size, > + sect_list->sect_name, > + gdb_regset, > + sect_list->size); > + xfree (gdb_regset); > + sect_list++; > + } > + > + /* For architectures that does not have the struct core_regset_section > + implemented, we use the old method. When all the architectures have Two spaces after '.'. With these final changes, the patch is OK. Thanks, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com