Arquivos
chromium/base/debug_util_mac.cc
jeremy@chromium.org 219e44cf1b Fix for breakpad not generating a minidump in certain cases on OSX.
1)Fix logic inversion in IsCrashReporterEnabled().
2)Don't intercept SIGPIPE in non-branded builds since it isn't fatal.
3)Roll DEPS to pickup a bunch of Mac Breakpad fixes.

When breakpad is disabled, we intercept a bunch of signals so that we can crash fast, without waiting for Apple's crash reporter.  The problem was that the function we where using to test whether breakpad was enabled was wrong so we were always installing these signal handlers which where just calling exit().

By fixing the IsCrashReporterEnabled() call, we no longer install these signal handlers if Breakpad is enabled.

In any case SIGPIPE is non-fatal so we remove it from the list of signals we intercept.

There have been a number of fixes to the OSX version of Breakpad recently, so we pull those in as well.

BUG=11929

Review URL: http://codereview.chromium.org/115493

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16346 0039d316-1c4b-4281-b951-d872f2087c98
2009-05-19 00:13:08 +00:00

35 linhas
1.1 KiB
C++

// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/debug_util.h"
#include <signal.h>
#include "base/basictypes.h"
static void ExitSignalHandler(int sig) {
exit(128 + sig);
}
// static
void DebugUtil::DisableOSCrashDumps() {
int signals_to_intercept[] ={SIGINT,
SIGHUP,
SIGTERM,
SIGABRT,
SIGILL,
SIGTRAP,
SIGEMT,
SIGFPE,
SIGBUS,
SIGSEGV,
SIGSYS,
SIGXCPU,
SIGXFSZ};
// For all these signals, just wire things up so we exit immediately.
for (size_t i = 0; i < arraysize(signals_to_intercept); ++i) {
signal(signals_to_intercept[i], ExitSignalHandler);
}
}