From 6cfce40fabbdea9796f103c08c37d826bf643688 Mon Sep 17 00:00:00 2001 From: Florian Schneider Date: Wed, 23 Nov 2016 10:47:44 -0800 Subject: [PATCH] Fix product and Mac build. BUG= Review URL: https://codereview.chromium.org/2518063008 . --- runtime/bin/platform_linux.cc | 2 +- runtime/bin/platform_macos.cc | 6 ++++++ runtime/vm/dart_api_impl.cc | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/runtime/bin/platform_linux.cc b/runtime/bin/platform_linux.cc index 420bfb61c53..0d3338c9158 100644 --- a/runtime/bin/platform_linux.cc +++ b/runtime/bin/platform_linux.cc @@ -22,12 +22,12 @@ char* Platform::resolved_executable_name_ = NULL; int Platform::script_index_ = 1; char** Platform::argv_ = NULL; - static void segv_handler(int signal, siginfo_t* siginfo, void* context) { Dart_DumpNativeStackTrace(context); abort(); } + bool Platform::Initialize() { // Turn off the signal handler for SIGPIPE as it causes the process // to terminate on writing to a closed pipe. Without the signal diff --git a/runtime/bin/platform_macos.cc b/runtime/bin/platform_macos.cc index 8e2fd187b91..0c6de4ddac9 100644 --- a/runtime/bin/platform_macos.cc +++ b/runtime/bin/platform_macos.cc @@ -28,6 +28,12 @@ char* Platform::resolved_executable_name_ = NULL; int Platform::script_index_ = 1; char** Platform::argv_ = NULL; +static void segv_handler(int signal, siginfo_t* siginfo, void* context) { + Dart_DumpNativeStackTrace(context); + abort(); +} + + bool Platform::Initialize() { // Turn off the signal handler for SIGPIPE as it causes the process // to terminate on writing to a closed pipe. Without the signal diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc index b3161c12a84..2e739e17e74 100644 --- a/runtime/vm/dart_api_impl.cc +++ b/runtime/vm/dart_api_impl.cc @@ -6673,7 +6673,9 @@ DART_EXPORT bool Dart_IsPrecompiledRuntime() { DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { +#ifndef PRODUCT Profiler::DumpStackTrace(context); +#endif } } // namespace dart