зеркало из https://github.com/mozilla/pjs.git
bug 382541 - Mozilla Crash Reporter supresses writing of Mac OS X crash log - short term workaround. r=mento
This commit is contained in:
Родитель
f6d7e0f28b
Коммит
6e825b0dc2
|
@ -61,6 +61,8 @@ ifeq ($(OS_ARCH),WINNT)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS_ARCH),Darwin)
|
ifeq ($(OS_ARCH),Darwin)
|
||||||
|
CMMSRCS = mac_utils.mm
|
||||||
|
|
||||||
DIRS += \
|
DIRS += \
|
||||||
airbag/src/common \
|
airbag/src/common \
|
||||||
airbag/src/common/mac \
|
airbag/src/common/mac \
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <Carbon/Carbon.h>
|
#include <Carbon/Carbon.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include "mac_utils.h"
|
||||||
#elif defined(XP_LINUX)
|
#elif defined(XP_LINUX)
|
||||||
#include "client/linux/handler/exception_handler.h"
|
#include "client/linux/handler/exception_handler.h"
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
@ -104,6 +105,9 @@ static XP_CHAR* crashReporterPath;
|
||||||
// if this is false, we don't launch the crash reporter
|
// if this is false, we don't launch the crash reporter
|
||||||
static bool doReport = true;
|
static bool doReport = true;
|
||||||
|
|
||||||
|
// if this is true, we pass the exception on to the OS crash reporter
|
||||||
|
static bool showOSCrashReporter = false;
|
||||||
|
|
||||||
// this holds additional data sent via the API
|
// this holds additional data sent via the API
|
||||||
static nsDataHashtable<nsCStringHashKey,nsCString>* crashReporterAPIData_Hash;
|
static nsDataHashtable<nsCStringHashKey,nsCString>* crashReporterAPIData_Hash;
|
||||||
static nsCString* crashReporterAPIData = nsnull;
|
static nsCString* crashReporterAPIData = nsnull;
|
||||||
|
@ -131,7 +135,7 @@ bool MinidumpCallback(const XP_CHAR* dump_path,
|
||||||
#endif
|
#endif
|
||||||
bool succeeded)
|
bool succeeded)
|
||||||
{
|
{
|
||||||
printf("Wrote minidump ID %s\n", minidump_id);
|
bool returnValue = showOSCrashReporter ? false : succeeded;
|
||||||
|
|
||||||
XP_CHAR minidumpPath[XP_PATH_MAX];
|
XP_CHAR minidumpPath[XP_PATH_MAX];
|
||||||
int size = XP_PATH_MAX;
|
int size = XP_PATH_MAX;
|
||||||
|
@ -170,7 +174,7 @@ bool MinidumpCallback(const XP_CHAR* dump_path,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!doReport) {
|
if (!doReport) {
|
||||||
return succeeded;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
STARTUPINFO si;
|
STARTUPINFO si;
|
||||||
|
@ -204,7 +208,7 @@ bool MinidumpCallback(const XP_CHAR* dump_path,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!doReport) {
|
if (!doReport) {
|
||||||
return succeeded;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pid_t pid = fork();
|
pid_t pid = fork();
|
||||||
|
@ -218,7 +222,7 @@ bool MinidumpCallback(const XP_CHAR* dump_path,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return succeeded;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult SetExceptionHandler(nsILocalFile* aXREDirectory,
|
nsresult SetExceptionHandler(nsILocalFile* aXREDirectory,
|
||||||
|
@ -311,6 +315,13 @@ nsresult SetExceptionHandler(nsILocalFile* aXREDirectory,
|
||||||
AnnotateCrashReport(NS_LITERAL_CSTRING("ServerURL"),
|
AnnotateCrashReport(NS_LITERAL_CSTRING("ServerURL"),
|
||||||
nsDependentCString(aServerURL));
|
nsDependentCString(aServerURL));
|
||||||
|
|
||||||
|
#if defined(XP_MACOSX)
|
||||||
|
// On OS X, many testers like to see the OS crash reporting dialog
|
||||||
|
// since it offers immediate stack traces. We allow them to set
|
||||||
|
// a default to pass exceptions to the OS handler.
|
||||||
|
showOSCrashReporter = PassToOSCrashReporter();
|
||||||
|
#endif
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче