Re: HPPA multiarching plan

Jason R Thorpe
2002-11-26T01:47:15Z

On Mon, Nov 25, 2002 at 05:24:54PM -0800, Joel Brobecker wrote:

> My many thanks to Daniel and Jason for their very prompt and helpful
> answers!

We're glad to help :-)

> One little thing that still bothers (because I don't know yet how to
> properly handle this) is: some of the gdbarch methods will be different
> depending whether it is a pa64 or a pa32... Having 2 osabis was
> convenient that way. I see we have NETBSD_AOUT and NETBSD_ELF, perhaps
> it would still make sense to define 2 new osabis vis:
> - _HPUX_ELF
> - _HPUX_SOM

Actually, yah, having an HPUX_ELF and and HPUX_SOM probably makes
sense, because e.g. shared library handling will be different. (i.e.
you would want different osabi_init routines for each format, each
of which possibly calling a common one to do some common HPUX setup.)

> Otherwise, what I could do is maintain a local variable in the
> gdbarch_init routine, and set it depending on the object format...

Well.. for things which are purely "pa32 vs pa64" and having nothing
to do with the osabi per se, then you can determine this from info
in the BFD structure.

For things which are osabi-specific, the osabi_init routine for
that osabi will fill in the bits of the gdbarch/gdbarch_tdep structures.
Take a look at e.g. alphanbsd-tdep.c:alphanbsd_init_abi() (the osabi
init routine for Alpha with GDB_OSABI_NETBSD_ELF) and
alphanbsd-tdep.c:_initialize_alphanbsd_tdep() (which registers that osabi
init routine).

BTW, one thing that you're going to run into while doing this is
that the shared library support in GDB isn't really multarch'd. That
will have to be addressed in order for you to build a GDB which supports
both hppa+SOM and hppa64+Elf64.

--
-- Jason R. Thorpe <thorpej@wasabisystems.com>