From patchwork Wed Mar 23 15:55:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ken Werner X-Patchwork-Id: 762 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:45:31 -0000 Delivered-To: patches@linaro.org Received: by 10.220.180.8 with SMTP id bs8cs11684vcb; Wed, 23 Mar 2011 08:55:12 -0700 (PDT) Received: by 10.213.14.138 with SMTP id g10mr12078eba.64.1300895710885; Wed, 23 Mar 2011 08:55:10 -0700 (PDT) Received: from mtagate5.uk.ibm.com (mtagate5.uk.ibm.com [194.196.100.165]) by mx.google.com with ESMTPS id w3si12044761eeh.10.2011.03.23.08.55.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Mar 2011 08:55:10 -0700 (PDT) Received-SPF: neutral (google.com: 194.196.100.165 is neither permitted nor denied by best guess record for domain of ken.werner@linaro.org) client-ip=194.196.100.165; Authentication-Results: mx.google.com; spf=neutral (google.com: 194.196.100.165 is neither permitted nor denied by best guess record for domain of ken.werner@linaro.org) smtp.mail=ken.werner@linaro.org Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate5.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p2NFtAJd013079 for ; Wed, 23 Mar 2011 15:55:10 GMT Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p2NFtbOj1806480 for ; Wed, 23 Mar 2011 15:55:37 GMT Received: from d06av11.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p2NFt9dk022494 for ; Wed, 23 Mar 2011 09:55:09 -0600 Received: from localhost.localdomain (dyn-9-152-224-51.boeblingen.de.ibm.com [9.152.224.51]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p2NFt7Tv022296; Wed, 23 Mar 2011 09:55:09 -0600 From: Ken Werner To: libunwind-devel@nongnu.org Subject: [PATCH 4/8] Prefer to unwind using DWARF info on ARM. Date: Wed, 23 Mar 2011 15:55:02 +0000 Message-Id: <1300895706-5424-5-git-send-email-ken.werner@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1300895706-5424-1-git-send-email-ken.werner@linaro.org> References: <1300895706-5424-1-git-send-email-ken.werner@linaro.org> DWARF expressions are more powerful than the ARM specific unwind tables. Therefore DWARF should be the preferred unwind method. Signed-off-by: Ken Werner --- src/arm/Gstep.c | 23 +++++++++++++---------- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/arm/Gstep.c b/src/arm/Gstep.c index 1b4b135..f036093 100644 --- a/src/arm/Gstep.c +++ b/src/arm/Gstep.c @@ -76,16 +76,7 @@ unw_step (unw_cursor_t *cursor) Debug (1, "(cursor=%p)\n", c); - if (UNW_TRY_METHOD (UNW_ARM_METHOD_EXIDX)) - { - ret = arm_exidx_step (c); - if (ret >= 0) - return 1; - if (ret == -UNW_ESTOPUNWIND) - return 0; - } - - /* Next, try DWARF-based unwinding. */ + /* First, try DWARF-based unwinding. */ if (UNW_TRY_METHOD(UNW_ARM_METHOD_DWARF)) { ret = dwarf_step (&c->dwarf); @@ -101,6 +92,18 @@ unw_step (unw_cursor_t *cursor) } } + /* Next, try extbl-based unwinding. */ + if (UNW_TRY_METHOD (UNW_ARM_METHOD_EXIDX)) + { + ret = arm_exidx_step (c); + if (ret >= 0) + return 1; + if (ret == -UNW_ESTOPUNWIND) + return 0; + } + + /* Fall back on APCS frame parsing. + Note: This won't work in case the ARM EABI is used. */ if (unlikely (ret < 0)) { if (UNW_TRY_METHOD(UNW_ARM_METHOD_FRAME))