Index: src/checks.cc |
diff --git a/src/checks.cc b/src/checks.cc |
index e08cd7c6856143a84f91ed3553ac3c6e73264ebe..184911a9f1f921c70db34454d51dea0e134d71f4 100644 |
--- a/src/checks.cc |
+++ b/src/checks.cc |
@@ -30,7 +30,9 @@ |
#if V8_LIBC_GLIBC || V8_OS_BSD |
# include <cxxabi.h> |
# include <execinfo.h> |
-#endif // V8_LIBC_GLIBC || V8_OS_BSD |
+#elif V8_OS_QNX |
+# include <backtrace.h> |
+#endif // V8_LIBC_GLIBC || V8_OS_BSD || V8_OS_QNX |
Benedikt Meurer
2013/11/15 11:49:59
The #endif should only list the conditions from #i
|
#include <stdio.h> |
#include "platform.h" |
@@ -64,7 +66,27 @@ static V8_INLINE void DumpBacktrace() { |
} |
} |
free(symbols); |
-#endif // V8_LIBC_GLIBC || V8_OS_BSD |
+#elif V8_OS_QNX |
+ char out[1024]; |
+ bt_accessor_t acc; |
+ bt_memmap_t memmap; |
+ bt_init_accessor(&acc, BT_SELF); |
+ bt_load_memmap(&acc, &memmap); |
+ bt_sprn_memmap(&memmap, out, sizeof(out)); |
+ i::OS::PrintError(out); |
+ bt_addr_t trace[100]; |
+ int size = bt_get_backtrace(&acc, trace, ARRAY_SIZE(trace)); |
+ i::OS::PrintError("\n==== C stack trace ===============================\n\n"); |
+ if (size == 0) { |
+ i::OS::PrintError("(empty)\n"); |
+ } else { |
+ bt_sprnf_addrs(&memmap, trace, size, const_cast<char*>("%a\n"), |
+ out, sizeof(out), NULL); |
+ i::OS::PrintError(out); |
+ } |
+ bt_unload_memmap(&memmap); |
+ bt_release_accessor(&acc); |
+#endif // V8_LIBC_GLIBC || V8_OS_BSD || V8_OS_QNX |
Benedikt Meurer
2013/11/15 11:49:59
Same as above.
|
} |