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

Side by Side Diff: runtime/bin/vmstats_impl_macos.cc

Issue 14313002: Added ctrl-\ support in dart binary to dump isolate stacks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/vmstats_impl_linux.cc ('k') | runtime/bin/vmstats_impl_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #include "platform/globals.h"
6 #if defined(TARGET_OS_MACOS)
7
8 #include "bin/vmstats_impl.h"
9
10 #include <signal.h> // NOLINT
11
12
13 static void sig_handler(int sig, siginfo_t* siginfo, void*) {
14 if (sig == SIGQUIT) {
15 VmStats::DumpStack();
16 } else {
17 FATAL1("unrequested signal %d received\n", sig);
18 }
19 }
20
21 void VmStats::Initialize() {
22 // Enable SIGQUIT (ctrl-\) stack dumps.
23 struct sigaction sigact;
24 memset(&sigact, '\0', sizeof(sigact));
25 sigact.sa_sigaction = sig_handler;
26 sigact.sa_flags = SA_SIGINFO;
27 if (sigaction(SIGQUIT, &sigact, NULL) < 0) {
28 perror("sigaction");
29 }
30 }
31
32 #endif // defined(TARGET_OS_MACOS)
33
OLDNEW
« no previous file with comments | « runtime/bin/vmstats_impl_linux.cc ('k') | runtime/bin/vmstats_impl_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698