libunwind-arm-pc-offset.patch
From 320973722157e09c6139b016aa31012d5ea75f68 Mon Sep 17 00:00:00 2001
From: Yichao Yu <yyc1992@gmail.com>
Date: Sun, 2 Oct 2016 03:19:19 +0000
Subject: [PATCH] Handle non-signal frame unwind info lookup in ARM exidx
unwinder
---
src/arm/Gstep.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/arm/Gstep.c b/src/arm/Gstep.c
index 449419b..76ced8e 100644
--- a/src/arm/Gstep.c
+++ b/src/arm/Gstep.c
@@ -44,19 +44,22 @@ arm_exidx_step (struct cursor *c)
/* mark PC unsaved */
c->dwarf.loc[UNW_ARM_R15] = DWARF_NULL_LOC;
+ unw_word_t ip = c->dwarf.ip;
+ if (c->dwarf.use_prev_instr)
+ --ip;
/* check dynamic info first --- it overrides everything else */
- ret = unwi_find_dynamic_proc_info (c->dwarf.as, c->dwarf.ip, &c->dwarf.pi, 1,
+ ret = unwi_find_dynamic_proc_info (c->dwarf.as, ip, &c->dwarf.pi, 1,
c->dwarf.as_arg);
if (ret == -UNW_ENOINFO)
{
#ifdef UNW_LOCAL_ONLY
- if ((ret = arm_find_proc_info2 (c->dwarf.as, c->dwarf.ip, &c->dwarf.pi,
+ if ((ret = arm_find_proc_info2 (c->dwarf.as, ip, &c->dwarf.pi,
1, c->dwarf.as_arg,
UNW_ARM_METHOD_EXIDX)) < 0)
return ret;
#else
- if ((ret = tdep_find_proc_info (&c->dwarf, c->dwarf.ip, 1)) < 0)
+ if ((ret = tdep_find_proc_info (&c->dwarf, ip, 1)) < 0)
return ret;
#endif
}
--
2.10.0