From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30320 invoked by alias); 26 Nov 2007 16:09:42 -0000 Received: (qmail 30303 invoked by uid 22791); 26 Nov 2007 16:09:41 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate5.de.ibm.com (HELO mtagate5.de.ibm.com) (195.212.29.154) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 26 Nov 2007 16:09:31 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.13.8/8.13.8) with ESMTP id lAQG9SUr183498 for ; Mon, 26 Nov 2007 16:09:28 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 lAQG9S5E2830484 for ; Mon, 26 Nov 2007 17:09:28 +0100 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 lAQG9S2l005995 for ; Mon, 26 Nov 2007 17:09:28 +0100 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 lAQG9S5c005991; Mon, 26 Nov 2007 17:09:28 +0100 Message-Id: <200711261609.lAQG9S5c005991@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 26 Nov 2007 17:09:28 +0100 Subject: Re: [RFC] Add support for PPC Altivec registers in gcore To: cseo@linux.vnet.ibm.com (Carlos Eduardo Seo) Date: Mon, 26 Nov 2007 16:09:00 -0000 From: "Ulrich Weigand" Cc: Ulrich.Weigand@de.ibm.com (Ulrich Weigand), gdb-patches@sourceware.org (GDB Patches Mailing List) In-Reply-To: <4748FF40.9080409@linux.vnet.ibm.com> from "Carlos Eduardo Seo" at Nov 25, 2007 02:51:12 AM 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: 2007-11/txt/msg00488.txt.bz2 Carlos Eduardo Seo wrote: > Ulrich Weigand wrote: > > > > Carlos Eduardo Seo wrote on 11/06/2007 > > 02:42:43 PM: > > > > > I was taking a look at gdbarch.sh. Where's the "right" place to put > > > the register list? > > > > In "function_list". If you want to add a new data symbol, you'll > > need type "v". Best place is probably after regset_from_core_section. > Do you think it's better to initialize this new structure with the > registers names in gdbarch.c, or have it initialized in each > arch-tdep.c file with the supported registers for that arch? Maybe there is some misunderstanding: I was not talking about a list of *register names*, rather a set of core file *section names*. I'd suggest to define a data structure along the lines of: struct core_regset_section { const char *name; int len; }; and then define arrays of those in the -tdep.c files, like: static struct core_regset_section ppc_regset_sections[] = { { ".reg", ... }, { ".reg2", ... }, { ".reg-vmx", ... }, { NULL, 0 } }; In gdbarch.sh, you'd then add an entry like: v:struct core_regset_section *:core_regset_sections which would generate functions gdbarch_core_regset_sections and gdbarch_set_core_regset_sections In the -tdep.c file, you'd now be able to install the array defined above: gdbarch_set_core_regset_sections (gdbarch, ppc_regset_sections); and in linux-nat.c, you'd be able to call gdbarch_core_regset_sections to get at that list. For platforms that do not override that gdbarch routine, you can fall back to a default along the lines of struct default_regset_sections[] = { { ".reg", sizeof (gdb_gregset_t) }, { ".reg2", sizeof (gdb_fpregset_t) }, { NULL, 0 } }; Does this make sense? Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com