From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 080F03858C60; Mon, 6 Dec 2021 04:59:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 080F03858C60 From: "cjn at google dot com" To: gdb-prs@sourceware.org Subject: [Bug tdep/28653] New: "set arch armv7e-m" doesn't actually make gdb think it's connected to an m-profile target Date: Mon, 06 Dec 2021 04:59:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tdep X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cjn at google dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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, 06 Dec 2021 04:59:52 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28653 Bug ID: 28653 Summary: "set arch armv7e-m" doesn't actually make gdb think it's connected to an m-profile target Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: tdep Assignee: unassigned at sourceware dot org Reporter: cjn at google dot com Target Milestone: --- "arm_psr_thumb_bit" and "arm_pc_is_thumb" rely on the "is_m" flag being set inside "arm_gdbarch_init". That only can happen if an m-profile executable file is loaded or a complete target description is available, though. "arm_gdbarch_init" doesn't actually pay attention if explicitly told: "set archicecture armv7e-m" - the "is_m" = flag remains zero, and so software single stepping can be weird, and the register dumps show "cpsr" rather than the expected "xpsr". I added a print where the "tdep->is_m" flag is set near the end of "arm_gdbarch_init" and get this output: (gdb) set architecture armv7e-m arm_gdbarch_init:9293: is_m =3D 0 The target architecture is set to "armv7e-m". Setting the architecture indirectly via a "file" command, does work around = the problem: (gdb) show architecture The target architecture is set to "auto" (currently "i386"). (gdb) file example.elf arm_gdbarch_init:9293: is_m =3D 1 Reading symbols from example.elf... (gdb) show architecture The target architecture is set to "auto" (currently "armv7e-m"). There are other m-profile architectures available via "set architecture" th= at should also be fixed. --=20 You are receiving this mail because: You are on the CC list for the bug.=