aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2017-03-23 14:53:40 -0700
committerChristopher Ferris <cferris@google.com>2017-03-23 14:53:40 -0700
commit1b47da733e2553ba58eab708a7ecd62789c89708 (patch)
tree49deedcc49dc1a8f5199054db591ee00a24b0149
parentde858ed3a4d47e1b8b774ed7d99c992c479d0f56 (diff)
downloadlibunwind-1b47da733e2553ba58eab708a7ecd62789c89708.tar.gz
Fix problem finding if in a signal handler.
Bug: 34468756 Test: Wrote a new test in system/core/libbacktrace that passes with Test: this fix. Ran all of the other backtrace unit tests. Change-Id: I0be65192f85f05593738a4d3f00c3a2b95d69df5
-rw-r--r--src/x86/Gos-linux.c4
-rw-r--r--src/x86/Gstep.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/x86/Gos-linux.c b/src/x86/Gos-linux.c
index 884c7fde..66440aee 100644
--- a/src/x86/Gos-linux.c
+++ b/src/x86/Gos-linux.c
@@ -57,6 +57,10 @@ unw_is_signal_frame (unw_cursor_t *cursor)
if SA_SIGINFO is specified.
*/
ip = c->dwarf.ip;
+ if (c->dwarf.frame != 0) {
+ /* Need to adjust the ip because we adjusted it down in the step call. */
+ ip++;
+ }
if ((*a->access_mem) (as, ip, &w0, 0, arg) < 0
|| (*a->access_mem) (as, ip + 4, &w1, 0, arg) < 0)
ret = 0;
diff --git a/src/x86/Gstep.c b/src/x86/Gstep.c
index b037b71a..74fd32de 100644
--- a/src/x86/Gstep.c
+++ b/src/x86/Gstep.c
@@ -115,6 +115,10 @@ unw_step (unw_cursor_t *cursor)
}
else
c->dwarf.ip = 0;
+
+ /* Adjust the return value because the functions above return zero for success. */
+ if (ret == 0)
+ ret = 1;
}
#endif