Lines Matching +full:1 +full:- +full:stop
1 //===----------------------------------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 // Implements setjump-longjump based C++ exceptions
10 //===----------------------------------------------------------------------===//
26 /// keeps a linked list (stack) of these blocks - one per thread. The calling
58 // 0 = r7, 1 = pc, 2 = sp
109 fc->prev = __Unwind_SjLj_GetTopOfFunctionStack();
117 __Unwind_SjLj_SetTopOfFunctionStack(fc->prev);
124 _LIBUNWIND_TRACE_UNWINDING("unwind_phase1: initial function-context=%p",
127 // walk each frame looking for a place to stop
128 for (bool handlerNotFound = true; handlerNotFound; c = c->prev) {
138 _LIBUNWIND_TRACE_UNWINDING("unwind_phase1: function-context=%p", (void *)c);
139 // if there is a personality routine, ask it if it will want to stop at this
141 if (c->personality != NULL) {
145 (void *)c->personality);
146 _Unwind_Reason_Code personalityResult = (*c->personality)(
147 1, _UA_SEARCH_PHASE, exception_object->exception_class,
152 // stop search and remember function context
154 exception_object->private_2 = (uintptr_t) c;
185 // walk each frame until we reach where search phase said to stop
201 if (c->personality != NULL) {
203 if ((uintptr_t) c == exception_object->private_2)
207 // in phase 1
209 (*c->personality)(1, action, exception_object->exception_class,
217 if ((uintptr_t) c == exception_object->private_2) {
218 // phase 1 said we would stop at this frame, but we did not...
220 "stop here, but now if phase2 it did not stop here");
227 (void *)exception_object, c->jbuf[1]);
231 __builtin_longjmp(c->jbuf, 1);
241 c = c->prev;
252 _Unwind_Stop_Fn stop, void *stop_parameter) {
253 // walk each frame until we reach where search phase said to stop
266 // call stop function at each frame
270 (*stop)(1, action, exception_object->exception_class, exception_object,
273 "stop function returned %d",
277 "stopped by stop function",
283 if (c->personality != NULL) {
284 _Unwind_Personality_Fn p = (_Unwind_Personality_Fn)c->personality;
289 (*p)(1, action, exception_object->exception_class, exception_object,
304 __builtin_longjmp(c->jbuf, 1);
315 c = c->prev;
318 // call stop function one last time and tell it we've reached the end of the
320 _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): calling stop "
325 (*stop)(1, lastAction, exception_object->exception_class, exception_object,
340 // mark that this is a non-forced unwind, so _Unwind_Resume() can do the right
342 exception_object->private_1 = 0;
343 exception_object->private_2 = 0;
345 // phase 1: the search phase
364 /// Re-throwing an exception is implemented by having the code call
371 if (exception_object->private_1 != 0)
373 (_Unwind_Stop_Fn) exception_object->private_1,
374 (void *)exception_object->private_2);
388 (void *)exception_object, exception_object->private_1);
389 // If this is non-forced and a stopping place was found, then this is a
390 // re-throw.
392 if (exception_object->private_1 == 0) {
412 (void *)context, ufc->lsda);
413 return ufc->lsda;
423 return ufc->resumeParameters[index];
434 ufc->resumeParameters[index] = new_value;
442 (void *)context, ufc->resumeLocation + 1);
443 return ufc->resumeLocation + 1;
456 ufc->resumeLocation + 1);
457 return ufc->resumeLocation + 1;
467 ufc->resumeLocation = new_value - 1;
488 if (exception_object->exception_cleanup != NULL)
489 (*exception_object->exception_cleanup)(_URC_FOREIGN_EXCEPTION_CAUGHT,
524 return (uintptr_t) ufc->jbuf[2];