Commit Graph

38 Commits (a17fd2352a9746dd3116f956dcc554f95f17e770)

Author SHA1 Message Date
Ansariel 5f1a19af72 Merge remote-tracking branch 'LL/marchcat/x-ws-merge'
# Conflicts:
#	autobuild.xml
#	indra/linux_crash_logger/llcrashloggerlinux.cpp
#	indra/newview/llappviewerlinux_api.h
#	indra/newview/llappviewerlinux_api_dbus.cpp
#	indra/newview/llappviewerlinux_api_dbus.h
#	indra/newview/llavatarpropertiesprocessor.h
#	indra/newview/llcallbacklist.cpp
#	indra/newview/llimpanel.h
2024-05-01 12:30:57 +02:00
Andrey Lihatskiy 1b68f71348 #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed 2024-04-29 07:56:09 +03:00
Ansariel 45dc1a63f0 Merge branch 'DRTVWR-599-maint-Z' of https://github.com/secondlife/viewer
# Conflicts:
#	indra/llprimitive/lldaeloader.cpp
#	indra/llui/lllayoutstack.cpp
#	indra/llui/llnotifications.h
#	indra/llui/lltoolbar.cpp
#	indra/newview/CMakeLists.txt
#	indra/newview/llagent.cpp
#	indra/newview/llappviewer.cpp
#	indra/newview/llfloaterimcontainer.cpp
#	indra/newview/llfloaterimnearbychathandler.h
#	indra/newview/llinventoryfunctions.cpp
#	indra/newview/llpaneloutfitsinventory.h
#	indra/newview/llsidepanelappearance.h
#	indra/newview/lltoolbarview.cpp
2024-01-12 14:18:34 +01:00
AiraYumi 7c8907522f replace boost library to standard 2024-01-08 23:29:21 +02:00
Nicky 0dfe0f888e Add pragma for GCC 2022-03-02 14:46:06 +01:00
Nat Goodspeed c9fc4349b7 SL-10297: Move LL_ERRS crash location into the LL_ERRS macro itself.
Introduce Oz's LLERROR_CRASH macro analogous to the old LLError::crashAndLoop()
function. Change LL_ENDL macro so that, after calling flush(), if the CallSite
is for LEVEL_ERROR, we invoke LLERROR_CRASH right there.

Change the meaning of LLError::FatalFunction. It used to be responsible for
the actual crash (hence crashAndLoop()). Now, instead, its role is to disrupt
control flow in some other way if you DON'T want to crash: throw an exception,
or call exit() or some such. Any FatalFunction that returns normally will fall
into the new crash in LL_ENDL.

Accordingly, the new default FatalFunction is a no-op lambda. This eliminates
the need to test for empty (not set) FatalFunction in Log::flush().

Remove LLError::crashAndLoop() because the official LL_ERRS crash is now in
LL_ENDL.

One of the two common use cases for setFatalFunction() used to be to intercept
control in the last moments before crashing -- not to crash or to avoid
crashing, but to capture the LL_ERRS message in some way. Especially when
that's temporary, though (e.g. LLLeap), saving and restoring the previous
FatalFunction only works when the lifespans of the relevant objects are
strictly LIFO.

Either way, that's a misuse of FatalFunction. Fortunately the Recorder
mechanism exactly addresses that case. Introduce a GenericRecorder template
subclass, with LLError::addGenericRecorder(callable) that accepts a callable
with suitable (level, message) signature, instantiates a GenericRecorder, adds
it to the logging machinery and returns the RecorderPtr for possible later use
with removeRecorder().

Change llappviewer.cpp's errorCallback() to an addGenericRecorder() callable.
Its role was simply to update gDebugInfo["FatalMessage"] with the LL_ERRS
message, then call writeDebugInfo(), before calling crashAndLoop() to finish
crashing. Remove the crashAndLoop() call, retaining the gDebugInfo logic. Pass
errorCallback() to LLError::addGenericRecorder() instead of setFatalFunction().

Oddly, errorCallback()'s crashAndLoop() call was conditional on a compile-time
SHADER_CRASH_NONFATAL symbol. The new mechanism provides no way to support
SHADER_CRASH_NONFATAL -- it is a Bad Idea to return normally from any LL_ERRS
invocation!

