For science. Let's see if sentry.io accepts these annotations...
This commit is contained in:
@@ -182,10 +182,10 @@ public:
|
|||||||
bool operator! () const { return ! mListener; }
|
bool operator! () const { return ! mListener; }
|
||||||
|
|
||||||
/// explicit accessor
|
/// explicit accessor
|
||||||
const LLEventListener& getListener() const { return *mListener; }
|
const ::LLEventListener& getListener() const { return *mListener; }
|
||||||
|
|
||||||
/// implicit conversion to LLEventListener
|
/// implicit conversion to LLEventListener
|
||||||
operator LLEventListener() const { return *mListener; }
|
operator ::LLEventListener() const { return *mListener; }
|
||||||
|
|
||||||
/// allow calling directly
|
/// allow calling directly
|
||||||
bool operator()(const LLSD& event) const;
|
bool operator()(const LLSD& event) const;
|
||||||
@@ -277,7 +277,7 @@ namespace LLEventDetail
|
|||||||
/// Any callable capable of connecting an LLEventListener to an
|
/// Any callable capable of connecting an LLEventListener to an
|
||||||
/// LLStandardSignal to produce an LLBoundListener can be mapped to this
|
/// LLStandardSignal to produce an LLBoundListener can be mapped to this
|
||||||
/// signature.
|
/// signature.
|
||||||
typedef boost::function<LLBoundListener(const LLEventListener&)> ConnectFunc;
|
typedef boost::function<LLBoundListener(const ::LLEventListener&)> ConnectFunc;
|
||||||
|
|
||||||
/// overload of visit_and_connect() when we have a string identifier available
|
/// overload of visit_and_connect() when we have a string identifier available
|
||||||
template <typename LISTENER>
|
template <typename LISTENER>
|
||||||
@@ -547,7 +547,7 @@ private:
|
|||||||
virtual void reset();
|
virtual void reset();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual LLBoundListener listen_impl(const std::string& name, const LLEventListener&,
|
virtual LLBoundListener listen_impl(const std::string& name, const ::LLEventListener&,
|
||||||
const NameList& after,
|
const NameList& after,
|
||||||
const NameList& before);
|
const NameList& before);
|
||||||
std::string mName;
|
std::string mName;
|
||||||
@@ -845,7 +845,7 @@ namespace LLEventDetail
|
|||||||
* Visitor binds a reference to LLEventListener so we can track() any
|
* Visitor binds a reference to LLEventListener so we can track() any
|
||||||
* shared_ptrs we find in the argument list.
|
* shared_ptrs we find in the argument list.
|
||||||
*/
|
*/
|
||||||
Visitor(LLEventListener& listener):
|
Visitor(::LLEventListener& listener):
|
||||||
mListener(listener)
|
mListener(listener)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -988,7 +988,7 @@ namespace LLEventDetail
|
|||||||
|*==========================================================================*/
|
|*==========================================================================*/
|
||||||
|
|
||||||
/// Bind a reference to the LLEventListener to call its track() method.
|
/// Bind a reference to the LLEventListener to call its track() method.
|
||||||
LLEventListener& mListener;
|
::LLEventListener& mListener;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1005,7 +1005,7 @@ namespace LLEventDetail
|
|||||||
const ConnectFunc& connect_func)
|
const ConnectFunc& connect_func)
|
||||||
{
|
{
|
||||||
// Capture the listener
|
// Capture the listener
|
||||||
LLEventListener listener(raw_listener);
|
::LLEventListener listener(raw_listener);
|
||||||
// Define our Visitor, binding the listener so we can call
|
// Define our Visitor, binding the listener so we can call
|
||||||
// listener.track() if we discover any shared_ptr<Foo>.
|
// listener.track() if we discover any shared_ptr<Foo>.
|
||||||
LLEventDetail::Visitor visitor(listener);
|
LLEventDetail::Visitor visitor(listener);
|
||||||
|
|||||||
@@ -220,13 +220,40 @@
|
|||||||
#include <client/crashpad_client.h>
|
#include <client/crashpad_client.h>
|
||||||
#include <client/prune_crash_reports.h>
|
#include <client/prune_crash_reports.h>
|
||||||
#include <client/settings.h>
|
#include <client/settings.h>
|
||||||
|
#include <client/annotation.h>
|
||||||
|
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
|
|
||||||
#include "llnotificationsutil.h"
|
#include "llnotificationsutil.h"
|
||||||
#include "llversioninfo.h"
|
#include "llversioninfo.h"
|
||||||
|
|
||||||
|
|
||||||
|
template <size_t SIZE, crashpad::Annotation::Type T = crashpad::Annotation::Type::kString>
|
||||||
|
struct crashpad_annotation : public crashpad::Annotation {
|
||||||
|
std::array<char, SIZE> buffer;
|
||||||
|
crashpad_annotation(const char* name) : crashpad::Annotation(T, name, buffer.data())
|
||||||
|
{}
|
||||||
|
void set(const std::string& src) {
|
||||||
|
LL_INFOS() << name() << ": " << src.c_str() << LL_ENDL;
|
||||||
|
const size_t min_size = llmin(SIZE, src.size());
|
||||||
|
memcpy(buffer.data(), src.data(), min_size);
|
||||||
|
buffer.data()[SIZE - 1] = '\0';
|
||||||
|
SetSize(min_size);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#define DEFINE_CRASHPAD_ANNOTATION(name, len) \
|
||||||
|
static crashpad_annotation<len> g_crashpad_annotation_##name##_buffer(#name);
|
||||||
|
#define SET_CRASHPAD_ANNOTATION_VALUE(name, value) \
|
||||||
|
g_crashpad_annotation_##name##_buffer.set(value);
|
||||||
|
#else
|
||||||
|
#define SET_CRASHPAD_ANNOTATION_VALUE(name, value)
|
||||||
|
#define DEFINE_CRASHPAD_ANNOTATION(name, len)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
DEFINE_CRASHPAD_ANNOTATION(fatal_message, 512);
|
||||||
|
DEFINE_CRASHPAD_ANNOTATION(grid_name, 64);
|
||||||
|
DEFINE_CRASHPAD_ANNOTATION(cpu_string, 128);
|
||||||
|
DEFINE_CRASHPAD_ANNOTATION(startup_state, 32);
|
||||||
|
|
||||||
////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor
|
////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor
|
||||||
//
|
//
|
||||||
@@ -770,8 +797,18 @@ bool LLAppViewer::init()
|
|||||||
initCrashReporting();
|
initCrashReporting();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
writeDebugInfo();
|
||||||
|
|
||||||
setupErrorHandling();
|
setupErrorHandling();
|
||||||
|
|
||||||
|
{
|
||||||
|
auto fn = boost::bind<bool>([](const LLSD& stateInfo) -> bool {
|
||||||
|
SET_CRASHPAD_ANNOTATION_VALUE(startup_state, stateInfo["str"].asString());
|
||||||
|
return false;
|
||||||
|
}, _1);
|
||||||
|
LLStartUp::getStateEventPump().listen<::LLEventListener>("LLAppViewer", fn);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start of the application
|
// Start of the application
|
||||||
//
|
//
|
||||||
@@ -2741,6 +2778,10 @@ void LLAppViewer::writeDebugInfo(bool isStatic)
|
|||||||
|
|
||||||
isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file)
|
isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file)
|
||||||
: LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], out_file);
|
: LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], out_file);
|
||||||
|
#else
|
||||||
|
SET_CRASHPAD_ANNOTATION_VALUE(fatal_message, gDebugInfo["FatalMessage"].asString());
|
||||||
|
SET_CRASHPAD_ANNOTATION_VALUE(grid_name, gDebugInfo["GridName"].asString());
|
||||||
|
SET_CRASHPAD_ANNOTATION_VALUE(cpu_string, gDebugInfo["CPUInfo"]["CPUString"].asString());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ public:
|
|||||||
static bool startLLProxy(); // Initialize the SOCKS 5 proxy
|
static bool startLLProxy(); // Initialize the SOCKS 5 proxy
|
||||||
|
|
||||||
static LLViewerStats::PhaseMap& getPhases() { return *sPhases; }
|
static LLViewerStats::PhaseMap& getPhases() { return *sPhases; }
|
||||||
|
static LLEventPump& getStateEventPump() { return *sStateWatcher; }
|
||||||
private:
|
private:
|
||||||
static LLSLURL sStartSLURL;
|
static LLSLURL sStartSLURL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user