Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: gdb-patches@sourceware.org, Tom Tromey <tromey@adacore.com>
Subject: Re: [PATCH] Fix m68k OS ABI sniffer
Date: Sun, 18 Aug 2024 10:17:09 -0700	[thread overview]
Message-ID: <20240818101709.27e020dc@f40-zbm-amd> (raw)
In-Reply-To: <871q2r6o9v.fsf@igel.home>

On Wed, 14 Aug 2024 18:51:40 +0200
Andreas Schwab <schwab@linux-m68k.org> wrote:

> Do not override the generic OS ABI sniffer.
> 
> Fixes: 3eba3a011a8 ("Various m68k fixes for gdb")
> ---
>  gdb/m68k-tdep.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
> index 439ebd241e8..0d268aa947b 100644
> --- a/gdb/m68k-tdep.c
> +++ b/gdb/m68k-tdep.c
> @@ -1353,11 +1353,19 @@ static enum gdb_osabi
>  m68k_osabi_sniffer (bfd *abfd)
>  {
>    unsigned int elfosabi = elf_elfheader (abfd)->e_ident[EI_OSABI];
> +  enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;
>  
>    if (elfosabi == ELFOSABI_NONE)
> -    return GDB_OSABI_SVR4;
> +    {
> +      /* Check note sections.  */
> +      for (asection *sect : gdb_bfd_sections (abfd))
> +	generic_elf_osabi_sniff_abi_tag_sections (abfd, sect, &osabi);
> +
> +      if (osabi == GDB_OSABI_UNKNOWN)
> +	osabi = GDB_OSABI_SVR4;
> +    }
>  
> -  return GDB_OSABI_UNKNOWN;
> +  return osabi;
>  }

LGTM.

Reviewed-by: Kevin Buettner <kevinb@redhat.com>


      reply	other threads:[~2024-08-18 17:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-14 16:51 Andreas Schwab
2024-08-18 17:17 ` Kevin Buettner [this message]

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=20240818101709.27e020dc@f40-zbm-amd \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=schwab@linux-m68k.org \
    --cc=tromey@adacore.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