Rename LLLeapImpl::fatalFunction() to onError(). Instead of passing it to
LLError::setFatalFunction(), pass it to addGenericRecorder(). Capture the
returned RecorderPtr in mRecorder, replacing mPrevFatalFunction. Then
~LLLeapImpl() calls removeRecorder(mRecorder) instead of restoring
mPrevFatalFunction (which, as noted above, was order-sensitive).

Of course, every enabled Recorder is called with every log message. onError()
and errorCallback() must specifically test for calls with LEVEL_ERROR.

LLSingletonBase::logerrs() used to call LLError::getFatalFunction(), check the
return and call it if non-empty, else call LLError::crashAndLoop(). Replace
all that with LLERROR_CRASH.

Remove from llappviewer.cpp the watchdog_llerrs_callback() and
watchdog_killer_callback() functions. watchdog_killer_callback(), passed to
Watchdog::init(), used to setFatalFunction(watchdog_llerrs_callback) and then
invoke LL_ERRS() -- which seems a bit roundabout. watchdog_llerrs_callback(),
in turn, replicated much of the logic in the primary errorCallback() function
before replicating the crash from llwatchdog.cpp's default_killer_callback().

Instead, pass LLWatchdog::init() a lambda that invokes the LL_ERRS() message
formerly found in watchdog_killer_callback(). It no longer needs to override
FatalFunction with watchdog_llerrs_callback() because errorCallback() will
still be called as a Recorder, obviating watchdog_llerrs_callback()'s first
half; and LL_ENDL will handle the crash, obviating the second half.

Remove from llappviewer.cpp the static fast_exit() function, which was simply
an alias for _exit() acceptable to boost::bind(). Use a lambda directly
calling _exit() instead of using boost::bind() at all.

In the CaptureLog class in llcommon/tests/wrapllerrs.h, instead of statically
referencing the wouldHaveCrashed() function from test.cpp, simply save and
restore the current FatalFunction across the LLError::saveAndResetSettings()
call.

llerror_test.cpp calls setFatalFunction(fatalCall), where fatalCall() was a
function that simply set a fatalWasCalled bool rather than actually crashing
in any way. Of course, that implementation would now lead to crashing the test
program. Make fatalCall() throw a new FatalWasCalled exception. Introduce a
CATCH(LL_ERRS("tag"), "message") macro that expands to:
LL_ERRS("tag") << "message" << LL_ENDL;
within a try/catch block that catches FatalWasCalled and sets the same bool.

