Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jason R Thorpe <thorpej@wasabisystems.com>
To: Joel Brobecker <brobecker@gnat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: HPPA multiarching plan
Date: Mon, 25 Nov 2002 17:04:00 -0000	[thread overview]
Message-ID: <20021126010438.GD21009@yeah-baby.shagadelic.org> (raw)
In-Reply-To: <20021126004857.GB23000@gnat.com>

On Mon, Nov 25, 2002 at 04:48:57PM -0800, Joel Brobecker wrote:

 >   - Add 2 new OSABI enums: HPPA_HPUX and HPPA64_HPUX.
 >     (it seems important to me to keep the OS name in the enum, to
 >     differentiate with HPPA_LINUX for instance)

You should not need the processor name in the OSABI ("embedded ABIs"
are kind of a special case, which is why you see the processor name
in those).  You also should not need the "64" .. I would guess that
would be differentiated based on the object file format (SOM [32] vs.
Elf32 vs. Elf64 -- assuming hppa64 binaries use the Elf64 format; I'm
not sure that they do, please educate me :-).

So, I think you only need GDB_OSABI_HPUX.

 >   - The sniffer would then guess the correct value based like so:
 > 
 >     1. If object format is ELF
 >        -> OSABI = HPPA64_HPUX
 > 
 >     2. If object format is SOM
 >        -> OSABI = HPPA_HPUX

I don't think you actually need a sniffer, either.  Take a look at
alpha-tdep.c:alpha_gdbarch_init().  It uses the following algorithm:

	* Lookup osabi.
	* If osabi is unknown:
	  * If file is ECOFF, assume GDB_OSABI_OSF1.

So, I would say that you could use the following algorithm for
HPPA:

	* Lookup osabi.
	* If osabi is unknown:
	  * If file is SOM or ELF, assume GDB_OSABI_HPUX.

You should also add an HPUX case to osabi.c:generic_elf_osabi_sniffer(),
since there is an ELFOSABI constant for HPUX.

I think between the change to generic_elf_osabi_sniffer(), and the
proper smarts in your hppa_gdbarch_init() function, you can avoid having
to add an osabi sniffer.

 >     Later on, when we want to add support for hppa-linux, the sniffer will
 >     need to be refined. I assume hppa-linux uses ELF? In which case we
 >     will probably have to dig into the ELF header to search for the clue
 >     that will reveal either hpux or linux.

The existing sniffers will already work with Linux (and eventually
hppa-netbsd, as well), since Linux and NetBSD binaries already carry
distinguishing markings that are recognized by the existing generic
sniffer.

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


  parent reply	other threads:[~2002-11-26  1:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-25 16:48 Joel Brobecker
2002-11-25 16:58 ` Daniel Jacobowitz
2002-11-25 17:04 ` Jason R Thorpe [this message]
2002-11-25 17:24   ` Joel Brobecker
2002-11-25 17:47     ` Jason R Thorpe
2002-11-26  7:26   ` Andrew Cagney
2002-11-26  7:56     ` Jason R Thorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021126010438.GD21009@yeah-baby.shagadelic.org \
    --to=thorpej@wasabisystems.com \
    --cc=brobecker@gnat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox