| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 void WTFReportAssertionFailure(const char* file, int line, const char* function,
const char* assertion) | 151 void WTFReportAssertionFailure(const char* file, int line, const char* function,
const char* assertion) |
| 152 { | 152 { |
| 153 if (assertion) | 153 if (assertion) |
| 154 printf_stderr_common("ASSERTION FAILED: %s\n", assertion); | 154 printf_stderr_common("ASSERTION FAILED: %s\n", assertion); |
| 155 else | 155 else |
| 156 printf_stderr_common("SHOULD NEVER BE REACHED\n"); | 156 printf_stderr_common("SHOULD NEVER BE REACHED\n"); |
| 157 printCallSite(file, line, function); | 157 printCallSite(file, line, function); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void WTFReportArgumentAssertionFailure(const char* file, int line, const char* f
unction, const char* argName, const char* assertion) | |
| 161 { | |
| 162 printf_stderr_common("ARGUMENT BAD: %s, %s\n", argName, assertion); | |
| 163 printCallSite(file, line, function); | |
| 164 } | |
| 165 | |
| 166 void WTFGetBacktrace(void** stack, int* size) | 160 void WTFGetBacktrace(void** stack, int* size) |
| 167 { | 161 { |
| 168 #if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__)) | 162 #if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__)) |
| 169 *size = backtrace(stack, *size); | 163 *size = backtrace(stack, *size); |
| 170 #elif OS(WIN) | 164 #elif OS(WIN) |
| 171 // The CaptureStackBackTrace function is available in XP, but it is not defi
ned | 165 // The CaptureStackBackTrace function is available in XP, but it is not defi
ned |
| 172 // in the Windows Server 2003 R2 Platform SDK. So, we'll grab the function | 166 // in the Windows Server 2003 R2 Platform SDK. So, we'll grab the function |
| 173 // through GetProcAddress. | 167 // through GetProcAddress. |
| 174 typedef WORD (NTAPI* RtlCaptureStackBackTraceFunc)(DWORD, DWORD, PVOID*, PDW
ORD); | 168 typedef WORD (NTAPI* RtlCaptureStackBackTraceFunc)(DWORD, DWORD, PVOID*, PDW
ORD); |
| 175 HMODULE kernel32 = ::GetModuleHandleW(L"Kernel32.dll"); | 169 HMODULE kernel32 = ::GetModuleHandleW(L"Kernel32.dll"); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 printCallSite(file, line, function); | 267 printCallSite(file, line, function); |
| 274 } | 268 } |
| 275 | 269 |
| 276 void WTFLogAlways(const char* format, ...) | 270 void WTFLogAlways(const char* format, ...) |
| 277 { | 271 { |
| 278 va_list args; | 272 va_list args; |
| 279 va_start(args, format); | 273 va_start(args, format); |
| 280 vprintf_stderr_with_trailing_newline(format, args); | 274 vprintf_stderr_with_trailing_newline(format, args); |
| 281 va_end(args); | 275 va_end(args); |
| 282 } | 276 } |
| OLD | NEW |