// static void LLWinDebug::generateMinidump(struct _EXCEPTION_POINTERS *exception_infop) { std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLifeException"); if (exception_infop) { // Since there is exception info... Release the hounds. gEmergencyMemoryReserve.release(); _MINIDUMP_EXCEPTION_INFORMATION ExInfo; ExInfo.ThreadId = ::GetCurrentThreadId(); ExInfo.ExceptionPointers = exception_infop; ExInfo.ClientPointers = NULL; writeDumpToFile((MINIDUMP_TYPE)(MiniDumpWithDataSegs | MiniDumpWithIndirectlyReferencedMemory), &ExInfo, "SecondLife.dmp"); } }
// static void LLWinDebug::generateCrashStacks(struct _EXCEPTION_POINTERS *exception_infop) { // *NOTE:Mani - This method is no longer the exception handler. // Its called from viewer_windows_exception_handler() and other places. // // Let go of a bunch of reserved memory to give library calls etc // a chance to execute normally in the case that we ran out of // memory. // LLSD info; std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "PhoenixViewerException"); std::string log_path = dump_path + ".log"; if (exception_infop) { // Since there is exception info... Release the hounds. gEmergencyMemoryReserve.release(); if(gSavedSettings.getControl("SaveMinidump").notNull() && gSavedSettings.getBOOL("SaveMinidump")) { _MINIDUMP_EXCEPTION_INFORMATION ExInfo; ExInfo.ThreadId = ::GetCurrentThreadId(); ExInfo.ExceptionPointers = exception_infop; ExInfo.ClientPointers = NULL; writeDumpToFile(MiniDumpNormal, &ExInfo, "PhoenixViewer.dmp"); writeDumpToFile((MINIDUMP_TYPE)(MiniDumpWithDataSegs | MiniDumpWithIndirectlyReferencedMemory), &ExInfo, "PhoenixViewerPlus.dmp"); } info = Get_Exception_Info(exception_infop); } LLSD threads; std::vector<DWORD> thread_ids; GetProcessThreadIDs(GetCurrentProcessId(), thread_ids); for(std::vector<DWORD>::iterator th_itr = thread_ids.begin(); th_itr != thread_ids.end(); ++th_itr) { LLSD thread_info; if(*th_itr != GetCurrentThreadId()) { GetThreadCallStack(*th_itr, thread_info); } if(thread_info) { threads[llformat("ID %d", *th_itr)] = thread_info; } } info["Threads"] = threads; llofstream out_file(log_path); LLSDSerialize::toPrettyXML(info, out_file); out_file.close(); }