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

Side by Side Diff: base/debug_util_mac.cc

Issue 272025: Trim the list of signals used by debug_util::DisableOSCrashDumps() on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 2 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 | « base/debug_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/debug_util.h" 5 #include "base/debug_util.h"
6 6
7 #include <signal.h> 7 #include <signal.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 10
11 static void ExitSignalHandler(int sig) { 11 static void ExitSignalHandler(int sig) {
12 exit(128 + sig); 12 exit(128 + sig);
13 } 13 }
14 14
15 // static 15 // static
16 void DebugUtil::DisableOSCrashDumps() { 16 void DebugUtil::DisableOSCrashDumps() {
17 int signals_to_intercept[] ={SIGINT, 17 // These are the POSIX signals corresponding to the Mach exceptions that
18 SIGHUP, 18 // Apple Crash Reporter handles. See ux_exception() in xnu's
19 SIGTERM, 19 // bsd/uxkern/ux_exception.c and machine_exception() in xnu's
20 SIGABRT, 20 // bsd/dev/*/unix_signal.c.
21 SIGILL, 21 const int signals_to_intercept[] ={
22 SIGTRAP, 22 SIGILL, // EXC_BAD_INSTRUCTION
23 SIGEMT, 23 SIGTRAP, // EXC_BREAKPOINT
24 SIGFPE, 24 SIGFPE, // EXC_ARITHMETIC
25 SIGBUS, 25 SIGBUS, // EXC_BAD_ACCESS
26 SIGSEGV, 26 SIGSEGV // EXC_BAD_ACCESS
27 SIGSYS, 27 };
28 SIGXCPU, 28
29 SIGXFSZ};
30 // For all these signals, just wire things up so we exit immediately. 29 // For all these signals, just wire things up so we exit immediately.
31 for (size_t i = 0; i < arraysize(signals_to_intercept); ++i) { 30 for (size_t i = 0; i < arraysize(signals_to_intercept); ++i) {
32 signal(signals_to_intercept[i], ExitSignalHandler); 31 signal(signals_to_intercept[i], ExitSignalHandler);
33 } 32 }
34 } 33 }
OLDNEW
« no previous file with comments | « base/debug_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698