diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn index 6ab1482ce29..51c708ce6a1 100644 --- a/runtime/bin/BUILD.gn +++ b/runtime/bin/BUILD.gn @@ -179,6 +179,13 @@ template("build_gen_snapshot") { ] } + if (!is_win) { + # Adds all symbols to the dynamic symbol table, not just used ones. + # This is needed to make native extensions work. It is also needed to get + # symbols in VM-generated backtraces and profiles. + ldflags = [ "-rdynamic" ] + } + if (is_win) { libs = [ "iphlpapi.lib", @@ -730,7 +737,8 @@ template("dart_executable") { ldflags = [ "/EXPORT:Dart_True" ] } else { # Adds all symbols to the dynamic symbol table, not just used ones. - # This is needed to make native extensions work. + # This is needed to make native extensions work. It is also needed to get + # symbols in VM-generated backtraces and profiles. ldflags = [ "-rdynamic" ] } @@ -943,6 +951,9 @@ executable("run_vm_tests") { ] + builtin_impl_tests + vm_tests + compiler_tests + heap_tests if (!is_win) { + # Adds all symbols to the dynamic symbol table, not just used ones. + # This is needed to make native extensions work. It is also needed to get + # symbols in VM-generated backtraces and profiles. ldflags = [ "-rdynamic" ] } diff --git a/runtime/bin/platform_android.cc b/runtime/bin/platform_android.cc index cd1efd76635..37240b9baa0 100644 --- a/runtime/bin/platform_android.cc +++ b/runtime/bin/platform_android.cc @@ -28,10 +28,9 @@ char** Platform::argv_ = NULL; static void segv_handler(int signal, siginfo_t* siginfo, void* context) { Log::PrintErr( "\n===== CRASH =====\n" - "version=%s\n" "si_signo=%s(%d), si_code=%d, si_addr=%p\n", - Dart_VersionString(), strsignal(siginfo->si_signo), siginfo->si_signo, - siginfo->si_code, siginfo->si_addr); + strsignal(siginfo->si_signo), siginfo->si_signo, siginfo->si_code, + siginfo->si_addr); Dart_DumpNativeStackTrace(context); abort(); } diff --git a/runtime/bin/platform_linux.cc b/runtime/bin/platform_linux.cc index 260a9001edb..6bc50aa6d5c 100644 --- a/runtime/bin/platform_linux.cc +++ b/runtime/bin/platform_linux.cc @@ -28,10 +28,9 @@ char** Platform::argv_ = NULL; static void segv_handler(int signal, siginfo_t* siginfo, void* context) { Log::PrintErr( "\n===== CRASH =====\n" - "version=%s\n" "si_signo=%s(%d), si_code=%d, si_addr=%p\n", - Dart_VersionString(), strsignal(siginfo->si_signo), siginfo->si_signo, - siginfo->si_code, siginfo->si_addr); + strsignal(siginfo->si_signo), siginfo->si_signo, siginfo->si_code, + siginfo->si_addr); Dart_DumpNativeStackTrace(context); abort(); } diff --git a/runtime/bin/platform_macos.cc b/runtime/bin/platform_macos.cc index c41e8b28ce2..ef3c90f9b9a 100644 --- a/runtime/bin/platform_macos.cc +++ b/runtime/bin/platform_macos.cc @@ -36,10 +36,9 @@ char** Platform::argv_ = NULL; static void segv_handler(int signal, siginfo_t* siginfo, void* context) { Log::PrintErr( "\n===== CRASH =====\n" - "version=%s\n" "si_signo=%s(%d), si_code=%d, si_addr=%p\n", - Dart_VersionString(), strsignal(siginfo->si_signo), siginfo->si_signo, - siginfo->si_code, siginfo->si_addr); + strsignal(siginfo->si_signo), siginfo->si_signo, siginfo->si_code, + siginfo->si_addr); Dart_DumpNativeStackTrace(context); abort(); } diff --git a/runtime/bin/platform_win.cc b/runtime/bin/platform_win.cc index 5cdf6fc0d65..9b2face8ded 100644 --- a/runtime/bin/platform_win.cc +++ b/runtime/bin/platform_win.cc @@ -75,9 +75,8 @@ class PlatformWin { EXCEPTION_ILLEGAL_INSTRUCTION)) { Log::PrintErr( "\n===== CRASH =====\n" - "version=%s\n" "ExceptionCode=%d, ExceptionFlags=%d, ExceptionAddress=%p\n", - Dart_VersionString(), ExceptionInfo->ExceptionRecord->ExceptionCode, + ExceptionInfo->ExceptionRecord->ExceptionCode, ExceptionInfo->ExceptionRecord->ExceptionFlags, ExceptionInfo->ExceptionRecord->ExceptionAddress); Dart_DumpNativeStackTrace(ExceptionInfo->ContextRecord); diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc index 5ff50f60282..9db291da325 100644 --- a/runtime/vm/profiler.cc +++ b/runtime/vm/profiler.cc @@ -23,6 +23,7 @@ #include "vm/signal_handler.h" #include "vm/simulator.h" #include "vm/stack_frame.h" +#include "vm/version.h" namespace dart { @@ -1117,9 +1118,9 @@ void Profiler::DumpStackTrace(uword sp, uword fp, uword pc, bool for_crash) { ASSERT(os_thread != NULL); Isolate* isolate = Isolate::Current(); const char* name = isolate == NULL ? NULL : isolate->name(); - OS::PrintErr("thread=%" Pd ", isolate=%s(%p)\n", - OSThread::ThreadIdToIntPtr(os_thread->trace_id()), name, - isolate); + OS::PrintErr( + "version=%s\nthread=%" Pd ", isolate=%s(%p)\n", Version::String(), + OSThread::ThreadIdToIntPtr(os_thread->trace_id()), name, isolate); if (!InitialRegisterCheck(pc, fp, sp)) { OS::PrintErr("Stack dump aborted because InitialRegisterCheck failed.\n");