| 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 |
| 160 void WTFGetBacktrace(void** stack, int* size) | 166 void WTFGetBacktrace(void** stack, int* size) |
| 161 { | 167 { |
| 162 #if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__)) | 168 #if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__)) |
| 163 *size = backtrace(stack, *size); | 169 *size = backtrace(stack, *size); |
| 164 #elif OS(WIN) | 170 #elif OS(WIN) |
| 165 // The CaptureStackBackTrace function is available in XP, but it is not defi
ned | 171 // The CaptureStackBackTrace function is available in XP, but it is not defi
ned |
| 166 // in the Windows Server 2003 R2 Platform SDK. So, we'll grab the function | 172 // in the Windows Server 2003 R2 Platform SDK. So, we'll grab the function |
| 167 // through GetProcAddress. | 173 // through GetProcAddress. |
| 168 typedef WORD (NTAPI* RtlCaptureStackBackTraceFunc)(DWORD, DWORD, PVOID*, PDW
ORD); | 174 typedef WORD (NTAPI* RtlCaptureStackBackTraceFunc)(DWORD, DWORD, PVOID*, PDW
ORD); |
| 169 HMODULE kernel32 = ::GetModuleHandleW(L"Kernel32.dll"); | 175 HMODULE kernel32 = ::GetModuleHandleW(L"Kernel32.dll"); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 { | 253 { |
| 248 if (channel->state != WTFLogChannelOn) | 254 if (channel->state != WTFLogChannelOn) |
| 249 return; | 255 return; |
| 250 | 256 |
| 251 va_list args; | 257 va_list args; |
| 252 va_start(args, format); | 258 va_start(args, format); |
| 253 vprintf_stderr_with_trailing_newline(format, args); | 259 vprintf_stderr_with_trailing_newline(format, args); |
| 254 va_end(args); | 260 va_end(args); |
| 255 } | 261 } |
| 256 | 262 |
| 263 void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChann
el* channel, const char* format, ...) |
| 264 { |
| 265 if (channel->state != WTFLogChannelOn) |
| 266 return; |
| 267 |
| 268 va_list args; |
| 269 va_start(args, format); |
| 270 vprintf_stderr_with_trailing_newline(format, args); |
| 271 va_end(args); |
| 272 |
| 273 printCallSite(file, line, function); |
| 274 } |
| 275 |
| 257 void WTFLogAlways(const char* format, ...) | 276 void WTFLogAlways(const char* format, ...) |
| 258 { | 277 { |
| 259 va_list args; | 278 va_list args; |
| 260 va_start(args, format); | 279 va_start(args, format); |
| 261 vprintf_stderr_with_trailing_newline(format, args); | 280 vprintf_stderr_with_trailing_newline(format, args); |
| 262 va_end(args); | 281 va_end(args); |
| 263 } | 282 } |
| OLD | NEW |