This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: support biarch gcore?
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: uweigand at de dot ibm dot com
- Cc: jan dot kratochvil at redhat dot com, Jon dot Zhou at jdsu dot com, gdb at sourceware dot org
- Date: Tue, 6 Jul 2010 23:28:46 +0200 (CEST)
- Subject: Re: support biarch gcore?
- References: <201007062048.o66Kmixd002309@d12av02.megacenter.de.ibm.com>
> Date: Tue, 6 Jul 2010 22:48:44 +0200 (CEST)
> From: "Ulrich Weigand" <uweigand@de.ibm.com>
>
> 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.