Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 1 | //===--------------------- UnwindLevel1-gcc-ext.c -------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
| 7 | // |
| 8 | // |
| 9 | // Implements gcc extensions to the C++ ABI Exception Handling Level 1. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | #include <inttypes.h> |
| 14 | #include <stdbool.h> |
| 15 | #include <stdint.h> |
| 16 | #include <stdio.h> |
| 17 | #include <stdlib.h> |
Logan Chien | a54f096 | 2015-05-29 15:33:38 +0000 | [diff] [blame] | 18 | #include <string.h> |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 19 | |
| 20 | #include "config.h" |
| 21 | #include "libunwind_ext.h" |
| 22 | #include "libunwind.h" |
| 23 | #include "Unwind-EHABI.h" |
| 24 | #include "unwind.h" |
| 25 | |
Ranjeet Singh | 421231a | 2017-03-31 15:28:06 +0000 | [diff] [blame] | 26 | #if defined(_LIBUNWIND_BUILD_ZERO_COST_APIS) |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 27 | |
Charles Davis | fa2e620 | 2018-08-30 21:29:00 +0000 | [diff] [blame] | 28 | #if defined(_LIBUNWIND_SUPPORT_SEH_UNWIND) |
| 29 | #define private_1 private_[0] |
| 30 | #endif |
| 31 | |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 32 | /// Called by __cxa_rethrow(). |
| 33 | _LIBUNWIND_EXPORT _Unwind_Reason_Code |
| 34 | _Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object) { |
Ranjeet Singh | 421231a | 2017-03-31 15:28:06 +0000 | [diff] [blame] | 35 | #if defined(_LIBUNWIND_ARM_EHABI) |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 36 | _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%ld", |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 37 | (void *)exception_object, |
| 38 | (long)exception_object->unwinder_cache.reserved1); |
| 39 | #else |
Charles Davis | 5aede5d | 2018-08-08 04:21:24 +0000 | [diff] [blame] | 40 | _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%" PRIdPTR, |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 41 | (void *)exception_object, |
Charles Davis | 5aede5d | 2018-08-08 04:21:24 +0000 | [diff] [blame] | 42 | (intptr_t)exception_object->private_1); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 43 | #endif |
| 44 | |
Ranjeet Singh | 421231a | 2017-03-31 15:28:06 +0000 | [diff] [blame] | 45 | #if defined(_LIBUNWIND_ARM_EHABI) |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 46 | // _Unwind_RaiseException on EHABI will always set the reserved1 field to 0, |
| 47 | // which is in the same position as private_1 below. |
| 48 | return _Unwind_RaiseException(exception_object); |
| 49 | #else |
| 50 | // If this is non-forced and a stopping place was found, then this is a |
| 51 | // re-throw. |
| 52 | // Call _Unwind_RaiseException() as if this was a new exception |
| 53 | if (exception_object->private_1 == 0) { |
| 54 | return _Unwind_RaiseException(exception_object); |
| 55 | // Will return if there is no catch clause, so that __cxa_rethrow can call |
| 56 | // std::terminate(). |
| 57 | } |
| 58 | |
| 59 | // Call through to _Unwind_Resume() which distiguishes between forced and |
| 60 | // regular exceptions. |
| 61 | _Unwind_Resume(exception_object); |
| 62 | _LIBUNWIND_ABORT("_Unwind_Resume_or_Rethrow() called _Unwind_RaiseException()" |
| 63 | " which unexpectedly returned"); |
| 64 | #endif |
| 65 | } |
| 66 | |
| 67 | |
| 68 | /// Called by personality handler during phase 2 to get base address for data |
| 69 | /// relative encodings. |
| 70 | _LIBUNWIND_EXPORT uintptr_t |
| 71 | _Unwind_GetDataRelBase(struct _Unwind_Context *context) { |
| 72 | (void)context; |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 73 | _LIBUNWIND_TRACE_API("_Unwind_GetDataRelBase(context=%p)", (void *)context); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 74 | _LIBUNWIND_ABORT("_Unwind_GetDataRelBase() not implemented"); |
| 75 | } |
| 76 | |
| 77 | |
| 78 | /// Called by personality handler during phase 2 to get base address for text |
| 79 | /// relative encodings. |
| 80 | _LIBUNWIND_EXPORT uintptr_t |
| 81 | _Unwind_GetTextRelBase(struct _Unwind_Context *context) { |
| 82 | (void)context; |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 83 | _LIBUNWIND_TRACE_API("_Unwind_GetTextRelBase(context=%p)", (void *)context); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 84 | _LIBUNWIND_ABORT("_Unwind_GetTextRelBase() not implemented"); |
| 85 | } |
| 86 | |
| 87 | |
| 88 | /// Scans unwind information to find the function that contains the |
| 89 | /// specified code address "pc". |
| 90 | _LIBUNWIND_EXPORT void *_Unwind_FindEnclosingFunction(void *pc) { |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 91 | _LIBUNWIND_TRACE_API("_Unwind_FindEnclosingFunction(pc=%p)", pc); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 92 | // This is slow, but works. |
| 93 | // We create an unwind cursor then alter the IP to be pc |
| 94 | unw_cursor_t cursor; |
| 95 | unw_context_t uc; |
| 96 | unw_proc_info_t info; |
| 97 | unw_getcontext(&uc); |
| 98 | unw_init_local(&cursor, &uc); |
Charles Davis | 5aede5d | 2018-08-08 04:21:24 +0000 | [diff] [blame] | 99 | unw_set_reg(&cursor, UNW_REG_IP, (unw_word_t)(intptr_t) pc); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 100 | if (unw_get_proc_info(&cursor, &info) == UNW_ESUCCESS) |
Charles Davis | 5aede5d | 2018-08-08 04:21:24 +0000 | [diff] [blame] | 101 | return (void *)(intptr_t) info.start_ip; |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 102 | else |
| 103 | return NULL; |
| 104 | } |
| 105 | |
| 106 | /// Walk every frame and call trace function at each one. If trace function |
| 107 | /// returns anything other than _URC_NO_REASON, then walk is terminated. |
| 108 | _LIBUNWIND_EXPORT _Unwind_Reason_Code |
| 109 | _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) { |
| 110 | unw_cursor_t cursor; |
| 111 | unw_context_t uc; |
| 112 | unw_getcontext(&uc); |
| 113 | unw_init_local(&cursor, &uc); |
| 114 | |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 115 | _LIBUNWIND_TRACE_API("_Unwind_Backtrace(callback=%p)", |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 116 | (void *)(uintptr_t)callback); |
| 117 | |
Ranjeet Singh | 421231a | 2017-03-31 15:28:06 +0000 | [diff] [blame] | 118 | #if defined(_LIBUNWIND_ARM_EHABI) |
Logan Chien | a54f096 | 2015-05-29 15:33:38 +0000 | [diff] [blame] | 119 | // Create a mock exception object for force unwinding. |
| 120 | _Unwind_Exception ex; |
| 121 | memset(&ex, '\0', sizeof(ex)); |
| 122 | ex.exception_class = 0x434C4E47554E5700; // CLNGUNW\0 |
| 123 | #endif |
| 124 | |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 125 | // walk each frame |
| 126 | while (true) { |
| 127 | _Unwind_Reason_Code result; |
| 128 | |
Ranjeet Singh | 421231a | 2017-03-31 15:28:06 +0000 | [diff] [blame] | 129 | #if !defined(_LIBUNWIND_ARM_EHABI) |
Ed Maste | 6f72338 | 2016-08-30 13:08:21 +0000 | [diff] [blame] | 130 | // ask libunwind to get next frame (skip over first frame which is |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 131 | // _Unwind_Backtrace()) |
| 132 | if (unw_step(&cursor) <= 0) { |
| 133 | _LIBUNWIND_TRACE_UNWINDING(" _backtrace: ended because cursor reached " |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 134 | "bottom of stack, returning %d", |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 135 | _URC_END_OF_STACK); |
| 136 | return _URC_END_OF_STACK; |
| 137 | } |
Logan Chien | a54f096 | 2015-05-29 15:33:38 +0000 | [diff] [blame] | 138 | #else |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 139 | // Get the information for this frame. |
| 140 | unw_proc_info_t frameInfo; |
| 141 | if (unw_get_proc_info(&cursor, &frameInfo) != UNW_ESUCCESS) { |
| 142 | return _URC_END_OF_STACK; |
| 143 | } |
| 144 | |
Logan Chien | a54f096 | 2015-05-29 15:33:38 +0000 | [diff] [blame] | 145 | // Update the pr_cache in the mock exception object. |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 146 | const uint32_t* unwindInfo = (uint32_t *) frameInfo.unwind_info; |
Logan Chien | a54f096 | 2015-05-29 15:33:38 +0000 | [diff] [blame] | 147 | ex.pr_cache.fnstart = frameInfo.start_ip; |
| 148 | ex.pr_cache.ehtp = (_Unwind_EHT_Header *) unwindInfo; |
| 149 | ex.pr_cache.additional= frameInfo.flags; |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 150 | |
Logan Chien | a54f096 | 2015-05-29 15:33:38 +0000 | [diff] [blame] | 151 | struct _Unwind_Context *context = (struct _Unwind_Context *)&cursor; |
| 152 | // Get and call the personality function to unwind the frame. |
| 153 | __personality_routine handler = (__personality_routine) frameInfo.handler; |
| 154 | if (handler == NULL) { |
| 155 | return _URC_END_OF_STACK; |
| 156 | } |
| 157 | if (handler(_US_VIRTUAL_UNWIND_FRAME | _US_FORCE_UNWIND, &ex, context) != |
| 158 | _URC_CONTINUE_UNWIND) { |
| 159 | return _URC_END_OF_STACK; |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 160 | } |
Ranjeet Singh | 421231a | 2017-03-31 15:28:06 +0000 | [diff] [blame] | 161 | #endif // defined(_LIBUNWIND_ARM_EHABI) |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 162 | |
| 163 | // debugging |
| 164 | if (_LIBUNWIND_TRACING_UNWINDING) { |
| 165 | char functionName[512]; |
| 166 | unw_proc_info_t frame; |
| 167 | unw_word_t offset; |
| 168 | unw_get_proc_name(&cursor, functionName, 512, &offset); |
| 169 | unw_get_proc_info(&cursor, &frame); |
| 170 | _LIBUNWIND_TRACE_UNWINDING( |
Martin Storsjo | 97e2d98 | 2017-10-30 19:06:34 +0000 | [diff] [blame] | 171 | " _backtrace: start_ip=0x%" PRIxPTR ", func=%s, lsda=0x%" PRIxPTR ", context=%p", |
| 172 | frame.start_ip, functionName, frame.lsda, |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 173 | (void *)&cursor); |
| 174 | } |
| 175 | |
| 176 | // call trace function with this frame |
| 177 | result = (*callback)((struct _Unwind_Context *)(&cursor), ref); |
| 178 | if (result != _URC_NO_REASON) { |
| 179 | _LIBUNWIND_TRACE_UNWINDING( |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 180 | " _backtrace: ended because callback returned %d", result); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 181 | return result; |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | |
Ed Maste | 4c43c3d | 2016-07-19 17:15:50 +0000 | [diff] [blame] | 187 | /// Find DWARF unwind info for an address 'pc' in some function. |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 188 | _LIBUNWIND_EXPORT const void *_Unwind_Find_FDE(const void *pc, |
| 189 | struct dwarf_eh_bases *bases) { |
| 190 | // This is slow, but works. |
| 191 | // We create an unwind cursor then alter the IP to be pc |
| 192 | unw_cursor_t cursor; |
| 193 | unw_context_t uc; |
| 194 | unw_proc_info_t info; |
| 195 | unw_getcontext(&uc); |
| 196 | unw_init_local(&cursor, &uc); |
Charles Davis | 5aede5d | 2018-08-08 04:21:24 +0000 | [diff] [blame] | 197 | unw_set_reg(&cursor, UNW_REG_IP, (unw_word_t)(intptr_t) pc); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 198 | unw_get_proc_info(&cursor, &info); |
| 199 | bases->tbase = (uintptr_t)info.extra; |
| 200 | bases->dbase = 0; // dbase not used on Mac OS X |
| 201 | bases->func = (uintptr_t)info.start_ip; |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 202 | _LIBUNWIND_TRACE_API("_Unwind_Find_FDE(pc=%p) => %p", pc, |
Charles Davis | 5aede5d | 2018-08-08 04:21:24 +0000 | [diff] [blame] | 203 | (void *)(intptr_t) info.unwind_info); |
| 204 | return (void *)(intptr_t) info.unwind_info; |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 205 | } |
| 206 | |
| 207 | /// Returns the CFA (call frame area, or stack pointer at start of function) |
| 208 | /// for the current context. |
| 209 | _LIBUNWIND_EXPORT uintptr_t _Unwind_GetCFA(struct _Unwind_Context *context) { |
| 210 | unw_cursor_t *cursor = (unw_cursor_t *)context; |
| 211 | unw_word_t result; |
| 212 | unw_get_reg(cursor, UNW_REG_SP, &result); |
Martin Storsjo | 97e2d98 | 2017-10-30 19:06:34 +0000 | [diff] [blame] | 213 | _LIBUNWIND_TRACE_API("_Unwind_GetCFA(context=%p) => 0x%" PRIxPTR, |
| 214 | (void *)context, result); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 215 | return (uintptr_t)result; |
| 216 | } |
| 217 | |
| 218 | |
| 219 | /// Called by personality handler during phase 2 to get instruction pointer. |
| 220 | /// ipBefore is a boolean that says if IP is already adjusted to be the call |
| 221 | /// site address. Normally IP is the return address. |
| 222 | _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context, |
| 223 | int *ipBefore) { |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 224 | _LIBUNWIND_TRACE_API("_Unwind_GetIPInfo(context=%p)", (void *)context); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 225 | *ipBefore = 0; |
| 226 | return _Unwind_GetIP(context); |
| 227 | } |
| 228 | |
Ranjeet Singh | 421231a | 2017-03-31 15:28:06 +0000 | [diff] [blame] | 229 | #if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 230 | |
| 231 | /// Called by programs with dynamic code generators that want |
| 232 | /// to register a dynamically generated FDE. |
| 233 | /// This function has existed on Mac OS X since 10.4, but |
| 234 | /// was broken until 10.6. |
| 235 | _LIBUNWIND_EXPORT void __register_frame(const void *fde) { |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 236 | _LIBUNWIND_TRACE_API("__register_frame(%p)", fde); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 237 | _unw_add_dynamic_fde((unw_word_t)(uintptr_t) fde); |
| 238 | } |
| 239 | |
| 240 | |
| 241 | /// Called by programs with dynamic code generators that want |
| 242 | /// to unregister a dynamically generated FDE. |
| 243 | /// This function has existed on Mac OS X since 10.4, but |
| 244 | /// was broken until 10.6. |
| 245 | _LIBUNWIND_EXPORT void __deregister_frame(const void *fde) { |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 246 | _LIBUNWIND_TRACE_API("__deregister_frame(%p)", fde); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 247 | _unw_remove_dynamic_fde((unw_word_t)(uintptr_t) fde); |
| 248 | } |
| 249 | |
| 250 | |
| 251 | // The following register/deregister functions are gcc extensions. |
| 252 | // They have existed on Mac OS X, but have never worked because Mac OS X |
| 253 | // before 10.6 used keymgr to track known FDEs, but these functions |
| 254 | // never got updated to use keymgr. |
| 255 | // For now, we implement these as do-nothing functions to keep any existing |
| 256 | // applications working. We also add the not in 10.6 symbol so that nwe |
| 257 | // application won't be able to use them. |
| 258 | |
Ranjeet Singh | 421231a | 2017-03-31 15:28:06 +0000 | [diff] [blame] | 259 | #if defined(_LIBUNWIND_SUPPORT_FRAME_APIS) |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 260 | _LIBUNWIND_EXPORT void __register_frame_info_bases(const void *fde, void *ob, |
| 261 | void *tb, void *db) { |
| 262 | (void)fde; |
| 263 | (void)ob; |
| 264 | (void)tb; |
| 265 | (void)db; |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 266 | _LIBUNWIND_TRACE_API("__register_frame_info_bases(%p,%p, %p, %p)", |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 267 | fde, ob, tb, db); |
| 268 | // do nothing, this function never worked in Mac OS X |
| 269 | } |
| 270 | |
| 271 | _LIBUNWIND_EXPORT void __register_frame_info(const void *fde, void *ob) { |
| 272 | (void)fde; |
| 273 | (void)ob; |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 274 | _LIBUNWIND_TRACE_API("__register_frame_info(%p, %p)", fde, ob); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 275 | // do nothing, this function never worked in Mac OS X |
| 276 | } |
| 277 | |
| 278 | _LIBUNWIND_EXPORT void __register_frame_info_table_bases(const void *fde, |
| 279 | void *ob, void *tb, |
| 280 | void *db) { |
| 281 | (void)fde; |
| 282 | (void)ob; |
| 283 | (void)tb; |
| 284 | (void)db; |
| 285 | _LIBUNWIND_TRACE_API("__register_frame_info_table_bases" |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 286 | "(%p,%p, %p, %p)", fde, ob, tb, db); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 287 | // do nothing, this function never worked in Mac OS X |
| 288 | } |
| 289 | |
| 290 | _LIBUNWIND_EXPORT void __register_frame_info_table(const void *fde, void *ob) { |
| 291 | (void)fde; |
| 292 | (void)ob; |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 293 | _LIBUNWIND_TRACE_API("__register_frame_info_table(%p, %p)", fde, ob); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 294 | // do nothing, this function never worked in Mac OS X |
| 295 | } |
| 296 | |
| 297 | _LIBUNWIND_EXPORT void __register_frame_table(const void *fde) { |
| 298 | (void)fde; |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 299 | _LIBUNWIND_TRACE_API("__register_frame_table(%p)", fde); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 300 | // do nothing, this function never worked in Mac OS X |
| 301 | } |
| 302 | |
| 303 | _LIBUNWIND_EXPORT void *__deregister_frame_info(const void *fde) { |
| 304 | (void)fde; |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 305 | _LIBUNWIND_TRACE_API("__deregister_frame_info(%p)", fde); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 306 | // do nothing, this function never worked in Mac OS X |
| 307 | return NULL; |
| 308 | } |
| 309 | |
| 310 | _LIBUNWIND_EXPORT void *__deregister_frame_info_bases(const void *fde) { |
| 311 | (void)fde; |
Ed Maste | 41bc5a7 | 2016-08-30 15:38:10 +0000 | [diff] [blame] | 312 | _LIBUNWIND_TRACE_API("__deregister_frame_info_bases(%p)", fde); |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 313 | // do nothing, this function never worked in Mac OS X |
| 314 | return NULL; |
| 315 | } |
Ranjeet Singh | 421231a | 2017-03-31 15:28:06 +0000 | [diff] [blame] | 316 | #endif // defined(_LIBUNWIND_SUPPORT_FRAME_APIS) |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 317 | |
Ranjeet Singh | 421231a | 2017-03-31 15:28:06 +0000 | [diff] [blame] | 318 | #endif // defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND) |
Saleem Abdulrasool | 1755266 | 2015-04-24 19:39:17 +0000 | [diff] [blame] | 319 | |
Ranjeet Singh | 421231a | 2017-03-31 15:28:06 +0000 | [diff] [blame] | 320 | #endif // defined(_LIBUNWIND_BUILD_ZERO_COST_APIS) |