Change all existing LL_ERRS() in llerror_test.cpp to corresponding CATCH()
calls. In fact there's also an LL_DEBUGS(bad tag) invocation that exercises an
LL_ERRS internal to llerror.cpp; wrap that too.
2021-05-11 21:42:14 -04:00
Nat Goodspeed cd9d051b90 DRTVWR-447: Move test<5> and writeMsgNeedsEscaping() into sequence. 2018-10-17 16:42:59 -04:00
Oz Linden 00a839d665 renumber the new test to replace the one that was removed 2018-10-16 16:18:31 -04:00
Oz Linden d87cc1859f Modify logging so that the in-viewer console and stderr do not escape line breaks
Improve the implementation so that escaping is computed only once
2018-10-11 14:17:52 -04:00
Oz Linden f1d4e788e7 SL-967 simplify viewer log file field syntax
MAINT-8991: only escape log message characters once, add unit test
remove extra log line created by LL_ERRS
document that tags may not contain spaces
2018-08-29 16:43:45 -04:00
Glenn Glazer 86be29fe80 merge maint-6633 to fork of viewer-bear 2016-10-11 14:42:58 -07:00
Glenn Glazer 19f576872a maint-6633: space, the final frontier 2016-10-11 11:41:25 -07:00
Glenn Glazer e6043fad2a maint-6633: space after colon 2016-10-11 09:21:33 -07:00
Glenn Glazer cea2e4a7ad maint-6633: fix spacing 2016-10-10 15:14:46 -07:00
Glenn Glazer acfbcc7352 maint-6633: move INFO around 2016-10-10 14:15:29 -07:00
Glenn Glazer c39b7f2d88 maint-6633: fix tyop 2016-10-10 13:37:42 -07:00
Glenn Glazer 972b0b2f1b maint-6633: fix unit test to conform with new desired ordering 2016-10-10 12:31:01 -07:00
Nat Goodspeed 0c2442eb68 MAINT-5011: Fix abbreviateFile() test to run under .../indra/ path.
This particular test relied on there being exactly one instance of the string
"indra" in the source file's __FILE__ path -- which is usually true, but not
if the developer clones the viewer source repo under a parent directory whose
path itself contains "indra". Fix to handle any number of occurrences.
2016-08-29 18:48:47 +00:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
Nat Goodspeed 1bd8a67dcb Isolate #pragma clang to __clang__ compilations.
It's very irritating that Visual Studio produces a warning for unrecognized
#pragmas, which we then merrily turn into an error -- #pragma is inherently
compiler-specific!
2014-12-16 13:54:29 -05:00
Oz Linden 9e9779d3f8 Remove unit test case that relied on undefined order of evaluation
in: 'cout << a() << b()' the order of evaluation of a() and b() is undefined.
2014-10-22 21:20:10 -04:00
Oz Linden 25dcb53aa2 merge with more fixes from callum 2014-10-22 16:46:12 -04:00
Oz Linden 04291ba319 correct merge error in llerror_test.cpp 2014-10-22 16:42:18 -04:00
callum_linden 0bcfb017ce Update to build on Xcode 6.0 (fix unit tests): skip llerror_test test for now - operator << issues on clang 2014-10-22 11:03:00 -07:00
callum_linden 428adcb35c Update to build on Xcode 6.0 (fix unit tests): remove unused functions that trigger clang warnings 2014-10-22 10:12:36 -07:00
Oz Linden 98d8313847 added skip to llerror_test of nested logging, noted in todo file 2014-10-22 12:00:03 -04:00
Stinson Linden 08e83a341e MAINT-4009: Final pass refactoring to eliminate memory allocation related to error reporting that is not properly cleaned up. 2014-05-17 00:41:36 +01:00
Stinson Linden 34b2f2d1f8 MAINT-4009: First pass refactoring to eliminate memory related to error reporting that is not properly cleaned up. 2014-05-16 22:44:25 +01:00
Richard Linden cc31b4ae79 SH-4399 FIX: Interesting: Texture console MB Bound 0/384 and texture queue bounces once per second
SH-4346 FIX: Interesting: some integer Statistics are displayed as floating point after crossing region boundary
made llerrs/infos/etc properly variadic wrt tags
LL_INFOS("A", "B", "C") works, for example
fixed unit tests
remove llsimplestat
2013-08-12 20:05:16 -07:00
Graham Madarasz bf6182daa8 Update Mac and Windows breakpad builds to latest 2013-03-29 07:50:08 -07:00
Nat Goodspeed eb1bea2223 IQA-463: LLError::addRecorder() claims ownership of passed Recorder*.
That is, when the underlying LLError::Settings object is destroyed -- possibly
at termination, possibly on LLError::restoreSettings() -- the passed Recorder*
is deleted.
There was much existing code that seemed as unaware of this alarming fact as I
was myself. Passing to addRecorder() a pointer to a stack object, or to a
member of some other object, is just Bad. It might be preferable to make
addRecorder() accept std::auto_ptr<Recorder> to make the ownership transfer
more explicit -- or even boost::shared_ptr<Recorder> instead, which would
allow the caller to either forget or retain the passed Recorder.
This preliminary pass retains the Recorder* dumb pointer API, but documents
the ownership issue, and eliminates known instances of passing pointers to
anything but a standalone heap Recorder subclass object.
2012-04-23 11:26:18 -04:00
Merov Linden ae1435e8ee Autobuild: fix for Mac build using XCode 2011-02-17 21:13:48 -08:00
Oz Linden 06b0d72efa Change license from GPL to LGPL (version 2.1) 2010-08-13 07:24:57 -04:00
Tofu Linden 15b855409a Fix a long-suffering logging unit test failure, re-enable the test.
This makes logs look less scary on Linux, in-line with other platforms.
2010-06-04 13:58:19 +01:00
Nat Goodspeed 97f97f286c Skip logging test that fails on Linux, no idea why 2009-12-03 09:14:17 -08:00
Adam Moss e922089ff4 DEV-41080 more automated testing love - minor comment fixing. 2009-10-16 12:39:05 +00:00
Adam Moss ad583afe2c DEV-41354 #includes tidyup. 2009-10-15 18:12:10 +00:00
Adam Moss db6dff1d1f DEV-41354 convert llerror tut test into a llcommon integration test 2009-10-15 18:10:46 +00:00