diff options
Diffstat (limited to 'indra/mac_crash_logger')
| -rw-r--r-- | indra/mac_crash_logger/CMakeLists.txt | 38 | ||||
| -rw-r--r-- | indra/mac_crash_logger/CrashReporter.nib/classes.nib | 8 | ||||
| -rw-r--r-- | indra/mac_crash_logger/CrashReporter.nib/info.nib | 18 | ||||
| -rw-r--r-- | indra/mac_crash_logger/CrashReporter.nib/objects.xib | 68 | ||||
| -rw-r--r-- | indra/mac_crash_logger/Info.plist | 26 | ||||
| -rw-r--r-- | indra/mac_crash_logger/llcrashloggermac.cpp | 124 | ||||
| -rw-r--r-- | indra/mac_crash_logger/llcrashloggermac.h | 37 | ||||
| -rw-r--r-- | indra/mac_crash_logger/mac_crash_logger.cpp | 35 |
8 files changed, 204 insertions, 150 deletions
diff --git a/indra/mac_crash_logger/CMakeLists.txt b/indra/mac_crash_logger/CMakeLists.txt index c8eb17e325..420e836e36 100644 --- a/indra/mac_crash_logger/CMakeLists.txt +++ b/indra/mac_crash_logger/CMakeLists.txt @@ -3,7 +3,6 @@ project(mac_crash_logger) include(00-Common) -include(Boost) include(LLCommon) include(LLCrashLogger) include(LLMath) @@ -11,6 +10,7 @@ include(LLMessage) include(LLVFS) include(LLXML) include(Linking) +include(LLSharedLibs) include_directories( ${LLCOMMON_INCLUDE_DIRS} @@ -33,10 +33,27 @@ set(mac_crash_logger_HEADER_FILES set_source_files_properties(${mac_crash_logger_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) - list(APPEND mac_crash_logger_SOURCE_FILES ${mac_crash_logger_HEADER_FILES}) -add_executable(mac-crash-logger ${mac_crash_logger_SOURCE_FILES}) +set(mac_crash_logger_RESOURCE_FILES + CrashReporter.nib/ + ) +set_source_files_properties( + ${mac_crash_logger_RESOURCE_FILES} + PROPERTIES + HEADER_FILE_ONLY TRUE + ) +SOURCE_GROUP("Resources" FILES ${mac_crash_logger_RESOURCE_FILES}) +list(APPEND mac_crash_logger_SOURCE_FILES ${mac_crash_logger_RESOURCE_FILES}) + +add_executable(mac-crash-logger + MACOSX_BUNDLE + ${mac_crash_logger_SOURCE_FILES}) + +set_target_properties(mac-crash-logger + PROPERTIES + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist + ) target_link_libraries(mac-crash-logger ${LLCRASHLOGGER_LIBRARIES} @@ -46,5 +63,18 @@ target_link_libraries(mac-crash-logger ${LLVFS_LIBRARIES} ${LLMATH_LIBRARIES} ${LLCOMMON_LIBRARIES} - ${BOOST_SIGNALS_LIBRARY} ) + +add_custom_command( + TARGET mac-crash-logger POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS + -E + copy_directory + ${CMAKE_CURRENT_SOURCE_DIR}/CrashReporter.nib + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mac-crash-logger.app/Contents/Resources/CrashReporter.nib + ) + +ll_deploy_sharedlibs_command(mac-crash-logger) + + diff --git a/indra/mac_crash_logger/CrashReporter.nib/classes.nib b/indra/mac_crash_logger/CrashReporter.nib/classes.nib new file mode 100644 index 0000000000..c4b887e72b --- /dev/null +++ b/indra/mac_crash_logger/CrashReporter.nib/classes.nib @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IBVersion</key> + <string>1</string> +</dict> +</plist> diff --git a/indra/mac_crash_logger/CrashReporter.nib/info.nib b/indra/mac_crash_logger/CrashReporter.nib/info.nib new file mode 100644 index 0000000000..06805c0e4f --- /dev/null +++ b/indra/mac_crash_logger/CrashReporter.nib/info.nib @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IBFramework Version</key> + <string>629</string> + <key>IBLastKnownRelativeProjectPath</key> + <string>../../build-darwin-i386/SecondLife.xcodeproj</string> + <key>IBOldestOS</key> + <integer>5</integer> + <key>IBOpenObjects</key> + <array/> + <key>IBSystem Version</key> + <string>9E17</string> + <key>targetFramework</key> + <string>IBCarbonFramework</string> +</dict> +</plist> diff --git a/indra/mac_crash_logger/CrashReporter.nib/objects.xib b/indra/mac_crash_logger/CrashReporter.nib/objects.xib new file mode 100644 index 0000000000..634d1c5321 --- /dev/null +++ b/indra/mac_crash_logger/CrashReporter.nib/objects.xib @@ -0,0 +1,68 @@ +<?xml version="1.0" standalone="yes"?> +<object class="NSIBObjectData"> + <object name="rootObject" class="NSCustomObject" id="1"> + </object> + <array count="7" name="allObjects"> + <object class="IBCarbonButton" id="182"> + <ostype name="command">ok </ostype> + <string name="title">Send Report</string> + <string name="bounds">414 273 434 378 </string> + </object> + <object class="IBCarbonButton" id="183"> + <ostype name="command">not!</ostype> + <int name="buttonType">2</int> + <string name="title">Don't Send</string> + <string name="bounds">414 390 434 487 </string> + </object> + <object class="IBCarbonStaticText" id="181"> + <string name="title">Second Life appears to have crashed or frozen the last time it ran. This crash reporter collects information about your computer's hardware configuration, operating system, and some Second Life logs, all of which are used for debugging purposes only. In the space below, please briefly describe what you were doing or trying to do just prior to the crash. Thank you for your help! This report is NOT read by Customer Support. If you have billing or other questions, please go to: http://www.secondlife.com/support/ If you don't wish to send Linden Lab a crash report, press Cancel. </string> + <string name="bounds">20 20 231 487 </string> + </object> + <object class="IBCarbonWindow" id="166"> + <int name="carbonWindowClass">2</int> + <int name="themeBrush">3</int> + <int name="windowPosition">7</int> + <string name="title">Second Life Crash Logger</string> + <object name="rootControl" class="IBCarbonRootControl" id="167"> + <array count="5" name="subviews"> + <reference idRef="181"/> + <reference idRef="182"/> + <reference idRef="183"/> + <object class="IBCarbonEditText" id="185"> + <ostype name="controlSignature">text</ostype> + <boolean name="isUnicode">TRUE</boolean> + <string name="bounds">242 23 391 484 </string> + </object> + <object class="IBCarbonCheckBox" id="193"> + <ostype name="controlSignature">remb</ostype> + <string name="title">Remember This Choice</string> + <string name="bounds">415 20 433 186 </string> + </object> + </array> + <string name="bounds">0 0 454 507 </string> + </object> + <string name="windowRect">257 653 711 1160 </string> + <string name="ScreenRectAtEncodeTime">0 0 768 1024 </string> + </object> + <reference idRef="185"/> + <reference idRef="167"/> + <reference idRef="193"/> + </array> + <array count="7" name="allParents"> + <reference idRef="167"/> + <reference idRef="167"/> + <reference idRef="167"/> + <reference idRef="1"/> + <reference idRef="167"/> + <reference idRef="166"/> + <reference idRef="167"/> + </array> + <dictionary count="2" name="nameTable"> + <string>CrashReporter</string> + <reference idRef="166"/> + <string>File's Owner</string> + <reference idRef="1"/> + </dictionary> + <string name="targetFramework">IBCarbonFramework</string> + <unsigned_int name="nextObjectID">194</unsigned_int> +</object> diff --git a/indra/mac_crash_logger/Info.plist b/indra/mac_crash_logger/Info.plist new file mode 100644 index 0000000000..f48293e825 --- /dev/null +++ b/indra/mac_crash_logger/Info.plist @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>mac-crash-logger</string> + <key>CFBundleGetInfoString</key> + <string></string> + <key>CFBundleIconFile</key> + <string></string> + <key>CFBundleIdentifier</key> + <string>com.secondlife.indra.crashreporter</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleShortVersionString</key> + <string></string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>1.0.0</string> +</dict> +</plist> diff --git a/indra/mac_crash_logger/llcrashloggermac.cpp b/indra/mac_crash_logger/llcrashloggermac.cpp index 767327f95f..bec8cce04e 100644 --- a/indra/mac_crash_logger/llcrashloggermac.cpp +++ b/indra/mac_crash_logger/llcrashloggermac.cpp @@ -2,30 +2,25 @@ * @file llcrashloggermac.cpp * @brief Mac OSX crash logger implementation * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2007, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2003&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -57,7 +52,7 @@ LLFILE *gDebugFile = NULL; WindowRef gWindow = NULL; EventHandlerRef gEventHandler = NULL; -LLString gUserNotes = ""; +std::string gUserNotes = ""; bool gSendReport = false; bool gRememberChoice = false; IBNibRef nib = NULL; @@ -133,6 +128,8 @@ OSStatus dialogHandler(EventHandlerCallRef handler, EventRef event, void *userda QuitAppModalLoopForWindow(gWindow); result = noErr; break; + default: + result = eventNotHandledErr; } } } @@ -208,89 +205,6 @@ bool LLCrashLoggerMac::init(void) void LLCrashLoggerMac::gatherPlatformSpecificFiles() { updateApplication("Gathering hardware information..."); - char path[MAX_PATH]; - FSRef folder; - - if(FSFindFolder(kUserDomain, kLogsFolderType, false, &folder) == noErr) - { - // folder is an FSRef to ~/Library/Logs/ - if(FSRefMakePath(&folder, (UInt8*)&path, sizeof(path)) == noErr) - { - struct stat dw_stat; - LLString mBuf; - bool isLeopard = false; - // Try the 10.3 path first... - LLString dw_file_name = LLString(path) + LLString("/CrashReporter/Second Life.crash.log"); - int res = stat(dw_file_name.c_str(), &dw_stat); - - if (res) - { - // Try the 10.2 one next... - dw_file_name = LLString(path) + LLString("/Second Life.crash.log"); - res = stat(dw_file_name.c_str(), &dw_stat); - } - - if(res) - { - //10.5: Like 10.3+, except it puts the crash time in the file instead of dividing it up - //using asterisks. Get a directory listing, search for files starting with second life, - //use the last one found. - LLString old_file_name, current_file_name, pathname, mask; - pathname = LLString(path) + LLString("/CrashReporter/"); - mask = "Second Life*"; - while(gDirUtilp->getNextFileInDir(pathname, mask, current_file_name, false)) - { - old_file_name = current_file_name; - } - if(old_file_name != "") - { - dw_file_name = pathname + old_file_name; - res=stat(dw_file_name.c_str(), &dw_stat); - isLeopard = true; - } - } - - if (!res) - { - std::ifstream fp(dw_file_name.c_str()); - std::stringstream str; - if(!fp.is_open()) return; - str << fp.rdbuf(); - mBuf = str.str(); - - if(!isLeopard) - { - // Crash logs consist of a number of entries, one per crash. - // Each entry is preceeded by "**********" on a line by itself. - // We want only the most recent (i.e. last) one. - const char *sep = "**********"; - const char *start = mBuf.c_str(); - const char *cur = start; - const char *temp = strstr(cur, sep); - - while(temp != NULL) - { - // Skip past the marker we just found - cur = temp + strlen(sep); /* Flawfinder: ignore */ - - // and try to find another - temp = strstr(cur, sep); - } - - // If there's more than one entry in the log file, strip all but the last one. - if(cur != start) - { - mBuf.erase(0, cur - start); - } - } - mCrashInfo["CrashLog"] = mBuf; - } - else - { - llwarns << "Couldn't find any CrashReporter files..." << llendl; - } - } - } } bool LLCrashLoggerMac::mainLoop() @@ -331,7 +245,7 @@ bool LLCrashLoggerMac::mainLoop() return true; } -void LLCrashLoggerMac::updateApplication(LLString message) +void LLCrashLoggerMac::updateApplication(const std::string& message) { LLCrashLogger::updateApplication(); } diff --git a/indra/mac_crash_logger/llcrashloggermac.h b/indra/mac_crash_logger/llcrashloggermac.h index cf4e766bda..4b1d235f24 100644 --- a/indra/mac_crash_logger/llcrashloggermac.h +++ b/indra/mac_crash_logger/llcrashloggermac.h @@ -2,30 +2,25 @@ * @file llcrashloggermac.h * @brief Mac OSX crash logger definition * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2007, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2003&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -43,7 +38,7 @@ public: ~LLCrashLoggerMac(void); virtual bool init(); virtual bool mainLoop(); - virtual void updateApplication(LLString message = ""); + virtual void updateApplication(const std::string& message = LLStringUtil::null); virtual bool cleanup(); virtual void gatherPlatformSpecificFiles(); }; diff --git a/indra/mac_crash_logger/mac_crash_logger.cpp b/indra/mac_crash_logger/mac_crash_logger.cpp index bf3151a490..20b491c401 100644 --- a/indra/mac_crash_logger/mac_crash_logger.cpp +++ b/indra/mac_crash_logger/mac_crash_logger.cpp @@ -2,30 +2,25 @@ * @file mac_crash_logger.cpp * @brief Mac OSX crash logger implementation * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2007, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2003&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ |
