From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5475 invoked by alias); 11 Apr 2010 17:33:08 -0000 Received: (qmail 5466 invoked by uid 22791); 11 Apr 2010 17:33:08 -0000 X-SWARE-Spam-Status: No, hits=2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SARE_MSGID_LONG45,URIBL_BLACK X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 11 Apr 2010 17:33:04 +0000 Received: by vws15 with SMTP id 15so1107729vws.0 for ; Sun, 11 Apr 2010 10:33:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.44.198 with HTTP; Sun, 11 Apr 2010 10:33:02 -0700 (PDT) In-Reply-To: <201004111649.o3BGnx9J015256@glazunov.sibelius.xs4all.nl> References: <20100410221943.GA9675@intel.com> <20100410222742.GA9901@intel.com> <201004111649.o3BGnx9J015256@glazunov.sibelius.xs4all.nl> Date: Sun, 11 Apr 2010 17:33:00 -0000 Received: by 10.220.125.41 with SMTP id w41mr1383304vcr.200.1271007182611; Sun, 11 Apr 2010 10:33:02 -0700 (PDT) Message-ID: Subject: Re: PATCH: PR corefiles/11467: amd64 gdb generates corrupted 32bit core file From: "H.J. Lu" To: Mark Kettenis Cc: gdb-patches@sourceware.org, jan.kratochvil@redhat.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2010-04/txt/msg00332.txt.bz2 On Sun, Apr 11, 2010 at 9:49 AM, Mark Kettenis wr= ote: >> Date: Sat, 10 Apr 2010 15:27:42 -0700 >> From: "H.J. Lu" >> >> On Sat, Apr 10, 2010 at 03:19:43PM -0700, H.J. Lu wrote: >> > Hi, >> > >> > I am checking in this patch to support 32bit core note sections on >> > Linux/x86-64. I will submit a separate gdb patch. >> > >> > >> > H.J. >> > --- >> > 2010-04-10 =A0H.J. Lu =A0 >> > >> > =A0 =A0 PR corefiles/11467 >> > =A0 =A0 * configure.in (CORE_HEADER): New. Set to hosts/x86-64linux.h >> > =A0 =A0 for x86_64-*-linux*. >> > =A0 =A0 * config.in: Regenerated. >> > =A0 =A0 * configure: Likewise. >> > >> > =A0 =A0 * elf.c: Include CORE_HEADER if it is defined. >> > >> > 2010-04-10 =A0H.J. Lu =A0 >> > =A0 =A0 =A0 =A0 Jan Kratochvil =A0 >> > >> > =A0 =A0 * hosts/x86-64linux.h: New. >> >> Hi, >> >> Hi, >> >> Here is the gdb patch to properly generate 32bit coredumps on >> Linux/x86-64. The key here is to use the right register offset >> for gcore. OK to install? > > No, this is wrong. =A0This should all be handled by -tdep.c code. =A0The > gcore code in linux-nat.c nly falls back on the fetch_gregset() if for > some reason the gdbarch_regset_from_core_section() function doesn't > return a valid register set. =A0I don't immediately see why, but that is > what you need to fix. > I will prepare a patch. I will move codes from i386-linux-nat.c to i386-linux-tdep.c. I will add i386_linux_regset_from_core_section and call set_gdbarch_regset_from_core_section (gdbarch, i386_linux_regset_from_core_section); in i386_linux_init_abi. i386_linux_regset_from_core_section will call fill_gregset originally in i386-linux-nat.c. Thanks. --=20 H.J.