| Index: runtime/bin/vmstats_impl_win.cc
|
| ===================================================================
|
| --- runtime/bin/vmstats_impl_win.cc (revision 0)
|
| +++ runtime/bin/vmstats_impl_win.cc (revision 0)
|
| @@ -0,0 +1,26 @@
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +#include "platform/globals.h"
|
| +#if defined(TARGET_OS_WINDOWS)
|
| +
|
| +#include "bin/vmstats_impl.h"
|
| +
|
| +#include <signal.h> // NOLINT
|
| +
|
| +
|
| +static void sig_handler(int sig) {
|
| + if (sig == SIGBREAK) {
|
| + VmStats::DumpStack();
|
| + }
|
| +}
|
| +
|
| +void VmStats::Initialize() {
|
| + // Enable SIGBREAK (ctrl-break) stack dumps.
|
| + if (signal(SIGQUIT, sig_handler) == SIG_ERR) {
|
| + perror("Adding SIGQUIT signal handler failed");
|
| + }
|
| +}
|
| +
|
| +#endif // defined(TARGET_OS_WINDOWS)
|
|
|