From: Daniel Jacobowitz <drow@false.org>
To: Michael Snyder <msnyder@redhat.com>
Cc: GDB Patches <gdb-patches@sources.redhat.com>, mark.kettenis@xs4all.nl
Subject: Re: [RFA] Take III, part 2: am33 linux corefile support
Date: Tue, 28 Jun 2005 01:43:00 -0000 [thread overview]
Message-ID: <20050628014317.GA6950@nevyn.them.org> (raw)
In-Reply-To: <42C09C74.1010507@redhat.com>
On Mon, Jun 27, 2005 at 05:40:20PM -0700, Michael Snyder wrote:
> OK, here's this part again. Mark, I used the osabi mechanism
> to register my corefile handlers, and I changed the typedefs
> from unsigned char to gdb_byte.
Could you explain why you needed a sniffer?
> + /* "Sniff" a bfd, claim it if it's ours.
> + It's ours if it's am33 flavor. */
> +
> + static enum gdb_osabi
> + am33_linux_elf_osabi_sniffer (bfd *abfd)
> + {
> + const struct bfd_arch_info *info = bfd_get_arch_info (abfd);
> + int eflags = elf_elfheader (abfd) -> e_flags;
> + /* We'll want to have a look at those, anyway... */
> +
> + if (info->arch == bfd_arch_mn10300)
> + if (info->mach == bfd_mach_am33 || info->mach == bfd_mach_am33_2)
> + if (eflags & (E_MN10300_MACH_AM33 | E_MN10300_MACH_AM33_2)
> + return GDB_OSABI_LINUX;
> +
> + return GDB_OSABI_UNKNOWN;
> + }
i.e. what's this covering that the generic sniffer won't. I can work
out the answer to the question in terms of ELF header flags, but I
assume you've got .note.ABI-tag like other Linux ports do.
> + void
> + _initialize_mn10300_linux_tdep (void)
> + {
> + gdbarch_register_osabi (bfd_arch_mn10300, 0,
> + GDB_OSABI_LINUX, am33_linux_init_osabi);
> + gdbarch_register_osabi_sniffer (bfd_arch_mn10300,
> + bfd_target_elf_flavour,
> + am33_linux_elf_osabi_sniffer);
> + }
If it's just to handle the am33 vs mn10300, you can use bfd_mach_am33
and bfd_mach_am33_2 as the second argument to gdbarch_register_osabi.
Otherwise I've no complaints.
--
Daniel Jacobowitz
CodeSourcery, LLC
next prev parent reply other threads:[~2005-06-28 1:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-28 0:41 Michael Snyder
2005-06-28 1:43 ` Daniel Jacobowitz [this message]
2005-06-29 2:14 ` Michael Snyder
2005-06-29 2:16 ` Daniel Jacobowitz
2005-06-28 21:08 ` Mark Kettenis
2005-09-02 23:02 ` Kevin Buettner
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=20050628014317.GA6950@nevyn.them.org \
--to=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
--cc=mark.kettenis@xs4all.nl \
--cc=msnyder@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