summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun He <jun.he@arm.com>2017-07-03 07:18:32 +0000
committerJun He <jun.he@arm.com>2017-07-03 08:47:55 +0000
commitc8ca71d40bc51e255457cd4374dd45ec9ebf8ae1 (patch)
tree89147af539ccd8a0d3a36edefd0067b6c6c19743
parent26e638a8e917608d8e75b07e5e941c7a24462c4d (diff)
downloadredis-c8ca71d40bc51e255457cd4374dd45ec9ebf8ae1.tar.gz
Fixed stack trace generation on aarch64
Change-Id: I9801239c98cb7362ed07e8b9ec2ba7e45749dba7 Signed-off-by: Jun He <jun.he@arm.com>
-rw-r--r--src/Makefile2
-rw-r--r--src/debug.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/Makefile b/src/Makefile
index 24e960593..a1ff4258a 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -39,7 +39,7 @@ endif
endif
# To get ARM stack traces if Redis crashes we need a special C flag.
-ifneq (,$(findstring armv,$(uname_M)))
+ifneq (,$(filter aarch64 armv,$(uname_M)))
CFLAGS+=-funwind-tables
endif
diff --git a/src/debug.c b/src/debug.c
index a4caa49f2..c976d0ed9 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -673,6 +673,8 @@ static void *getMcontextEip(ucontext_t *uc) {
return (void*) uc->uc_mcontext.sc_ip;
#elif defined(__arm__) /* Linux ARM */
return (void*) uc->uc_mcontext.arm_pc;
+ #elif defined(__aarch64__) /* Linux AArch64 */
+ return (void*) uc->uc_mcontext.pc;
#endif
#else
return NULL;