Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Unified Diff: src/checks.cc

Issue 61153009: Add support for the QNX operating system. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Address latest review comments Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/cpu-arm.cc ('k') | src/cpu.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/checks.cc
diff --git a/src/checks.cc b/src/checks.cc
index a4514bf965094891cfb371ea46c05a6b1d26f05d..2b1c76cb9b1bc35b7ef19288bf6daee662d03c64 100644
--- a/src/checks.cc
+++ b/src/checks.cc
@@ -30,6 +30,8 @@
#if V8_LIBC_GLIBC || V8_OS_BSD
# include <cxxabi.h>
# include <execinfo.h>
+#elif V8_OS_QNX
+# include <backtrace.h>
#endif // V8_LIBC_GLIBC || V8_OS_BSD
#include <stdio.h>
@@ -64,6 +66,26 @@ static V8_INLINE void DumpBacktrace() {
}
}
free(symbols);
+#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
}
« no previous file with comments | « src/arm/cpu-arm.cc ('k') | src/cpu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698