Compare commits

...

3 Commits

4 changed files with 50 additions and 8 deletions

View File

@@ -182,10 +182,10 @@ public:
bool operator! () const { return ! mListener; }
/// explicit accessor
const LLEventListener& getListener() const { return *mListener; }
const ::LLEventListener& getListener() const { return *mListener; }
/// implicit conversion to LLEventListener
operator LLEventListener() const { return *mListener; }
operator ::LLEventListener() const { return *mListener; }
/// allow calling directly
bool operator()(const LLSD& event) const;
@@ -277,7 +277,7 @@ namespace LLEventDetail
/// Any callable capable of connecting an LLEventListener to an
/// LLStandardSignal to produce an LLBoundListener can be mapped to this
/// 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
template <typename LISTENER>
@@ -547,7 +547,7 @@ private:
virtual void reset();
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& before);
std::string mName;
@@ -845,7 +845,7 @@ namespace LLEventDetail
* Visitor binds a reference to LLEventListener so we can track() any
* shared_ptrs we find in the argument list.
*/
Visitor(LLEventListener& listener):
Visitor(::LLEventListener& listener):
mListener(listener)
{
}
@@ -988,7 +988,7 @@ namespace LLEventDetail
|*==========================================================================*/
/// 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)
{
// Capture the listener
LLEventListener listener(raw_listener);
::LLEventListener listener(raw_listener);
// Define our Visitor, binding the listener so we can call
// listener.track() if we discover any shared_ptr<Foo>.
LLEventDetail::Visitor visitor(listener);

View File

@@ -666,7 +666,7 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa
LLAvatarName av_name;
if (LLAvatarNameCache::get(agent_id, &av_name))
{
std::string label = av_name.getCompleteName();
std::string label = av_name.getNSName();
// handle suffixes like /mute or /offerteleport
label = localize_slapp_label(url, label);

View File

@@ -221,13 +221,40 @@
#include <client/crashpad_client.h>
#include <client/prune_crash_reports.h>
#include <client/settings.h>
#include <client/annotation.h>
#include <fmt/format.h>
#include "llnotificationsutil.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
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
//
@@ -771,8 +798,18 @@ bool LLAppViewer::init()
initCrashReporting();
#endif
writeDebugInfo();
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
//
@@ -2744,6 +2781,10 @@ void LLAppViewer::writeDebugInfo(bool isStatic)
isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, 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
}

View File

@@ -139,6 +139,7 @@ public:
static bool startLLProxy(); // Initialize the SOCKS 5 proxy
static LLViewerStats::PhaseMap& getPhases() { return *sPhases; }
static LLEventPump& getStateEventPump() { return *sStateWatcher; }
private:
static LLSLURL sStartSLURL;