Skip to content

Instantly share code, notes, and snippets.

@yuyichao
Created September 30, 2016 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuyichao/316e2242c8d63b1f1019db0cc8b30f7f to your computer and use it in GitHub Desktop.
Save yuyichao/316e2242c8d63b1f1019db0cc8b30f7f to your computer and use it in GitHub Desktop.
From 67604ad18b260ed24dbee664803296b590e624b2 Mon Sep 17 00:00:00 2001
From: Yichao Yu <yyc1992@gmail.com>
Date: Fri, 30 Sep 2016 00:40:56 -0400
Subject: [PATCH] Support dynamic unwind info on ARM
---
src/arm/Gstep.c | 10 ++++++++--
src/mi/Gdyn-extract.c | 1 +
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/arm/Gstep.c b/src/arm/Gstep.c
index 79f2dd2..5b2b329 100644
--- a/src/arm/Gstep.c
+++ b/src/arm/Gstep.c
@@ -45,8 +45,14 @@ arm_exidx_step (struct cursor *c)
/* mark PC unsaved */
c->dwarf.loc[UNW_ARM_R15] = DWARF_NULL_LOC;
- if ((ret = tdep_find_proc_info (&c->dwarf, c->dwarf.ip, 1)) < 0)
- return ret;
+ /* check dynamic info first --- it overrides everything else */
+ ret = unwi_find_dynamic_proc_info (c->dwarf.as, c->dwarf.ip, &c->dwarf.pi, 1,
+ c->dwarf.as_arg);
+ if (ret == -UNW_ENOINFO)
+ {
+ if ((ret = tdep_find_proc_info (&c->dwarf, c->dwarf.ip, 1)) < 0)
+ return ret;
+ }
if (c->dwarf.pi.format != UNW_INFO_FORMAT_ARM_EXIDX)
return -UNW_ENOINFO;
diff --git a/src/mi/Gdyn-extract.c b/src/mi/Gdyn-extract.c
index c8ae7a0..5f7682e 100644
--- a/src/mi/Gdyn-extract.c
+++ b/src/mi/Gdyn-extract.c
@@ -49,6 +49,7 @@ unwi_extract_dynamic_proc_info (unw_addr_space_t as, unw_word_t ip,
case UNW_INFO_FORMAT_TABLE:
case UNW_INFO_FORMAT_REMOTE_TABLE:
+ case UNW_INFO_FORMAT_ARM_EXIDX:
case UNW_INFO_FORMAT_IP_OFFSET:
#ifdef tdep_search_unwind_table
/* call platform-specific search routine: */
--
2.10.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment