| 185 | } |
| 186 | |
| 187 | void 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 | |
| 215 | const char* xrDebug::DXerror2string(const HRESULT code) const { return _com_error{code}.ErrorMessage(); } |
| 216 |
no test coverage detected