MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / backend

Method backend

ogsr_engine/xrCore/xrDebugNew.cpp:187–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187void xrDebug::backend(const char* expression, const char* description, const char* argument0, const char* argument1, const char* file, int line, const char* function)
188{
189 static std::recursive_mutex CS;
190 std::scoped_lock<decltype(CS)> lock(CS);
191
192 string4096 assertion_info;
193 gather_info(expression, description, argument0, argument1, file, line, function, assertion_info);
194
195 /* KRodin: у меня этот способ не работает - происходит исключение внутри функции save_mini_dump(). Если сильно надо будет тут получать минидампы - придумать другой способ.
196 #ifdef USE_OWN_MINI_DUMP
197 if ( !IsDebuggerPresent() )
198 save_mini_dump(nullptr);
199 #endif
200 */
201 auto endline = "\r\n";
202 auto buffer = assertion_info + xr_strlen(assertion_info);
203 buffer += sprintf(buffer, "%sPress OK to abort execution%s", endline, endline);
204
205 error_after_dialog = true;
206
207 ShowErrorMessage(assertion_info);
208
209 if (!IsDebuggerPresent())
210 quick_exit(EXIT_SUCCESS);
211 else
212 DEBUG_INVOKE;
213}
214
215const char* xrDebug::DXerror2string(const HRESULT code) const { return _com_error{code}.ErrorMessage(); }
216

Callers 3

_terminateFunction · 0.80
handler_baseFunction · 0.80

Calls 3

gather_infoFunction · 0.85
ShowErrorMessageFunction · 0.85
xr_strlenFunction · 0.70

Tested by

no test coverage detected