From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79211 invoked by alias); 2 Aug 2016 16:01:08 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 79198 invoked by uid 89); 2 Aug 2016 16:01:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=news X-HELO: mail-pf0-f193.google.com Received: from mail-pf0-f193.google.com (HELO mail-pf0-f193.google.com) (209.85.192.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 02 Aug 2016 16:00:57 +0000 Received: by mail-pf0-f193.google.com with SMTP id y134so12746475pfg.3 for ; Tue, 02 Aug 2016 09:00:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=EE6dDs0IF8L8D4I418Turw2+dewlZKzLswUMfP0Poy8=; b=nBgaxMEiTGllnSTQCP+i6sF9Abmq+sROjxKss0R1Dd5Te/NLWd+r97rr+lEFsgqaF2 8TyMUH1LQ0/jVqWKHcLUZ60wiHepjJIi/RwuT4PeY4+4ogwnC79A0fULs5WUZ1odiAPg RqTCqKosx01QD4wa/Q7WI4k7/wE30IDUpp2YTPI8C/o+O5CjMeIW09M2mv3qxO2ua711 fMIZq0jd6wmPrjHEFlE3CBWXgFl1C5IISgaFYrwFsOYpC5jlCAxR6mI0Wmr6L3yUNkSx xw66GdkYsYX9Iw8pMLfkz9MItdcqSeeK36l+iXgC5mpTkCO5/Nxel2eMHaMsUSTnerBr nU2w== X-Gm-Message-State: AEkooutKAmbrVAJ0fUWw7LDx0Lh9s2W70QY9mrKF1bo9xL4BLusxo90+XjnIUWEpKG6TPA== X-Received: by 10.98.71.91 with SMTP id u88mr107655882pfa.145.1470153655777; Tue, 02 Aug 2016 09:00:55 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id ps2sm5940475pab.10.2016.08.02.09.00.53 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 02 Aug 2016 09:00:55 -0700 (PDT) From: Yao Qi To: "Fredrik Hederstierna" Cc: gdb-patches@sourceware.org, Yao Qi Subject: Re: [PATCH] Fix exception unwinding for ARM Cortex-M References: <868twkekf1.fsf@gmail.com> Date: Tue, 02 Aug 2016 16:01:00 -0000 In-Reply-To: (Fredrik Hederstierna's message of "Tue, 2 Aug 2016 09:42:36 +0000") Message-ID: <864m73dutq.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-08/txt/msg00036.txt.bz2 "Fredrik Hederstierna" writes: Hi Fredrik, Thanks for splitting the patch. > diff --git a/gdb/ChangeLog b/gdb/ChangeLog > index 7820302..2c8573c 100644 > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -1,3 +1,7 @@ > +2016-08-02 Fredrik Hederstierna > + > + * arm-tdep.c: Fix EXC_RETURN values for ARMv6-M and ARMv7-M. > + ChangeLog entry should cover what do you change on the function level. Please read https://sourceware.org/gdb/wiki/ContributionChecklist > 2016-08-01 Joel Brobecker >=20=20 > * NEWS: Create a new section for the next release branch. > diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c > index d2661cb..43436df 100644 > --- a/gdb/arm-tdep.c > +++ b/gdb/arm-tdep.c > @@ -469,9 +469,11 @@ static CORE_ADDR > arm_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR val) > { > /* On M-profile devices, do not strip the low bit from EXC_RETURN > - (the magic exception return address). */ > + (the magic exception return address). > + According to B1.5.8 of both the ARMv6-M and ARMv7-M Reference Manua= ls > + the EXC_RETURN value is 0xF in Bits[31:28]. */ > if (gdbarch_tdep (gdbarch)->is_m > - && (val & 0xfffffff0) =3D=3D 0xfffffff0) > + && (val & 0xf0000000) =3D=3D 0xf0000000) Let us do the strict checking. In ARMv7-M manual, the pseudo code of=20 ExceptionReturn(bits(28) EXC_RETURN) has if HaveFPExt() then if !IsOnes(EXC_RETURN<27:5>) then UNPREDICTABLE; else if !IsOnes(EXC_RETURN<27:4>) then UNPREDICTABLE; so let's check "val" should be 0xFFFFFF{E,F}{1,9,D}, or use arm_m_pc_is_magic too, like, if (gdbarch_tdep (gdbarch)->is_m && arm_m_pc_is_magic (val)) return val; Do you have FSF copyright assignment? I don't find your record. You can fill in the form request-assign.future in https://sourceware.org/gdb/wiki/ContributionChecklist#FSF_copyright_Assignm= ent then, we can pick up your change. --=20 Yao (=E9=BD=90=E5=B0=A7)