/* Exception handling and frame unwind runtime interface routines. -*- C -*-
- Copyright (C) 2001-2018 Free Software Foundation, Inc.
+ Copyright (C) 2001-2023 Free Software Foundation, Inc.
This file is part of GCC.
gcc_assert (!match_handler);
uw_update_context (context, &fs);
- frames++;
+ _Unwind_Frames_Increment (exc, context, frames);
}
*frames_p = frames;
/* Set up fs to describe the FDE for the caller of cur_context. */
code = uw_frame_state_for (context, &fs);
- if (code != _URC_NO_REASON && code != _URC_END_OF_STACK)
+ if (code != _URC_NO_REASON && code != _URC_END_OF_STACK
+ && code != _URC_NORMAL_STOP)
return _URC_FATAL_PHASE2_ERROR;
/* Unwind successful. */
action = _UA_FORCE_UNWIND | _UA_CLEANUP_PHASE;
- if (code == _URC_END_OF_STACK)
+ if (code == _URC_END_OF_STACK || code == _URC_NORMAL_STOP)
action |= _UA_END_OF_STACK;
stop_code = (*stop) (1, action, exc->exception_class, exc,
context, stop_argument);
/* Update cur_context to describe the same frame as fs, and discard
the previous context if necessary. */
uw_advance_context (context, &fs);
- frames++;
+ _Unwind_Frames_Increment (exc, context, frames);
}
*frames_p = frames;
/* Set up fs to describe the FDE for the caller of context. */
code = uw_frame_state_for (&context, &fs);
- if (code != _URC_NO_REASON && code != _URC_END_OF_STACK)
+ if (code != _URC_NO_REASON && code != _URC_END_OF_STACK
+ && code != _URC_NORMAL_STOP)
return _URC_FATAL_PHASE1_ERROR;
/* Call trace function. */
if ((*trace) (&context, trace_argument) != _URC_NO_REASON)
return _URC_FATAL_PHASE1_ERROR;
- /* We're done at end of stack. */
+#ifdef MD_BACKCHAIN_FALLBACK
+ /* Do a backchain if there is no DWARF data. */
+ if (code == _URC_NORMAL_STOP)
+ {
+ MD_BACKCHAIN_FALLBACK(&context, trace_argument);
+ break;
+ }
+#endif
+
+ /* We're done at end of stack. */
if (code == _URC_END_OF_STACK)
break;