Lines Matching +full:resume +full:- +full:offset
1 //===----------------------------------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 // Implements ARM zero-cost C++ exceptions
10 //===----------------------------------------------------------------------===//
12 #include "Unwind-EHABI.h"
32 uint8_t getByte(const uint32_t* data, size_t offset) { in getByte() argument
35 return byteData[(offset & ~(size_t)0x03) + (3 - (offset & (size_t)0x03))]; in getByte()
37 return byteData[offset]; in getByte()
56 SU16 = 0, // Short descriptor, 16-bit entries
57 LU16 = 1, // Long descriptor, 16-bit entries
58 LU32 = 3, // Long descriptor, 32-bit entries
95 uint32_t offset; in ProcessDescriptors() local
99 descriptor = getNextWord(descriptor, &offset); in ProcessDescriptors()
103 descriptor = getNextNibble(descriptor, &offset); in ProcessDescriptors()
110 // See # 9.2 table for decoding the kind of descriptor. It's a 2-bit value. in ProcessDescriptors()
112 static_cast<Descriptor::Kind>((length & 0x1) | ((offset & 0x1) << 1)); in ProcessDescriptors()
116 offset &= ~1u; in ProcessDescriptors()
117 uintptr_t scopeStart = ucbp->pr_cache.fnstart + offset; in ProcessDescriptors()
173 const uint32_t* unwindingData = ucbp->pr_cache.ehtp; in unwindOneFrame()
185 ucbp->pr_cache.additional); in unwindOneFrame()
203 return ((1U << (count_minus_one + 1)) - 1) << start; in RegisterMask()
218 * @param[out] off Offset from return value (in bytes) to begin interpretation.
234 data++; // Skip the first word, which is the prel31 offset. in decode_eht_entry()
261 size_t offset, size_t len) { in _Unwind_VRS_Interpret() argument
265 while (offset < len && !finish) { in _Unwind_VRS_Interpret()
266 uint8_t byte = getByte(data, offset++); in _Unwind_VRS_Interpret()
271 sp -= (((uint32_t)byte & 0x3f) << 2) + 4; in _Unwind_VRS_Interpret()
278 if (offset >= len) in _Unwind_VRS_Interpret()
282 (((uint32_t)getByte(data, offset++)) << 4); in _Unwind_VRS_Interpret()
314 if (offset >= len) in _Unwind_VRS_Interpret()
316 uint8_t registers = getByte(data, offset++); in _Unwind_VRS_Interpret()
327 if (offset >= len) in _Unwind_VRS_Interpret()
329 uint32_t v = getByte(data, offset++); in _Unwind_VRS_Interpret()
344 uint8_t v = getByte(data, offset++); in _Unwind_VRS_Interpret()
379 uint8_t v = getByte(data, offset++); in _Unwind_VRS_Interpret()
390 uint8_t v = getByte(data, offset++); in _Unwind_VRS_Interpret()
399 uint8_t v = getByte(data, offset++); in _Unwind_VRS_Interpret()
492 unw_word_t offset; in unwind_phase1() local
494 &offset) != UNW_ESUCCESS) || in unwind_phase1()
495 (frameInfo.start_ip + offset > frameInfo.end_ip)) in unwind_phase1()
518 exception_object->pr_cache.fnstart = frameInfo.start_ip; in unwind_phase1()
519 exception_object->pr_cache.ehtp = in unwind_phase1()
521 exception_object->pr_cache.additional = frameInfo.flags; in unwind_phase1()
528 exception_object->pr_cache.fnstart, in unwind_phase1()
529 static_cast<void *>(exception_object->pr_cache.ehtp), in unwind_phase1()
530 exception_object->pr_cache.additional); in unwind_phase1()
567 bool resume) { in unwind_phase2() argument
580 // Resume only ever makes sense for 1 frame. in unwind_phase2()
582 resume ? _US_UNWIND_FRAME_RESUME : _US_UNWIND_FRAME_STARTING; in unwind_phase2()
583 if (resume && frame_count == 1) { in unwind_phase2()
584 // On a resume, first unwind the _Unwind_Resume() frame. The next frame in unwind_phase2()
592 exception_object->unwinder_cache.reserved2); in unwind_phase2()
593 resume = false; in unwind_phase2()
613 unw_word_t offset; in unwind_phase2() local
615 &offset) != UNW_ESUCCESS) || in unwind_phase2()
616 (frameInfo.start_ip + offset > frameInfo.end_ip)) in unwind_phase2()
633 exception_object->pr_cache.fnstart = frameInfo.start_ip; in unwind_phase2()
634 exception_object->pr_cache.ehtp = in unwind_phase2()
636 exception_object->pr_cache.additional = frameInfo.flags; in unwind_phase2()
646 if (sp == exception_object->barrier_cache.sp) { in unwind_phase2()
662 _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): re-entering " in unwind_phase2()
673 exception_object->unwinder_cache.reserved2 = (uint32_t)pc; in unwind_phase2()
693 // Clean up phase did not resume at the frame that the search phase in unwind_phase2()
723 unw_word_t offset; in unwind_phase2_forced() local
725 &offset) != UNW_ESUCCESS) || in unwind_phase2_forced()
726 (frameInfo.start_ip + offset > frameInfo.end_ip)) in unwind_phase2_forced()
740 (*stop)(1, action, exception_object->exception_class, exception_object, in unwind_phase2_forced()
758 exception_object->pr_cache.fnstart = frameInfo.start_ip; in unwind_phase2_forced()
759 exception_object->pr_cache.ehtp = in unwind_phase2_forced()
761 exception_object->pr_cache.additional = frameInfo.flags; in unwind_phase2_forced()
807 (*stop)(1, lastAction, exception_object->exception_class, exception_object, in unwind_phase2_forced()
810 // Clean up phase did not resume at the frame that the search phase said it in unwind_phase2_forced()
826 exception_object->unwinder_cache.reserved1 = 0; in _Unwind_RaiseException()
851 /// Note: re-throwing an exception (as opposed to continuing the unwind)
862 if (exception_object->unwinder_cache.reserved1) in _Unwind_Resume()
865 (_Unwind_Stop_Fn)exception_object->unwinder_cache.reserved1, in _Unwind_Resume()
866 (void *)exception_object->unwinder_cache.reserved3); in _Unwind_Resume()
888 // Only used in _LIBUNWIND_TRACE_API, which is a no-op when assertions are
931 // Can only touch d0-15 with FSTMFDX. in _Unwind_VRS_Set()
964 // There's only one pseudo-register, PAC, with regno == 0. in _Unwind_VRS_Set()
994 // Can only touch d0-15 with FSTMFDX. in _Unwind_VRS_Get_Internal()
1027 // There's only one pseudo-register, PAC, with regno == 0. in _Unwind_VRS_Get_Internal()
1113 // SP is only 32-bit aligned so don't copy 64-bit at a time. in _Unwind_VRS_Pop()
1135 // Return Address Authentication code (PAC) - discriminator 0 in _Unwind_VRS_Pop()
1163 exception_object->unwinder_cache.reserved1 = (uintptr_t)stop; in _Unwind_ForcedUnwind()
1164 exception_object->unwinder_cache.reserved3 = (uintptr_t)stop_parameter; in _Unwind_ForcedUnwind()
1191 if (exception_object->exception_cleanup != NULL) in _Unwind_DeleteException()
1192 (*exception_object->exception_cleanup)(_URC_FOREIGN_EXCEPTION_CAUGHT, in _Unwind_DeleteException()