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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 #if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__)) | 62 #if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__)) |
63 #include <cxxabi.h> | 63 #include <cxxabi.h> |
64 #include <dlfcn.h> | 64 #include <dlfcn.h> |
65 #include <execinfo.h> | 65 #include <execinfo.h> |
66 #endif | 66 #endif |
67 | 67 |
68 #if OS(ANDROID) | 68 #if OS(ANDROID) |
69 #include <android/log.h> | 69 #include <android/log.h> |
70 #endif | 70 #endif |
71 | 71 |
| 72 // TODO(tkent): These function should be in anonymous namespace. |
| 73 void WTFGetBacktrace(void** stack, int* size); |
| 74 void WTFPrintBacktrace(void** stack, int size); |
| 75 |
72 WTF_ATTRIBUTE_PRINTF(1, 0) | 76 WTF_ATTRIBUTE_PRINTF(1, 0) |
73 static void vprintf_stderr_common(const char* format, va_list args) | 77 static void vprintf_stderr_common(const char* format, va_list args) |
74 { | 78 { |
75 #if OS(MACOSX) && USE(APPLE_SYSTEM_LOG) | 79 #if OS(MACOSX) && USE(APPLE_SYSTEM_LOG) |
76 va_list copyOfArgs; | 80 va_list copyOfArgs; |
77 va_copy(copyOfArgs, args); | 81 va_copy(copyOfArgs, args); |
78 asl_vlog(0, 0, ASL_LEVEL_NOTICE, format, copyOfArgs); | 82 asl_vlog(0, 0, ASL_LEVEL_NOTICE, format, copyOfArgs); |
79 va_end(copyOfArgs); | 83 va_end(copyOfArgs); |
80 #elif OS(ANDROID) | 84 #elif OS(ANDROID) |
81 __android_log_vprint(ANDROID_LOG_WARN, "WebKit", format, args); | 85 __android_log_vprint(ANDROID_LOG_WARN, "WebKit", format, args); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 } | 342 } |
339 } | 343 } |
340 | 344 |
341 void WTFLogAlways(const char* format, ...) | 345 void WTFLogAlways(const char* format, ...) |
342 { | 346 { |
343 va_list args; | 347 va_list args; |
344 va_start(args, format); | 348 va_start(args, format); |
345 vprintf_stderr_with_trailing_newline(format, args); | 349 vprintf_stderr_with_trailing_newline(format, args); |
346 va_end(args); | 350 va_end(args); |
347 } | 351 } |
OLD | NEW |