public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Luis Machado <lgustavo@codesourcery.com>,
	       "Maciej W. Rozycki" <macro@imgtec.com>
Cc: gdb-patches@sourceware.org, jan.kratochvil@redhat.com
Subject: Re: [PATCH] Handle loading improper core files gracefully in the mips backend.
Date: Tue, 12 Jan 2016 12:46:00 -0000	[thread overview]
Message-ID: <5694F5BC.3050904@redhat.com> (raw)
In-Reply-To: <5693CE90.1060709@codesourcery.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

  reply	other threads:[~2016-01-12 12:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08 18:32 Luis Machado
2016-01-09  3:02 ` Maciej W. Rozycki
2016-01-11 15:47   ` Luis Machado
2016-01-12 12:46     ` Pedro Alves [this message]
2016-01-12 13:25       ` Luis Machado
2016-01-12 14:10         ` Pedro Alves
2016-01-12 15:43           ` Luis Machado
2016-01-12 16:00             ` Pedro Alves
2016-01-12 18:30             ` Maciej W. Rozycki
2016-01-12 19:08               ` Pedro Alves
2016-02-02 12:58               ` Luis Machado
2016-02-02 14:19                 ` Pedro Alves
2016-02-02 14:22                   ` Pedro Alves
2016-02-04 21:01                     ` Maciej W. Rozycki
2016-02-05 11:29                       ` Luis Machado
2016-02-05 14:10                         ` Maciej W. Rozycki
2017-01-09 19:57               ` Luis Machado
2017-01-19 16:56                 ` Pedro Alves
2017-01-19 17:05                   ` Luis Machado

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=5694F5BC.3050904@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=lgustavo@codesourcery.com \
    --cc=macro@imgtec.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).