This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/3] Implement new Linux target vectors on BFD
- From: Pedro Alves <palves at redhat dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: Binutils Development <binutils at sourceware dot org>, GDB Patches <gdb-patches at sourceware dot org>, Jan Kratochvil <jan dot kratochvil at redhat dot com>, "H. J. Lu" <hongjiu dot lu at intel dot com>
- Date: Thu, 31 Jan 2013 17:19:31 +0000
- Subject: Re: [PATCH 1/3] Implement new Linux target vectors on BFD
- References: <m3d2wnyxfl.fsf@redhat.com> <20130130091631.GM3244@bubble.grove.modra.org> <m3vcaey63y.fsf@redhat.com>
On 01/30/2013 04:42 PM, Sergio Durigan Junior wrote:
> On Wednesday, January 30 2013, Alan Modra wrote:
>> Duplicating targets isn't a really good idea.
> Hm, thank you for the explanation, it didn't occurred to me.
Indeed. Thanks.
>> You may have noticed that we've already made a mess of targets for
>> ARM, i386, x86_64 and powerpc. I'd rather not see the same happen for
>> powerpc64 without a really good reason.
>
> Right. Now I am stuck with this, then. While Pedro wants this feature
> to be Linux-specific, now there is this problem with target
> duplication.
It's not about what I want. It's about the fact that different
targets/OSs have different prpsinfo etc. structures.
> I will look for other solutions here, but if you alreay have some idea
> on how to handle it, I'd be glad to read.
My idea is to cut the middle man. AFAICS, only GDB wants to generate
core files presently. GDB has a whole OS/arch sniffer mechanism in
place, where we know which target/arch/OS it is that is being
debugged. So rather than having bfd know which prpsinfo layout we
want, and shoehorn different elf_internal_prpsinfo & friends
structures through the elfcore_write_note/va_args generic interface,
skip the bfd vector, and add new entry points in bfd for each possible
output, and have GDB pick the one it needs. Since most Linux archs
have the same prpsinfo32 and prpsinfo64 layout, we just put the
default Linux implementations in elf.c. PPC32, being the odd one out,
gets its own implementation. I'll send updated bfd and gdb patches
as response to this email.
--
Pedro Alves