debug: Wrap rb_backtrace with HAVE_RB_BACKTRACE instead of CPU_ARM
Basically, preparation for a non-ARM backtrace support.
Change-Id: Icfd09fbc65a98f859e2a19f8d1111827a262a969
diff --git a/firmware/export/system.h b/firmware/export/system.h
index f26b3d7..ebeef9c 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -253,6 +253,11 @@
#define MIN_STACK_ALIGN 8
#endif
+/* Define this if target has support for generating backtraces */
+#ifdef CPU_ARM
+ #define HAVE_RB_BACKTRACE
+#endif
+
#ifndef MIN_STACK_ALIGN
#define MIN_STACK_ALIGN (sizeof (uintptr_t))
#endif
diff --git a/firmware/panic.c b/firmware/panic.c
index 7e7e43d..90e727d 100644
--- a/firmware/panic.c
+++ b/firmware/panic.c
@@ -114,7 +114,7 @@
}
}
-#if defined(CPU_ARM)
+#if defined(HAVE_RB_BACKTRACE)
rb_backtrace(pc, sp, &y);
#endif
#ifdef ROCKBOX_HAS_LOGF