MCPcopy Create free account
hub / github.com/ValveSoftware/GameNetworkingSockets / AssertMsgImplementationV

Function AssertMsgImplementationV

src/tier0/dbg.cpp:129–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void AssertMsgImplementationV( bool _bFatal, bool bFmt, const char* pstrFile, unsigned int nLine, PRINTF_FORMAT_STRING const char *pMsg, va_list ap )
130{
131 static intp s_ThreadLocalAssertMsgGuardStatic; // Really should be thread-local
132 if ( !_bFatal && s_ThreadLocalAssertMsgGuardStatic > 0 )
133 {
134 //
135 // No need to re-enter.
136 //
137 return;
138 }
139 ++s_ThreadLocalAssertMsgGuardStatic;
140
141 #if defined ( STEAMDATAGRAM_GAMECOORDINATOR_FOREXPORT )
142 SteamDatagramGame_AssertFailed( bFmt, pstrFile, nLine, pMsg, ap );
143 #elif defined( STEAMNETWORKINGSOCKETS_FOREXPORT )
144 (*g_pfnPreFormatSpewHandler)( k_ESteamNetworkingSocketsDebugOutputType_Bug, bFmt, pstrFile, nLine, pMsg, ap );
145 #else
146 fflush(stdout);
147 if ( pstrFile )
148 fprintf( stderr, "%s(%d): ", pstrFile, nLine );
149 if ( bFmt )
150 vfprintf( stderr, pMsg, ap );
151 else
152; fprintf( stderr, "%s", pMsg );
153 fflush(stderr);
154
155 if ( Plat_IsInDebugSession() )
156 {
157 // HELLO DEVELOPER: Set this to true if you are getting fed up with the DebuggerBreak().
158 static volatile bool s_bDisableDebuggerBreak = false;
159 if ( !s_bDisableDebuggerBreak )
160 DebuggerBreak();
161 }
162 #endif
163
164 if ( _bFatal )
165 {
166 #ifdef _WIN32
167 TerminateProcess( GetCurrentProcess(), EXIT_FAILURE ); // die, die RIGHT NOW! (don't call exit() so destructors will not get run)
168 #elif defined( _PS3 )
169 sys_process_exit( EXIT_FAILURE );
170 #elif defined( __clang__ )
171 abort();
172 #else
173 std::quick_exit( EXIT_FAILURE );
174 #endif
175 }
176
177 --s_ThreadLocalAssertMsgGuardStatic;
178}
179
180void AssertMsgHelper<true,true>::AssertFailed( const char* pstrFile, unsigned int nLine, const char *pMsg )
181{

Callers 1

AssertFailedMethod · 0.85

Calls 1

Plat_IsInDebugSessionFunction · 0.85

Tested by

no test coverage detected