From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31014 invoked by alias); 6 Jul 2010 21:29:20 -0000 Received: (qmail 31006 invoked by uid 22791); 6 Jul 2010 21:29:18 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Jul 2010 21:29:10 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id o66LSms1010965; Tue, 6 Jul 2010 23:28:48 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id o66LSkNC032580; Tue, 6 Jul 2010 23:28:46 +0200 (CEST) Date: Tue, 06 Jul 2010 21:29:00 -0000 Message-Id: <201007062128.o66LSkNC032580@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: uweigand@de.ibm.com CC: jan.kratochvil@redhat.com, Jon.Zhou@jdsu.com, gdb@sourceware.org In-reply-to: <201007062048.o66Kmixd002309@d12av02.megacenter.de.ibm.com> (uweigand@de.ibm.com) Subject: Re: support biarch gcore? References: <201007062048.o66Kmixd002309@d12av02.megacenter.de.ibm.com> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-07/txt/msg00019.txt.bz2 > Date: Tue, 6 Jul 2010 22:48:44 +0200 (CEST) > From: "Ulrich Weigand" > > Mark Kettenis wrote: > > > Fixing the code in linux-nat.c is a bit nasty: > > > > * The definition of the 32-bit version of gdb_gregset_t isn't readily > > available on 64-bit systems. > > > > * The code is used on all Linux platforms and only a few of them are > > bi-arch. > > This was really supposed to be fixed by the gdbarch_core_regset_sections > mechanism, which provides the names and sizes of all register sets > expected in a core file for the current architecture. > > However, it seems that this mechanism isn't currently used for .reg > itself, only for the other sections. While it is true that .reg needs > to be handled somewhat specially, it should still be possible to get > its size from gdbarch_core_regset_sections, and thus avoid the need > to use the gdb_gregset_t type. > > Unfortunately, it also turned out that the section sizes provided for > .reg in those targets that have gdbarch_core_regset_sections, while > currently unused, were also nearly all wrong ... > > The following patch fixes those sizes, and changes linux-nat.c to > use them. > > Tested on powerpc64-linux (-m64 / -m32), amd64-linux (-m64 / -m32), > and i386-linux with no regressions. In fact, it appears to fix all > pre-existing gcore-related failures on amd64 -m32 ... > > Thoughts? Although I don't feel qualified to judge the powerpc bits, this makes quite a bit of sense to me. And yes, the value for amd64-linux is obviously wrong.