comparison libunwind/src/libunwind.cpp @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 0572611fdcc8
children 5f17cb93ff66
comparison
equal deleted inserted replaced
173:0572611fdcc8 207:2e18cbf3894f
14 #include "libunwind_ext.h" 14 #include "libunwind_ext.h"
15 #include "config.h" 15 #include "config.h"
16 16
17 #include <stdlib.h> 17 #include <stdlib.h>
18 18
19 #if __has_feature(address_sanitizer)
20 #include <sanitizer/asan_interface.h>
21 #endif
19 22
20 #if !defined(__USING_SJLJ_EXCEPTIONS__) 23 #if !defined(__USING_SJLJ_EXCEPTIONS__)
21 #include "AddressSpace.hpp" 24 #include "AddressSpace.hpp"
22 #include "UnwindCursor.hpp" 25 #include "UnwindCursor.hpp"
23 26
58 # define REGISTER_KIND Registers_mips_newabi 61 # define REGISTER_KIND Registers_mips_newabi
59 #elif defined(__mips__) 62 #elif defined(__mips__)
60 # warning The MIPS architecture is not supported with this ABI and environment! 63 # warning The MIPS architecture is not supported with this ABI and environment!
61 #elif defined(__sparc__) 64 #elif defined(__sparc__)
62 # define REGISTER_KIND Registers_sparc 65 # define REGISTER_KIND Registers_sparc
63 #elif defined(__riscv) && __riscv_xlen == 64 66 #elif defined(__riscv)
64 # define REGISTER_KIND Registers_riscv 67 # define REGISTER_KIND Registers_riscv
68 #elif defined(__ve__)
69 # define REGISTER_KIND Registers_ve
65 #else 70 #else
66 # error Architecture not supported 71 # error Architecture not supported
67 #endif 72 #endif
68 // Use "placement new" to allocate UnwindCursor in the cursor buffer. 73 // Use "placement new" to allocate UnwindCursor in the cursor buffer.
69 new (reinterpret_cast<UnwindCursor<LocalAddressSpace, REGISTER_KIND> *>(cursor)) 74 new (reinterpret_cast<UnwindCursor<LocalAddressSpace, REGISTER_KIND> *>(cursor))
180 _LIBUNWIND_WEAK_ALIAS(__unw_get_proc_info, unw_get_proc_info) 185 _LIBUNWIND_WEAK_ALIAS(__unw_get_proc_info, unw_get_proc_info)
181 186
182 /// Resume execution at cursor position (aka longjump). 187 /// Resume execution at cursor position (aka longjump).
183 _LIBUNWIND_HIDDEN int __unw_resume(unw_cursor_t *cursor) { 188 _LIBUNWIND_HIDDEN int __unw_resume(unw_cursor_t *cursor) {
184 _LIBUNWIND_TRACE_API("__unw_resume(cursor=%p)", static_cast<void *>(cursor)); 189 _LIBUNWIND_TRACE_API("__unw_resume(cursor=%p)", static_cast<void *>(cursor));
190 #if __has_feature(address_sanitizer)
191 // Inform the ASan runtime that now might be a good time to clean stuff up.
192 __asan_handle_no_return();
193 #endif
185 AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor; 194 AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
186 co->jumpto(); 195 co->jumpto();
187 return UNW_EUNSPEC; 196 return UNW_EUNSPEC;
188 } 197 }
189 _LIBUNWIND_WEAK_ALIAS(__unw_resume, unw_resume) 198 _LIBUNWIND_WEAK_ALIAS(__unw_resume, unw_resume)