From patchwork Tue Aug 19 13:12:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 2434 Received: (qmail 26500 invoked by alias); 19 Aug 2014 13:16:56 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 26482 invoked by uid 89); 19 Aug 2014 13:16:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Aug 2014 13:16:52 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1XJjHN-00033o-7z from Yao_Qi@mentor.com ; Tue, 19 Aug 2014 06:16:49 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 19 Aug 2014 06:16:49 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.2.247.3; Tue, 19 Aug 2014 06:16:48 -0700 Message-ID: <53F34D56.5050705@codesourcery.com> Date: Tue, 19 Aug 2014 21:12:54 +0800 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: Will Newton CC: "gdb-patches@sourceware.org" Subject: Re: [PATCH] Support _Complex in hard-VFP abi References: <1407761487-9251-1-git-send-email-yao@codesourcery.com> In-Reply-To: X-IsSubscribed: yes On 08/11/2014 09:12 PM, Will Newton wrote: >> - array). Vectors and complex types are not currently supported, >> > - matching the generic AAPCS support. */ >> > + array). Vectors types are not currently supported, matching the > This should be "Vector types". > Fixed. >> > + generic AAPCS support. */ >> > >> > static int >> > arm_vfp_cprc_sub_candidate (struct type *t, >> > @@ -3589,6 +3589,36 @@ arm_vfp_cprc_sub_candidate (struct type *t, >> > } >> > break; >> > >> > + case TYPE_CODE_COMPLEX: >> > + /* Arguments of complex T where T is one of the types float or >> > + double get treated as if they are implemented as: >> > + >> > + struct complexT >> > + { >> > + T real; >> > + T imag; >> > + };*/ > A line break before closing the comment might look nicer here. > I add two spaces before closing the comment, because we don't move "*/" to a separated line. Patch was approved by Joel, and is pushed in. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7c3c582..8789fe8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-08-19 Yao Qi + + * arm-tdep.c (arm_vfp_cprc_sub_candidate): Handle _Complex + types. + 2014-08-19 Alan Modra * acinclude.m4 (GDB_AC_CHECK_BFD): Don't add -ldl. diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index b6ec456..2e2d6fd 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3557,8 +3557,8 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc_base_type b) classified from *BASE_TYPE, or two types differently classified from each other, return -1, otherwise return the total number of base-type elements found (possibly 0 in an empty structure or - array). Vectors and complex types are not currently supported, - matching the generic AAPCS support. */ + array). Vector types are not currently supported, matching the + generic AAPCS support. */ static int arm_vfp_cprc_sub_candidate (struct type *t, @@ -3589,6 +3589,36 @@ arm_vfp_cprc_sub_candidate (struct type *t, } break; + case TYPE_CODE_COMPLEX: + /* Arguments of complex T where T is one of the types float or + double get treated as if they are implemented as: + + struct complexT + { + T real; + T imag; + }; */ + switch (TYPE_LENGTH (t)) + { + case 8: + if (*base_type == VFP_CPRC_UNKNOWN) + *base_type = VFP_CPRC_SINGLE; + else if (*base_type != VFP_CPRC_SINGLE) + return -1; + return 2; + + case 16: + if (*base_type == VFP_CPRC_UNKNOWN) + *base_type = VFP_CPRC_DOUBLE; + else if (*base_type != VFP_CPRC_DOUBLE) + return -1; + return 2; + + default: + return -1; + } + break; + case TYPE_CODE_ARRAY: { int count;