comment out code that would set annotations after StartHandler is called

This commit is contained in:
Seth Alves 2018-01-24 20:08:09 -08:00
parent c550620cb4
commit dbe9fd290e
4 changed files with 21 additions and 9 deletions

View file

@ -865,9 +865,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
_logger->setSessionID(accountManager->getSessionID());
#if HAS_CRASHPAD
backtraceAnnotations->SetKeyValue("MetaverseSessionID", accountManager->getSessionID());
#endif // HAS_CRASHPAD
setCrashAnnotation("metaverse_session_id", accountManager->getSessionID().toString().toStdString());
if (steamClient) {
qCDebug(interfaceapp) << "[VERSION] SteamVR buildID:" << steamClient->getSteamVRBuildID();

View file

@ -708,9 +708,5 @@ private:
std::atomic<bool> _pendingIdleEvent { true };
std::atomic<bool> _pendingRenderEvent { true };
#if HAS_CRASHPAD
crashpad::SimpleStringDictionary* crashpadAnnotations { nullptr };
#endif // HAS_CRASHPAD
};
#endif // hifi_Application_h

View file

@ -23,6 +23,8 @@
#include <client/crashpad_client.h>
#include <client/crash_report_database.h>
#include <client/settings.h>
// #include <client/annotation_list.h>
// #include <client/crashpad_info.h>
using namespace crashpad;
@ -31,15 +33,17 @@ static const std::string BACKTRACE_TOKEN { CMAKE_BACKTRACE_TOKEN };
extern QString qAppFileName();
// crashpad::AnnotationList* crashpadAnnotations { nullptr };
bool startCrashHandler() {
if (BACKTRACE_URL.empty() || BACKTRACE_TOKEN.empty()) {
return false;
}
CrashpadClient client;
std::map<std::string, std::string> annotations;
std::vector<std::string> arguments;
std::map<std::string, std::string> annotations;
annotations["token"] = BACKTRACE_TOKEN;
annotations["format"] = "minidump";
annotations["version"] = BuildInfo::VERSION.toStdString();
@ -75,12 +79,23 @@ bool startCrashHandler() {
return client.StartHandler(handler, db, db, BACKTRACE_URL, annotations, arguments, true, true);
}
#else
void setCrashAnnotation(std::string name, std::string value) {
// if (!crashpadAnnotations) {
// crashpadAnnotations = new crashpad::AnnotationList(); // don't free this, let it leak
// crashpad::CrashpadInfo* crashpad_info = crashpad::GetCrashpadInfo();
// crashpad_info->set_simple_annotations(crashpadAnnotations);
// }
// crashpadAnnotations->SetKeyValue(name, value);
}
#else
bool startCrashHandler() {
qDebug() << "No crash handler available.";
return false;
}
void setCrashAnnotation(std::string name, std::string value) {
}
#endif

View file

@ -12,6 +12,9 @@
#ifndef hifi_Crashpad_h
#define hifi_Crashpad_h
#include <string>
bool startCrashHandler();
void setCrashAnnotation(std::string name, std::string value);
#endif // hifi_Crashpad_h