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) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 WTF_EXPORT void WTFReportBacktrace(int framesToShow = 31); | 113 WTF_EXPORT void WTFReportBacktrace(int framesToShow = 31); |
114 WTF_EXPORT void WTFPrintBacktrace(void** stack, int size); | 114 WTF_EXPORT void WTFPrintBacktrace(void** stack, int size); |
115 | 115 |
116 typedef void (*WTFCrashHookFunction)(); | 116 typedef void (*WTFCrashHookFunction)(); |
117 WTF_EXPORT void WTFSetCrashHook(WTFCrashHookFunction); | 117 WTF_EXPORT void WTFSetCrashHook(WTFCrashHookFunction); |
118 WTF_EXPORT void WTFInvokeCrashHook(); | 118 WTF_EXPORT void WTFInvokeCrashHook(); |
119 WTF_EXPORT void WTFInstallReportBacktraceOnCrashHook(); | 119 WTF_EXPORT void WTFInstallReportBacktraceOnCrashHook(); |
120 | 120 |
121 #ifdef __cplusplus | 121 #ifdef __cplusplus |
122 } | 122 } |
| 123 |
| 124 namespace WTF { |
| 125 |
| 126 class WTF_EXPORT FrameToNameScope { |
| 127 public: |
| 128 explicit FrameToNameScope(void*); |
| 129 ~FrameToNameScope(); |
| 130 const char* nullableName() { return m_name; } |
| 131 |
| 132 private: |
| 133 const char* m_name; |
| 134 char* m_cxaDemangled; |
| 135 }; |
| 136 |
| 137 } // namespace WTF |
| 138 |
| 139 using WTF::FrameToNameScope; |
123 #endif | 140 #endif |
124 | 141 |
125 /* IMMEDIATE_CRASH() - Like CRASH() below but crashes in the fastest, simplest p
ossible way with no attempt at logging. */ | 142 /* IMMEDIATE_CRASH() - Like CRASH() below but crashes in the fastest, simplest p
ossible way with no attempt at logging. */ |
126 #ifndef IMMEDIATE_CRASH | 143 #ifndef IMMEDIATE_CRASH |
127 #if COMPILER(GCC) | 144 #if COMPILER(GCC) |
128 #define IMMEDIATE_CRASH() __builtin_trap() | 145 #define IMMEDIATE_CRASH() __builtin_trap() |
129 #else | 146 #else |
130 #define IMMEDIATE_CRASH() ((void(*)())0)() | 147 #define IMMEDIATE_CRASH() ((void(*)())0)() |
131 #endif | 148 #endif |
132 #endif | 149 #endif |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 } \ | 417 } \ |
401 inline const thisType& to##thisType(const argumentType& argumentName) \ | 418 inline const thisType& to##thisType(const argumentType& argumentName) \ |
402 { \ | 419 { \ |
403 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ | 420 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ |
404 return static_cast<const thisType&>(argumentName); \ | 421 return static_cast<const thisType&>(argumentName); \ |
405 } \ | 422 } \ |
406 void to##thisType(const thisType*); \ | 423 void to##thisType(const thisType*); \ |
407 void to##thisType(const thisType&) | 424 void to##thisType(const thisType&) |
408 | 425 |
409 #endif /* WTF_Assertions_h */ | 426 #endif /* WTF_Assertions_h */ |
OLD | NEW |