| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 #endif | 67 #endif |
| 68 | 68 |
| 69 #if OS(ANDROID) | 69 #if OS(ANDROID) |
| 70 #include <android/log.h> | 70 #include <android/log.h> |
| 71 #endif | 71 #endif |
| 72 | 72 |
| 73 // TODO(tkent): These function should be in anonymous namespace. | 73 // TODO(tkent): These function should be in anonymous namespace. |
| 74 void WTFGetBacktrace(void** stack, int* size); | 74 void WTFGetBacktrace(void** stack, int* size); |
| 75 void WTFPrintBacktrace(void** stack, int size); | 75 void WTFPrintBacktrace(void** stack, int size); |
| 76 | 76 |
| 77 WTF_ATTRIBUTE_PRINTF(1, 0) | 77 PRINTF_FORMAT(1, 0) |
| 78 static void vprintf_stderr_common(const char* format, va_list args) { | 78 static void vprintf_stderr_common(const char* format, va_list args) { |
| 79 #if OS(MACOSX) && USE(APPLE_SYSTEM_LOG) | 79 #if OS(MACOSX) && USE(APPLE_SYSTEM_LOG) |
| 80 va_list copyOfArgs; | 80 va_list copyOfArgs; |
| 81 va_copy(copyOfArgs, args); | 81 va_copy(copyOfArgs, args); |
| 82 asl_vlog(0, 0, ASL_LEVEL_NOTICE, format, copyOfArgs); | 82 asl_vlog(0, 0, ASL_LEVEL_NOTICE, format, copyOfArgs); |
| 83 va_end(copyOfArgs); | 83 va_end(copyOfArgs); |
| 84 #elif OS(ANDROID) | 84 #elif OS(ANDROID) |
| 85 __android_log_vprint(ANDROID_LOG_WARN, "WebKit", format, args); | 85 __android_log_vprint(ANDROID_LOG_WARN, "WebKit", format, args); |
| 86 #elif OS(WIN) | 86 #elif OS(WIN) |
| 87 if (IsDebuggerPresent()) { | 87 if (IsDebuggerPresent()) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 formatWithNewline[formatLength] = '\n'; | 125 formatWithNewline[formatLength] = '\n'; |
| 126 formatWithNewline[formatLength + 1] = 0; | 126 formatWithNewline[formatLength + 1] = 0; |
| 127 | 127 |
| 128 vprintf_stderr_common(formatWithNewline.get(), args); | 128 vprintf_stderr_common(formatWithNewline.get(), args); |
| 129 } | 129 } |
| 130 | 130 |
| 131 #if COMPILER(CLANG) || (COMPILER(GCC) && GCC_VERSION_AT_LEAST(4, 6, 0)) | 131 #if COMPILER(CLANG) || (COMPILER(GCC) && GCC_VERSION_AT_LEAST(4, 6, 0)) |
| 132 #pragma GCC diagnostic pop | 132 #pragma GCC diagnostic pop |
| 133 #endif | 133 #endif |
| 134 | 134 |
| 135 WTF_ATTRIBUTE_PRINTF(1, 2) | 135 PRINTF_FORMAT(1, 2) |
| 136 static void printf_stderr_common(const char* format, ...) { | 136 static void printf_stderr_common(const char* format, ...) { |
| 137 va_list args; | 137 va_list args; |
| 138 va_start(args, format); | 138 va_start(args, format); |
| 139 vprintf_stderr_common(format, args); | 139 vprintf_stderr_common(format, args); |
| 140 va_end(args); | 140 va_end(args); |
| 141 } | 141 } |
| 142 | 142 |
| 143 static void printCallSite(const char* file, int line, const char* function) { | 143 static void printCallSite(const char* file, int line, const char* function) { |
| 144 #if OS(WIN) && defined(_DEBUG) | 144 #if OS(WIN) && defined(_DEBUG) |
| 145 _CrtDbgReport(_CRT_WARN, file, line, nullptr, "%s\n", function); | 145 _CrtDbgReport(_CRT_WARN, file, line, nullptr, "%s\n", function); |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 printf_stderr_common("%-3d %p\n", frameNumber, stack[i]); | 333 printf_stderr_common("%-3d %p\n", frameNumber, stack[i]); |
| 334 } | 334 } |
| 335 } | 335 } |
| 336 | 336 |
| 337 void WTFLogAlways(const char* format, ...) { | 337 void WTFLogAlways(const char* format, ...) { |
| 338 va_list args; | 338 va_list args; |
| 339 va_start(args, format); | 339 va_start(args, format); |
| 340 vprintf_stderr_with_trailing_newline(format, args); | 340 vprintf_stderr_with_trailing_newline(format, args); |
| 341 va_end(args); | 341 va_end(args); |
| 342 } | 342 } |
| OLD | NEW |