This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [Patch] arch recognition fix for osabi.c
- From: "Kris Warkentin" <kewarken at qnx dot com>
- To: "Daniel Jacobowitz" <drow at mvista dot com>
- Cc: "Gdb-Patches at Sources dot Redhat dot Com" <gdb-patches at sources dot redhat dot com>
- Date: Tue, 17 Jun 2003 12:04:32 -0400
- Subject: Re: [Patch] arch recognition fix for osabi.c
- References: <08c201c334e6$ccb8c750$0202040a@catdog> <20030617155147.GA25280@nevyn.them.org>
> > Changelog:
> > * osabi.c (gdbarch_init_osabi): Just check arch for compatability
rather
> > identicality.
>
> Your mailer is eating indentation again...
Yeah. It's fine in the editor - it's the cut and paste to Outlook that
buggers it.
> This half I'm not convinced by. From our previous exchange I don't
> think you've fully justified it. Not approved without more discussion.
Okay. Let's use mips as an example. The 'compatible' check returns true if
they have the same arch (ie. bfd_arch_mips). There will be many different
values for the arch_info pointer, all with bfd_arch_mips and various other
pieces of info such as which machine type (10k, 4300, etc.) of mips it is.
The handler was registered for bfd_arch_mips with no other information. In
the absence of the ABILITY to do anything smarter, we have to assume that if
the handler is for bfd_arch_mips, it should be run.
As it stands, if the bfd reads a file and says 'this is a tx3900' or some
such, the pointers won't be the same and my backend init_abi won't be run
even though I want it to run for all mips targets.
> > (generic_elf_osabi_sniff_abi_tag_sections): Add check for QNX
Neutrino
> > binaries.
>
> This bit looks fine, except for two things: you've missed the coding
> standards by four space characters (before left parens), and your
> "safety first" check overruns the buffer (missing +1 in the alloca).
Doh! Not very safe was it? Sorry about that. Fixed.
cheers,
Kris