This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PATCH: PR corefiles/11467: amd64 gdb generates corrupted 32bit core file
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: hjl dot tools at gmail dot com
- Cc: gdb-patches at sourceware dot org, jan dot kratochvil at redhat dot com
- Date: Sun, 11 Apr 2010 18:49:59 +0200 (CEST)
- Subject: Re: PATCH: PR corefiles/11467: amd64 gdb generates corrupted 32bit core file
- References: <20100410221943.GA9675@intel.com> <20100410222742.GA9901@intel.com>
> Date: Sat, 10 Apr 2010 15:27:42 -0700
> From: "H.J. Lu" <hongjiu.lu@intel.com>
>
> 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 H.J. Lu <hongjiu.lu@intel.com>
> >
> > PR corefiles/11467
> > * configure.in (CORE_HEADER): New. Set to hosts/x86-64linux.h
> > for x86_64-*-linux*.
> > * config.in: Regenerated.
> > * configure: Likewise.
> >
> > * elf.c: Include CORE_HEADER if it is defined.
> >
> > 2010-04-10 H.J. Lu <hongjiu.lu@intel.com>
> > Jan Kratochvil <jan.kratochvil@redhat.com>
> >
> > * 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. This should all be handled by -tdep.c code. The
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. I don't immediately see why, but that is
what you need to fix.