From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5C4FE3858003; Mon, 13 Sep 2021 11:23:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C4FE3858003 From: "vries at gcc dot gnu.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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 11:23:23 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27891 --- Comment #2 from Tom de Vries --- (In reply to Tom de Vries from comment #1) > if (current_program_space->exec_bfd () !=3D NULL) > info->flags |=3D 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 () !=3D NULL) + if (current_program_space->exec_bfd () !=3D NULL + && (current_program_space->exec_bfd ()->arch_info + =3D=3D gdbarch_bfd_arch_info (gdbarch))) info->flags |=3D USER_SPECIFIED_MACHINE_TYPE; return default_print_insn (memaddr, info); ... and consequently the unit test passes for me (not building with --all-targe= ts though) with and without exec. --=20 You are receiving this mail because: You are on the CC list for the bug.=