Changeset 95809 in vbox
- Timestamp:
- Jul 25, 2022 1:19:34 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/misc/assert.cpp
r93115 r95809 45 45 #ifdef IN_RING3 46 46 # include <iprt/env.h> 47 # include <stdio.h> 47 # ifndef IPRT_NO_CRT 48 # include <stdio.h> 49 # endif 48 50 # ifdef RT_OS_WINDOWS 49 51 # include <iprt/win/windows.h> … … 220 222 # ifdef IN_RING3 221 223 /* print to stderr, helps user and gdb debugging. */ 224 # ifndef IPRT_NO_CRT 222 225 fprintf(stderr, 223 226 "\n!!Assertion Failed!!\n" … … 228 231 uLine, 229 232 RT_VALID_PTR(pszFunction) ? pszFunction : ""); 230 # ifdef IPRT_WITH_ASSERT_STACK233 # ifdef IPRT_WITH_ASSERT_STACK 231 234 fprintf(stderr, "Stack :\n%s\n", szStack); 232 # endif235 # endif 233 236 fflush(stderr); 237 # else 238 char szMsg[2048]; 239 size_t cchMsg = RTStrPrintf(szMsg, sizeof(szMsg), 240 "\n!!Assertion Failed!!\n" 241 "Expression: %s\n" 242 "Location : %s(%d) %s\n", 243 RT_VALID_PTR(pszExpr) ? pszExpr : "<none>", 244 RT_VALID_PTR(pszFile) ? pszFile : "<none>", 245 uLine, 246 RT_VALID_PTR(pszFunction) ? pszFunction : ""); 247 RTLogWriteStdErr(szMsg, cchMsg); 248 # ifdef IPRT_WITH_ASSERT_STACK 249 RTLogWriteStdErr(RT_STR_TUPLE("Stack :\n")); 250 RTLogWriteStdErr(szStack, strlen(szStack)); 251 RTLogWriteStdErr(RT_STR_TUPLE("\n")); 252 # endif 253 # endif 234 254 # endif 235 255 #endif /* !IN_RING0 */ … … 327 347 char szMsg[sizeof(g_szRTAssertMsg2)]; 328 348 va_copy(vaCopy, va); 329 RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, vaCopy);349 size_t cchMsg = RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, vaCopy); 330 350 va_end(vaCopy); 331 fprintf(stderr, "%s", szMsg); 351 # ifndef IPRT_NO_CRT 352 fwrite(szMsg, 1, cchMsg, stderr); 332 353 fflush(stderr); 354 # else 355 RTLogWriteStdErr(szMsg, cchMsg); 356 # endif 333 357 # endif 334 358 #endif /* !IN_RING0 */
Note:
See TracChangeset
for help on using the changeset viewer.