From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ADD4E385AC3B; Mon, 12 Sep 2022 09:32:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADD4E385AC3B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662975126; bh=4dB4aSJH8F8OvIAoYabta3b/hmtikLGm4iVZzmavPnA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pZuD5D6aDqClBONzlEhnr0OUAH1WkLKlFsrsMaSAMlb2nxv5F3jmnzeeCgnxHv3AU NbeZX9sMvp2GuQ0b7axWkD5AcIBamgJs4wm9yqXfbnUrF5US9GRPOK5flbheyY9uf1 qpbqubAu5GWmJxgTSU5Bxl2QW874vcQV7hqHLm+U= From: "luis.machado at arm dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/28549] ARM/Cortex-M: improper stack unwinding when the target is in lockup state Date: Mon, 12 Sep 2022 09:32:04 +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: 9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: luis.machado at arm dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: luis.machado at arm dot com 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D28549 --- Comment #41 from Luis Machado --- Hi Tomas, You can refer to https://sourceware.org/gdb/wiki/ContributionChecklist for = some information on how to contribute. You'll need a FSF copyright assignment in place to be able to contribute non-trivial changes. Do you have one? As for the change, here's what git shows for that commit: @@ -695,28 +730,43 @@ arm_pc_is_thumb (struct gdbarch *gdbarch, CORE_ADDR memaddr) 0xFFFFFFBC Return to Thread mode using the process stack. */ static int -arm_m_addr_is_magic (CORE_ADDR addr) -{ - switch (addr) - { - /* Values from ARMv8-M Architecture Technical Reference. */ - case 0xffffffb0: - case 0xffffffb8: - case 0xffffffbc: - /* Values from Tables in B1.5.8 the EXC_RETURN definitions of - the exception return behavior. */ - case 0xffffffe1: - case 0xffffffe9: - case 0xffffffed: - case 0xfffffff1: - case 0xfffffff9: - case 0xfffffffd: - /* Address is magic. */ - return 1; +arm_m_addr_is_magic (struct gdbarch *gdbarch, CORE_ADDR addr) +{ + arm_gdbarch_tdep *tdep =3D (arm_gdbarch_tdep *) gdbarch_tdep (gdbarch); + if (tdep->have_sec_ext) + { + switch ((addr & 0xff000000)) + { + case 0xff000000: /* EXC_RETURN pattern. */ + case 0xfe000000: /* FNC_RETURN pattern. */ + return 1; + default: + return 0; + } + } + else + { + switch (addr) + { + /* Values from ARMv8-M Architecture Technical Reference. */ + case 0xffffffb0: + case 0xffffffb8: + case 0xffffffbc: + /* Values from Tables in B1.5.8 the EXC_RETURN definitions of + the exception return behavior. */ + case 0xffffffe1: + case 0xffffffe9: + case 0xffffffed: + case 0xfffffff1: + case 0xfffffff9: + case 0xfffffffd: + /* Address is magic. */ + return 1; - default: - /* Address is not magic. */ - return 0; + default: + /* Address is not magic. */ + return 0; + } } } --=20 You are receiving this mail because: You are on the CC list for the bug.=