Merge with origin/master
diff --git a/tests/Gtest-bt.c b/tests/Gtest-bt.c
index 1b60964..152e2af 100644
--- a/tests/Gtest-bt.c
+++ b/tests/Gtest-bt.c
@@ -48,14 +48,17 @@
 int verbose;
 int num_errors;
 
+/* These variables are global because they
+ * cause the signal stack to overflow */
+char buf[512], name[256];
+unw_cursor_t cursor;
+ucontext_t uc;
+
 static void
 do_backtrace (void)
 {
-  char buf[512], name[256];
   unw_word_t ip, sp, off;
-  unw_cursor_t cursor;
   unw_proc_info_t pi;
-  unw_context_t uc;
   int ret;
 
   if (verbose)
@@ -186,6 +189,12 @@
 #elif defined __FreeBSD__
       printf (" @ %lx", (unsigned long) uc->uc_mcontext.mc_eip);
 #endif
+#elif UNW_TARGET_X86_64
+#if defined __linux__
+      printf (" @ %lx", (unsigned long) uc->uc_mcontext.gregs[REG_RIP]);
+#elif defined __FreeBSD__
+      printf (" @ %lx", (unsigned long) uc->uc_mcontext.mc_rip);
+#endif
 #endif
       printf ("\n");
     }