diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2021-08-12 23:05:07 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2021-08-12 23:13:12 +0300 |
commit | 97f09de4fcbe2a789d01ed362d6acfcac6b007b3 (patch) | |
tree | b35db61d9bf9902d443043d289f57f6f70334678 /indra/newview/llappviewermacosx.cpp | |
parent | 54171dbc9fe3fa42ebbf59a243b7381fdb3aa662 (diff) | |
parent | c40b8310b00f1d620a2f5a94f2514c8bf3531373 (diff) |
Merge branch 'master' into DRTVWR-520-apple-notarization
# Conflicts:
# autobuild.xml
# build.sh
# indra/CMakeLists.txt
# indra/newview/CMakeLists.txt
# indra/newview/llappviewermacosx.cpp
# indra/newview/llappviewerwin32.h
# indra/newview/viewer_manifest.py
# indra/win_crash_logger/llcrashloggerwindows.cpp
Diffstat (limited to 'indra/newview/llappviewermacosx.cpp')
-rw-r--r-- | indra/newview/llappviewermacosx.cpp | 52 |
1 files changed, 18 insertions, 34 deletions
diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 862e2b45df..aa932f9c89 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -68,39 +68,21 @@ namespace int gArgC; char** gArgV; LLAppViewerMacOSX* gViewerAppPtr = NULL; - - void (*gOldTerminateHandler)() = NULL; std::string gHandleSLURL; } -static void exceptionTerminateHandler() -{ - // reinstall default terminate() handler in case we re-terminate. - if (gOldTerminateHandler) std::set_terminate(gOldTerminateHandler); - // treat this like a regular viewer crash, with nice stacktrace etc. - long *null_ptr; - null_ptr = 0; - *null_ptr = 0xDEADBEEF; //Force an exception that will trigger breakpad. - //LLAppViewer::handleViewerCrash(); - // we've probably been killed-off before now, but... - gOldTerminateHandler(); // call old terminate() handler -} - void constructViewer() { // Set the working dir to <bundle>/Contents/Resources if (chdir(gDirUtilp->getAppRODataDir().c_str()) == -1) { - LL_WARNS() << "Could not change directory to " + LL_WARNS("InitOSX") << "Could not change directory to " << gDirUtilp->getAppRODataDir() << ": " << strerror(errno) << LL_ENDL; } gViewerAppPtr = new LLAppViewerMacOSX(); - // install unexpected exception handler - gOldTerminateHandler = std::set_terminate(exceptionTerminateHandler); - gViewerAppPtr->setErrorHandler(LLAppViewer::handleViewerCrash); } @@ -109,7 +91,7 @@ bool initViewer() bool ok = gViewerAppPtr->init(); if(!ok) { - LL_WARNS() << "Application init failed." << LL_ENDL; + LL_WARNS("InitOSX") << "Application init failed." << LL_ENDL; } else if (!gHandleSLURL.empty()) { @@ -172,7 +154,7 @@ class CrashMetadataSingleton: public CrashMetadata, public LLSingleton<CrashMeta std::string get_metadata(const LLSD& info, const LLSD::String& key) const { std::string data(info[key].asString()); - LL_INFOS() << " " << key << "='" << data << "'" << LL_ENDL; + LL_INFOS("Bugsplat") << " " << key << "='" << data << "'" << LL_ENDL; return data; } }; @@ -188,22 +170,22 @@ CrashMetadataSingleton::CrashMetadataSingleton() LLSD info; if (! static_file.is_open()) { - LL_INFOS() << "Can't open '" << staticDebugPathname + LL_WARNS("Bugsplat") << "Can't open '" << staticDebugPathname << "'; no metadata about previous run" << LL_ENDL; } else if (! LLSDSerialize::deserialize(info, static_file, LLSDSerialize::SIZE_UNLIMITED)) { - LL_INFOS() << "Can't parse '" << staticDebugPathname + LL_WARNS("Bugsplat") << "Can't parse '" << staticDebugPathname << "'; no metadata about previous run" << LL_ENDL; } else { - LL_INFOS() << "Metadata from '" << staticDebugPathname << "':" << LL_ENDL; - logFilePathname = get_metadata(info, "SLLog"); - userSettingsPathname = get_metadata(info, "SettingsFilename"); + LL_INFOS("Bugsplat") << "Previous run metadata from '" << staticDebugPathname << "':" << LL_ENDL; + logFilePathname = get_metadata(info, "SLLog"); + userSettingsPathname = get_metadata(info, "SettingsFilename"); accountSettingsPathname = get_metadata(info, "PerAccountSettingsFilename"); - OSInfo = get_metadata(info, "OSInfo"); - agentFullname = get_metadata(info, "LoginName"); + OSInfo = get_metadata(info, "OSInfo"); + agentFullname = get_metadata(info, "LoginName"); // Translate underscores back to spaces LLStringUtil::replaceChar(agentFullname, '_', ' '); regionName = get_metadata(info, "CurrentRegion"); @@ -219,7 +201,7 @@ CrashMetadata& CrashMetadata_instance() void infos(const std::string& message) { - LL_INFOS() << message << LL_ENDL; + LL_INFOS("InitOSX", "Bugsplat") << message << LL_ENDL; } int main( int argc, char **argv ) @@ -324,11 +306,12 @@ bool LLAppViewerMacOSX::restoreErrorTrap() unsigned int reset_count = 0; -#define SET_SIG(S) sigaction(SIGABRT, &act, &old_act); \ - if(act.sa_sigaction != old_act.sa_sigaction) \ - ++reset_count; +#define SET_SIG(SIGNAL) sigaction(SIGNAL, &act, &old_act); \ + if(act.sa_sigaction != old_act.sa_sigaction) ++reset_count; // Synchronous signals - SET_SIG(SIGABRT) +# ifndef LL_BUGSPLAT + SET_SIG(SIGABRT) // let bugsplat catch this +# endif SET_SIG(SIGALRM) SET_SIG(SIGBUS) SET_SIG(SIGFPE) @@ -366,7 +349,8 @@ std::string LLAppViewerMacOSX::generateSerialNumber() CFStringRef serialNumber = NULL; io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); - if (platformExpert) { + if (platformExpert) + { serialNumber = (CFStringRef) IORegistryEntryCreateCFProperty(platformExpert, CFSTR(kIOPlatformSerialNumberKey), kCFAllocatorDefault, 0); |