This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Handle loading improper core files gracefully in the mips backend.
- From: Pedro Alves <palves at redhat dot com>
- To: Luis Machado <lgustavo at codesourcery dot com>, "Maciej W. Rozycki" <macro at imgtec dot com>
- Cc: gdb-patches at sourceware dot org, jan dot kratochvil at redhat dot com
- Date: Tue, 12 Jan 2016 12:46:52 +0000
- Subject: Re: [PATCH] Handle loading improper core files gracefully in the mips backend.
- Authentication-results: sourceware.org; auth=none
- References: <1452277948-25292-1-git-send-email-lgustavo at codesourcery dot com> <alpine dot DEB dot 2 dot 00 dot 1601090245560 dot 5958 at tp dot orcam dot me dot uk> <5693CE90 dot 1060709 at codesourcery dot com>
On 01/11/2016 03:47 PM, Luis Machado wrote:
> diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
> index ca17864..cdfd80e 100644
> --- a/gdb/mips-tdep.c
> +++ b/gdb/mips-tdep.c
> @@ -8208,6 +8208,12 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
> int dspacc;
> int dspctl;
>
> + /* Sanity check the e_machine field. */
> + if (info.abfd
> + && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour
> + && elf_elfheader (info.abfd)->e_machine != EM_MIPS)
> + return NULL;
This callback is registered for bfd_arch_mips:
gdbarch_register (bfd_arch_mips, mips_gdbarch_init, mips_dump_tdep);
Does bfd think this a bfd_arch_mips binary? How so?
Thanks,
Pedro Alves