diff options
author | kosak <kosak@google.com> | 2015-07-17 23:57:03 +0000 |
---|---|---|
committer | kosak <kosak@google.com> | 2015-07-17 23:57:03 +0000 |
commit | e7dbfde8ce49c5989d6e44715cfc1910a95990fe (patch) | |
tree | 1ce66bb65c592bc3aa57bb8fff9de07fda9e4b44 /src/gtest-internal-inl.h | |
parent | fe95bc332d92c6e3f5c2e07fd681bd3549b77374 (diff) | |
download | googletest-e7dbfde8ce49c5989d6e44715cfc1910a95990fe.tar.gz googletest-e7dbfde8ce49c5989d6e44715cfc1910a95990fe.tar.bz2 googletest-e7dbfde8ce49c5989d6e44715cfc1910a95990fe.zip |
Move stack trace logic into custom/ and add a macro to inject it.
Diffstat (limited to 'src/gtest-internal-inl.h')
-rw-r--r-- | src/gtest-internal-inl.h | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/gtest-internal-inl.h b/src/gtest-internal-inl.h index 6a7e2533..56c8a20c 100644 --- a/src/gtest-internal-inl.h +++ b/src/gtest-internal-inl.h @@ -433,6 +433,10 @@ class OsStackTraceGetterInterface { // CurrentStackTrace() will use to find and hide Google Test stack frames. virtual void UponLeavingGTest() = 0; + // This string is inserted in place of stack frames that are part of + // Google Test's implementation. + static const char* const kElidedFramesMarker; + private: GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetterInterface); }; @@ -440,26 +444,12 @@ class OsStackTraceGetterInterface { // A working implementation of the OsStackTraceGetterInterface interface. class OsStackTraceGetter : public OsStackTraceGetterInterface { public: - OsStackTraceGetter() : caller_frame_(NULL) {} - - virtual string CurrentStackTrace(int max_depth, int skip_count) - GTEST_LOCK_EXCLUDED_(mutex_); + OsStackTraceGetter() {} - virtual void UponLeavingGTest() GTEST_LOCK_EXCLUDED_(mutex_); - - // This string is inserted in place of stack frames that are part of - // Google Test's implementation. - static const char* const kElidedFramesMarker; + virtual string CurrentStackTrace(int max_depth, int skip_count); + virtual void UponLeavingGTest(); private: - Mutex mutex_; // protects all internal state - - // We save the stack frame below the frame that calls user code. - // We do this because the address of the frame immediately below - // the user code changes between the call to UponLeavingGTest() - // and any calls to CurrentStackTrace() from within the user code. - void* caller_frame_; - GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetter); }; |