Пример #1
0
void
throw_exception (struct gdb_exception exception)
{
  prepare_to_throw_exception ();

  do_cleanups (all_cleanups ());

#if GDB_XCPT == GDB_XCPT_SJMP
  /* Jump to the containing catch_errors() call, communicating REASON
     to that call via setjmp's return value.  Note that REASON can't
     be zero, by definition in defs.h.  */
  exceptions_state_mc (CATCH_THROWING);
  current_catcher->exception = exception;
  SIGLONGJMP (current_catcher->buf, exception.reason);
#else
  if (exception.reason == RETURN_QUIT)
    {
      gdb_exception_RETURN_MASK_QUIT ex;

      gdb_exception_sliced_copy (&ex, &exception);
      throw ex;
    }
  else if (exception.reason == RETURN_ERROR)
    {
      gdb_exception_RETURN_MASK_ERROR ex;

      gdb_exception_sliced_copy (&ex, &exception);
      throw ex;
    }
  else
    gdb_assert_not_reached ("invalid return reason");
#endif
}
Пример #2
0
void
throw_exception_sjlj (const struct gdb_exception &exception)
{
  /* Jump to the nearest CATCH_SJLJ block, communicating REASON to
     that call via setjmp's return value.  Note that REASON can't be
     zero, by definition in common-exceptions.h.  */
  exceptions_state_mc (CATCH_THROWING);
  enum return_reason reason = exception.reason;
  catchers.front ().exception = exception;
  longjmp (catchers.front ().buf, reason);
}
Пример #3
0
void
throw_exception_sjlj (struct gdb_exception exception)
{
  do_cleanups (all_cleanups ());

  /* Jump to the nearest CATCH_SJLJ block, communicating REASON to
     that call via setjmp's return value.  Note that REASON can't be
     zero, by definition in common-exceptions.h.  */
  exceptions_state_mc (CATCH_THROWING);
  current_catcher->exception = exception;
  longjmp (current_catcher->buf, exception.reason);
}
Пример #4
0
void
throw_exception (struct gdb_exception exception)
{
  clear_quit_flag ();
  immediate_quit = 0;

  do_cleanups (all_cleanups ());

  /* Jump to the containing catch_errors() call, communicating REASON
     to that call via setjmp's return value.  Note that REASON can't
     be zero, by definition in defs.h.  */
  exceptions_state_mc (CATCH_THROWING);
  *current_catcher->exception = exception;
  EXCEPTIONS_SIGLONGJMP (current_catcher->buf, exception.reason);
}
Пример #5
0
int
exceptions_state_mc_action_iter_1 (void)
{
  return exceptions_state_mc (CATCH_ITER_1);
}