From patchwork Wed Aug 17 14:41:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ken Werner X-Patchwork-Id: 3488 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C6EFF23F41 for ; Wed, 17 Aug 2011 14:41:27 +0000 (UTC) Received: from mail-ew0-f52.google.com (mail-ew0-f52.google.com [209.85.215.52]) by fiordland.canonical.com (Postfix) with ESMTP id B625DA18674 for ; Wed, 17 Aug 2011 14:41:27 +0000 (UTC) Received: by ewy28 with SMTP id 28so546674ewy.11 for ; Wed, 17 Aug 2011 07:41:27 -0700 (PDT) Received: by 10.213.32.131 with SMTP id c3mr1287545ebd.94.1313592087182; Wed, 17 Aug 2011 07:41:27 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.213.102.5 with SMTP id e5cs21920ebo; Wed, 17 Aug 2011 07:41:26 -0700 (PDT) Received: from mr.google.com ([10.216.59.130]) by 10.216.59.130 with SMTP id s2mr6369606wec.26.1313592086688 (num_hops = 1); Wed, 17 Aug 2011 07:41:26 -0700 (PDT) Received: by 10.216.59.130 with SMTP id s2mr4306461wec.26.1313592086095; Wed, 17 Aug 2011 07:41:26 -0700 (PDT) Received: from mtagate2.uk.ibm.com (mtagate2.uk.ibm.com [194.196.100.162]) by mx.google.com with ESMTPS id v17si3109341wec.127.2011.08.17.07.41.25 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Aug 2011 07:41:26 -0700 (PDT) Received-SPF: neutral (google.com: 194.196.100.162 is neither permitted nor denied by best guess record for domain of ken.werner@linaro.org) client-ip=194.196.100.162; Authentication-Results: mx.google.com; spf=neutral (google.com: 194.196.100.162 is neither permitted nor denied by best guess record for domain of ken.werner@linaro.org) smtp.mail=ken.werner@linaro.org Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate2.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p7HEfP9D016383 for ; Wed, 17 Aug 2011 14:41:25 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p7HEfP1X2433106 for ; Wed, 17 Aug 2011 15:41:25 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p7HEfOPP007900 for ; Wed, 17 Aug 2011 08:41:24 -0600 Received: from leonard.boeblingen.de.ibm.com (dyn-9-152-224-36.boeblingen.de.ibm.com [9.152.224.36]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p7HEfOr0007863; Wed, 17 Aug 2011 08:41:24 -0600 From: Ken Werner To: libunwind-devel@nongnu.org Subject: [PATCH 2/2] ARM: Ensure unw_step returns whatever find_proc_info() returns Date: Wed, 17 Aug 2011 16:41:23 +0200 Message-Id: <1313592083-2817-3-git-send-email-ken.werner@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1313592083-2817-1-git-send-email-ken.werner@linaro.org> References: <1313592083-2817-1-git-send-email-ken.werner@linaro.org> This allows the test-proc-info test case to pass on ARM. Signed-off-by: Ken Werner --- src/arm/Gstep.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/arm/Gstep.c b/src/arm/Gstep.c index 270058b..1dae78e 100644 --- a/src/arm/Gstep.c +++ b/src/arm/Gstep.c @@ -45,13 +45,15 @@ arm_exidx_step (struct cursor *c) c->dwarf.loc[UNW_ARM_R15] = DWARF_NULL_LOC; if ((ret = tdep_find_proc_info (&c->dwarf, c->dwarf.ip, 1)) < 0) - return -UNW_ENOINFO; + return ret; if (c->dwarf.pi.format != UNW_INFO_FORMAT_ARM_EXIDX) return -UNW_ENOINFO; ret = arm_exidx_extract (&c->dwarf, buf); - if (ret < 0) + if (ret == -UNW_ESTOPUNWIND) + return 0; + else if (ret < 0) return ret; ret = arm_exidx_decode (buf, ret, &c->dwarf); @@ -189,10 +191,10 @@ unw_step (unw_cursor_t *cursor) if (UNW_TRY_METHOD (UNW_ARM_METHOD_EXIDX)) { ret = arm_exidx_step (c); - if (ret >= 0) + if (ret > 0) return 1; - if (ret == -UNW_ESTOPUNWIND) - return 0; + if (ret == -UNW_ESTOPUNWIND || ret == 0) + return ret; } /* Fall back on APCS frame parsing.