| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007-2009 Torch Mobile, Inc. | 3 * Copyright (C) 2007-2009 Torch Mobile, Inc. |
| 4 * Copyright (C) 2011 University of Szeged. All rights reserved. | 4 * Copyright (C) 2011 University of Szeged. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 void WTFReportAssertionFailure(const char* file, int line, const char* function,
const char* assertion) | 163 void WTFReportAssertionFailure(const char* file, int line, const char* function,
const char* assertion) |
| 164 { | 164 { |
| 165 if (assertion) | 165 if (assertion) |
| 166 printf_stderr_common("ASSERTION FAILED: %s\n", assertion); | 166 printf_stderr_common("ASSERTION FAILED: %s\n", assertion); |
| 167 else | 167 else |
| 168 printf_stderr_common("SHOULD NEVER BE REACHED\n"); | 168 printf_stderr_common("SHOULD NEVER BE REACHED\n"); |
| 169 printCallSite(file, line, function); | 169 printCallSite(file, line, function); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void WTFReportAssertionFailureWithMessage(const char* file, int line, const char
* function, const char* assertion, const char* format, ...) | |
| 173 { | |
| 174 va_list args; | |
| 175 va_start(args, format); | |
| 176 vprintf_stderr_with_prefix("ASSERTION FAILED: ", format, args); | |
| 177 va_end(args); | |
| 178 printf_stderr_common("\n%s\n", assertion); | |
| 179 printCallSite(file, line, function); | |
| 180 } | |
| 181 | |
| 182 void WTFReportArgumentAssertionFailure(const char* file, int line, const char* f
unction, const char* argName, const char* assertion) | 172 void WTFReportArgumentAssertionFailure(const char* file, int line, const char* f
unction, const char* argName, const char* assertion) |
| 183 { | 173 { |
| 184 printf_stderr_common("ARGUMENT BAD: %s, %s\n", argName, assertion); | 174 printf_stderr_common("ARGUMENT BAD: %s, %s\n", argName, assertion); |
| 185 printCallSite(file, line, function); | 175 printCallSite(file, line, function); |
| 186 } | 176 } |
| 187 | 177 |
| 188 void WTFGetBacktrace(void** stack, int* size) | 178 void WTFGetBacktrace(void** stack, int* size) |
| 189 { | 179 { |
| 190 #if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__)) | 180 #if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__)) |
| 191 *size = backtrace(stack, *size); | 181 *size = backtrace(stack, *size); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 printCallSite(file, line, function); | 295 printCallSite(file, line, function); |
| 306 } | 296 } |
| 307 | 297 |
| 308 void WTFLogAlways(const char* format, ...) | 298 void WTFLogAlways(const char* format, ...) |
| 309 { | 299 { |
| 310 va_list args; | 300 va_list args; |
| 311 va_start(args, format); | 301 va_start(args, format); |
| 312 vprintf_stderr_with_trailing_newline(format, args); | 302 vprintf_stderr_with_trailing_newline(format, args); |
| 313 va_end(args); | 303 va_end(args); |
| 314 } | 304 } |
| OLD | NEW |