diff options
author | Jacek Antonelli | 2009-11-19 04:19:06 -0600 |
---|---|---|
committer | Jacek Antonelli | 2009-11-19 04:19:06 -0600 |
commit | 1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427 (patch) | |
tree | e09ccbc010e326a48fd91ba15b58afd7fb836b3f /linden/indra/llcommon/llerror.h | |
parent | Fixed minor formatting issue in MANIFESTO.txt. (diff) | |
parent | Fixed CMake setting errors (diff) | |
download | meta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.zip meta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.tar.gz meta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.tar.bz2 meta-impy-1d443b7a94ed6f9ef1d408caef72fcbc0b1ee427.tar.xz |
Merge remote branch 'mccabe/1.3.0-next' into next
Conflicts:
linden/indra/cmake/00-Common.cmake
linden/indra/newview/skins/default/xui/de/floater_about.xml
linden/indra/newview/skins/default/xui/fr/floater_about.xml
linden/indra/newview/skins/default/xui/ja/floater_about.xml
linden/indra/newview/skins/default/xui/ko/floater_about.xml
linden/indra/newview/skins/default/xui/zh/floater_about.xml
linden/install.xml
Diffstat (limited to 'linden/indra/llcommon/llerror.h')
-rw-r--r-- | linden/indra/llcommon/llerror.h | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/linden/indra/llcommon/llerror.h b/linden/indra/llcommon/llerror.h index 211f89f..6794be4 100644 --- a/linden/indra/llcommon/llerror.h +++ b/linden/indra/llcommon/llerror.h | |||
@@ -18,7 +18,8 @@ | |||
18 | * There are special exceptions to the terms and conditions of the GPL as | 18 | * There are special exceptions to the terms and conditions of the GPL as |
19 | * it is applied to this Source Code. View the full text of the exception | 19 | * it is applied to this Source Code. View the full text of the exception |
20 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 20 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
21 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 21 | * online at |
22 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
22 | * | 23 | * |
23 | * By copying, modifying or distributing this software, you acknowledge | 24 | * By copying, modifying or distributing this software, you acknowledge |
24 | * that you have read and understood your obligations described above, | 25 | * that you have read and understood your obligations described above, |
@@ -37,6 +38,7 @@ | |||
37 | #include <typeinfo> | 38 | #include <typeinfo> |
38 | 39 | ||
39 | #include "llerrorlegacy.h" | 40 | #include "llerrorlegacy.h" |
41 | #include "stdtypes.h" | ||
40 | 42 | ||
41 | 43 | ||
42 | /* Error Logging Facility | 44 | /* Error Logging Facility |
@@ -134,6 +136,7 @@ namespace LLError | |||
134 | public: | 136 | public: |
135 | static bool shouldLog(CallSite&); | 137 | static bool shouldLog(CallSite&); |
136 | static std::ostringstream* out(); | 138 | static std::ostringstream* out(); |
139 | static void flush(std::ostringstream* out, char* message) ; | ||
137 | static void flush(std::ostringstream*, const CallSite&); | 140 | static void flush(std::ostringstream*, const CallSite&); |
138 | }; | 141 | }; |
139 | 142 | ||
@@ -178,9 +181,41 @@ namespace LLError | |||
178 | 181 | ||
179 | class NoClassInfo { }; | 182 | class NoClassInfo { }; |
180 | // used to indicate no class info known for logging | 183 | // used to indicate no class info known for logging |
181 | } | ||
182 | 184 | ||
185 | //LLCallStacks keeps track of call stacks and output the call stacks to log file | ||
186 | //when LLAppViewer::handleViewerCrash() is triggered. | ||
187 | // | ||
188 | //Note: to be simple, efficient and necessary to keep track of correct call stacks, | ||
189 | //LLCallStacks is designed not to be thread-safe. | ||
190 | //so try not to use it in multiple parallel threads at same time. | ||
191 | //Used in a single thread at a time is fine. | ||
192 | class LLCallStacks | ||
193 | { | ||
194 | private: | ||
195 | static char** sBuffer ; | ||
196 | static S32 sIndex ; | ||
197 | |||
198 | public: | ||
199 | static void push(const char* function, const int line) ; | ||
200 | static std::ostringstream* insert(const char* function, const int line) ; | ||
201 | static void print() ; | ||
202 | static void clear() ; | ||
203 | static void end(std::ostringstream* _out) ; | ||
204 | }; | ||
205 | } | ||
183 | 206 | ||
207 | //this is cheaper than llcallstacks if no need to output other variables to call stacks. | ||
208 | #define llpushcallstacks LLError::LLCallStacks::push(__FUNCTION__, __LINE__) | ||
209 | #define llcallstacks \ | ||
210 | {\ | ||
211 | std::ostringstream* _out = LLError::LLCallStacks::insert(__FUNCTION__, __LINE__) ; \ | ||
212 | (*_out) | ||
213 | #define llcallstacksendl \ | ||
214 | LLError::End(); \ | ||
215 | LLError::LLCallStacks::end(_out) ; \ | ||
216 | } | ||
217 | #define llclearcallstacks LLError::LLCallStacks::clear() | ||
218 | #define llprintcallstacks LLError::LLCallStacks::print() | ||
184 | 219 | ||
185 | /* | 220 | /* |
186 | Class type information for logging | 221 | Class type information for logging |