From patchwork Wed Jul 6 07:24:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 13665 Received: (qmail 83007 invoked by alias); 6 Jul 2016 07:24:37 -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 82995 invoked by uid 89); 6 Jul 2016 07:24:36 -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=2016-07-06 X-HELO: mail-pf0-f196.google.com Received: from mail-pf0-f196.google.com (HELO mail-pf0-f196.google.com) (209.85.192.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 06 Jul 2016 07:24:26 +0000 Received: by mail-pf0-f196.google.com with SMTP id c74so21154524pfb.0 for ; Wed, 06 Jul 2016 00:24:25 -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:subject:date:message-id; bh=W8+ie41PoifqurMOpjpGvMe5OuEtRWB/Sv+KF5RQ++8=; b=ipc3hViyJAxEN+8O1NytpIhAWFeybOneoZpHnBTsZoX7RybO+vvIg696b7iteth7/p I7FPX6dgi5GJE5sgcGzRYm9ZJL2LzmU6B8hHGOtm7h6//MgyypAIpYcplHSUqmudziIJ drZ78fpZq2GRK3Zp5DHgMnQueQUbteXZSDddCsGBfGnld9htJtq0m7vUcI8f/0ClbS2Q 4awKKL8KbzDPDzA++f5QtHdCZ20eJtSw2sMSNAxraecZRoo7ISOCj323uIzsKLFUEcX9 94g/mq8PbeDaBPlBjp7MEyh6PbHk6VpYN8fJ60yb6sSrXmIxdFlhfDLUjc+bTUEUDyMr +A1A== X-Gm-Message-State: ALyK8tJ3NVXB4aE3B5SKhY3lu751tlLb19s8hip6pwNiI845ysHkH8PebR9EOxlyn9X3cA== X-Received: by 10.98.91.196 with SMTP id p187mr40347767pfb.135.1467789864167; Wed, 06 Jul 2016 00:24:24 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id x66sm1881002pfi.84.2016.07.06.00.24.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Jul 2016 00:24:23 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [committed] [ARM] Fix endless recursion on calculating CPRC candidate Date: Wed, 6 Jul 2016 08:24:15 +0100 Message-Id: <1467789855-18989-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes When GDB determines whether type T can be part of candidate for passing and returning in VFP registers, it calls arm_vfp_cprc_sub_candidate recursively. However, if type T has self-reference field, like, class C { static C s; }; arm_vfp_cprc_sub_candidate won't return. This fix is to skip calling arm_vfp_cprc_sub_candidate if the field is static. gdb: 2016-07-06 Yao Qi * arm-tdep.c (arm_vfp_cprc_sub_candidate): Don't call arm_vfp_cprc_sub_candidate for static field. --- gdb/ChangeLog | 5 +++++ gdb/arm-tdep.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7cec5ad..a2fe153 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2016-07-06 Yao Qi + + * arm-tdep.c (arm_vfp_cprc_sub_candidate): Don't call + arm_vfp_cprc_sub_candidate for static field. + 2016-07-06 Manish Goregaokar * rust-lang.c (rust_subscript): Allow subscripting pointers diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index a6cb43c..22af54e 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3563,8 +3563,11 @@ arm_vfp_cprc_sub_candidate (struct type *t, int i; for (i = 0; i < TYPE_NFIELDS (t); i++) { - int sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i), - base_type); + int sub_count = 0; + + if (!field_is_static (&TYPE_FIELD (t, i))) + sub_count = arm_vfp_cprc_sub_candidate (TYPE_FIELD_TYPE (t, i), + base_type); if (sub_count == -1) return -1; count += sub_count;