From 5345d1e115fdf3fca7ea3e8330f1a23ad19257c8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 26 Jan 2016 08:23:40 -0500 Subject: SL-315 WIP - added a call stack extractor for windows to help with tracing joint issues (of course, could be used for other things as well). --- indra/llcommon/llcallstack.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 indra/llcommon/llcallstack.h (limited to 'indra/llcommon/llcallstack.h') diff --git a/indra/llcommon/llcallstack.h b/indra/llcommon/llcallstack.h new file mode 100644 index 0000000000..6059d4f2c5 --- /dev/null +++ b/indra/llcommon/llcallstack.h @@ -0,0 +1,38 @@ +/** + * @file llcallstack.h + * @brief run-time extraction of the current callstack + * + * $LicenseInfo:firstyear=2016&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2016, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +class LLCallStackImpl; + +class LLCallStack +{ +public: + LLCallStack(); + std::vector m_strings; +private: + static LLCallStackImpl *s_impl; +}; + +LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLCallStack& call_stack); -- cgit v1.2.3 From e91a192301db37f99a4f5a817f3b4c47b448417a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 26 Jan 2016 11:11:52 -0500 Subject: SL-315 WIP - added callstack info to joint debugging. Made joint debugging run-time configurable via debug setting DebugAvatarJoints --- indra/llcommon/llcallstack.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llcommon/llcallstack.h') diff --git a/indra/llcommon/llcallstack.h b/indra/llcommon/llcallstack.h index 6059d4f2c5..598db3d404 100644 --- a/indra/llcommon/llcallstack.h +++ b/indra/llcommon/llcallstack.h @@ -29,10 +29,11 @@ class LLCallStackImpl; class LLCallStack { public: - LLCallStack(); + LLCallStack(S32 skip_count=0); std::vector m_strings; private: static LLCallStackImpl *s_impl; + S32 m_skipCount; }; LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLCallStack& call_stack); -- cgit v1.2.3 From c92079db31f60196c2c70d6733aeaaaa40f1f485 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 28 Jan 2016 10:40:38 -0500 Subject: SL-315 - verbose option for CallStack objects, doc headers in StackWalker.{h,cpp} --- indra/llcommon/llcallstack.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llcommon/llcallstack.h') diff --git a/indra/llcommon/llcallstack.h b/indra/llcommon/llcallstack.h index 598db3d404..44a572838e 100644 --- a/indra/llcommon/llcallstack.h +++ b/indra/llcommon/llcallstack.h @@ -29,8 +29,9 @@ class LLCallStackImpl; class LLCallStack { public: - LLCallStack(S32 skip_count=0); + LLCallStack(S32 skip_count=0, bool verbose=false); std::vector m_strings; + bool m_verbose; private: static LLCallStackImpl *s_impl; S32 m_skipCount; -- cgit v1.2.3 From ef02c9ea694a1f0ddc830a66f23555c6316afdc7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 3 Feb 2016 08:59:25 -0500 Subject: SL-315 - context strings, comments, debugging. joint_test temporarily disabled. --- indra/llcommon/llcallstack.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'indra/llcommon/llcallstack.h') diff --git a/indra/llcommon/llcallstack.h b/indra/llcommon/llcallstack.h index 44a572838e..7196907980 100644 --- a/indra/llcommon/llcallstack.h +++ b/indra/llcommon/llcallstack.h @@ -24,6 +24,8 @@ * $/LicenseInfo$ */ +#include + class LLCallStackImpl; class LLCallStack @@ -38,3 +40,39 @@ private: }; LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLCallStack& call_stack); + +class LLContextStrings +{ +public: + LLContextStrings(); + static void addContextString(const std::string& str); + static void removeContextString(const std::string& str); + static void output(std::ostream& os); + static LLContextStrings* getThreadLocalInstance(); +private: + std::map m_contextStrings; +}; + +class LLScopedContextString +{ +public: + LLScopedContextString(const std::string& str): + m_str(str) + { + LLContextStrings::addContextString(m_str); + } + ~LLScopedContextString() + { + LLContextStrings::removeContextString(m_str); + } +private: + std::string m_str; +}; + +// This doesn't really have any state, just acts as class to hook the +// ostream override to. +struct LLContextStatus +{ +}; + +LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLContextStatus& context_status); -- cgit v1.2.3 From 88cb6814f0883cdce15ca1942409da708ab07af5 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 7 Mar 2016 11:24:48 -0500 Subject: SL-315 WIP - more call stack tracing, initial hooks for avatar reset skeleton option. --- indra/llcommon/llcallstack.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/llcallstack.h') diff --git a/indra/llcommon/llcallstack.h b/indra/llcommon/llcallstack.h index 7196907980..1f7a7689d7 100644 --- a/indra/llcommon/llcallstack.h +++ b/indra/llcommon/llcallstack.h @@ -34,6 +34,7 @@ public: LLCallStack(S32 skip_count=0, bool verbose=false); std::vector m_strings; bool m_verbose; + bool contains(const std::string& str); private: static LLCallStackImpl *s_impl; S32 m_skipCount; @@ -49,6 +50,7 @@ public: static void removeContextString(const std::string& str); static void output(std::ostream& os); static LLContextStrings* getThreadLocalInstance(); + static bool contains(const std::string& str); private: std::map m_contextStrings; }; @@ -69,10 +71,10 @@ private: std::string m_str; }; -// This doesn't really have any state, just acts as class to hook the -// ostream override to. +// Mostly exists as a class to hook an ostream override to. struct LLContextStatus { + bool contains(const std::string& str); }; LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLContextStatus& context_status); -- cgit v1.2.3