public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/27891] maintenance selftest fail when an executable is loaded
Date: Mon, 13 Sep 2021 11:23:23 +0000	[thread overview]
Message-ID: <bug-27891-4717-gKncIqcsvv@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27891-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=27891

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #1)
>   if (current_program_space->exec_bfd () != NULL)
>     info->flags |= USER_SPECIFIED_MACHINE_TYPE;
> ...

This seems incorrect, given that exec arch can be different from the
disassembly arch.

This fixes that:
...
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index e4e7aec4e1c..ab6999ae209 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -7727,7 +7727,9 @@ gdb_print_insn_arm (bfd_vma memaddr, disassemble_info
*info)
      the assert on the mismatch of info->mach and
      bfd_get_mach (current_program_space->exec_bfd ()) in
      default_print_insn.  */
-  if (current_program_space->exec_bfd () != NULL)
+  if (current_program_space->exec_bfd () != NULL
+      && (current_program_space->exec_bfd ()->arch_info
+         == gdbarch_bfd_arch_info (gdbarch)))
     info->flags |= USER_SPECIFIED_MACHINE_TYPE;

   return default_print_insn (memaddr, info);
...
and consequently the unit test passes for me (not building with --all-targets
though) with and without exec.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-09-13 11:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-20 13:21 [Bug gdb/27891] New: " andrew.burgess at embecosm dot com
2021-09-13 10:32 ` [Bug gdb/27891] " vries at gcc dot gnu.org
2021-09-13 11:23 ` vries at gcc dot gnu.org [this message]
2021-09-13 12:14 ` luis.machado at linaro dot org
2021-09-13 19:43 ` vries at gcc dot gnu.org
2021-09-13 19:45 ` luis.machado at linaro dot org

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=bug-27891-4717-gKncIqcsvv@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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).