This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch/rfc,rfa:ppc64] Add osabi wildcard support
- From: Kevin Buettner <kevinb at redhat dot com>
- To: Andrew Cagney <ac131313 at redhat dot com>, gdb-patches at sources dot redhat dot com
- Date: Tue, 28 Oct 2003 14:59:19 -0700
- Subject: Re: [patch/rfc,rfa:ppc64] Add osabi wildcard support
- References: <3F986371.9060708@redhat.com>
On Oct 23, 7:25pm, Andrew Cagney wrote:
> The attached patch adds the ability to specify a wildcard machine when
> registering an OSABI / arch / machine. It then updates PPC64 GNU/Linux
> to specify that wild card (-1) instead of zero as the default machine.
>
> Looking at the PPC64 GNU/Linux code:
>
> gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_LINUX,
> ppc_linux_init_abi);
>
> I believe that the call is attempting to register ppc_linux_init_abi as
> the OSABI handler for all arch/machine conbinations. The problem is
> that machine "0" gets turned into bfd_mach_ppc or bfd_mach_ppc64
> dependant on how GDB is built, and they are both incompatible with each
> other and incompatible . And that in turn restricts the support to just
> one half of the ISA family making it impossible for GDB to debug both 32
> and 64 bit :-(
>
> I know of two ways to fix this. First is the attached patch which
> modifies osabi.[hc] so that a wildcard machine (-1) can be specified vis:
>
> gdbarch_register_osabi (bfd_arch_powerpc, -1, GDB_OSABI_LINUX,
> ppc_linux_init_abi);
>
> and the second is to explicitly register both of these architecture
> variants vis:
>
> gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc, ...
> gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc64, ...
>
> (possibly also splitting ppc_linux_init_abi into ppc_linux_init_abi_32
> and ppc_linux_init_abi_32).
>
> There are pros and cons to both.
>
> The former will always match, making the code somewhat future proof, the
> later is far simplier.
>
> preferences?
At the moment, I prefer the explicit registration of architecture
variants. I'd prefer to wait on adding the wildcard mechanism until a
more compelling need for it is demonstrated.
Kevin