-#include "gdb_assert.h"
-#include "gdb_string.h"
-
-const struct exception exception_none = { 0, NO_ERROR, NULL };
-
-/* One should use catch_errors rather than manipulating these
- directly. */
-#if defined(HAVE_SIGSETJMP)
-#define SIGJMP_BUF sigjmp_buf
-#define SIGSETJMP(buf) sigsetjmp((buf), 1)
-#define SIGLONGJMP(buf,val) siglongjmp((buf), (val))
-#else
-#define SIGJMP_BUF jmp_buf
-#define SIGSETJMP(buf) setjmp(buf)
-#define SIGLONGJMP(buf,val) longjmp((buf), (val))
-#endif
-
-/* Possible catcher states. */
-enum catcher_state {
- /* Initial state, a new catcher has just been created. */
- CATCHER_CREATED,
- /* The catch code is running. */
- CATCHER_RUNNING,
- CATCHER_RUNNING_1,
- /* The catch code threw an exception. */
- CATCHER_ABORTING
-};
-
-/* Possible catcher actions. */
-enum catcher_action {
- CATCH_ITER,
- CATCH_ITER_1,
- CATCH_THROWING
-};
-
-struct catcher
-{
- enum catcher_state state;
- /* Jump buffer pointing back at the exception handler. */
- SIGJMP_BUF buf;
- /* Status buffer belonging to that exception handler. */
- volatile struct exception *exception;
- /* Saved/current state. */
- int mask;
- char *saved_error_pre_print;
- char *saved_quit_pre_print;
- struct ui_out *saved_uiout;
- struct cleanup *saved_cleanup_chain;
- /* Back link. */
- struct catcher *prev;
-};
-
-/* Where to go for throw_exception(). */
-static struct catcher *current_catcher;
-
-static SIGJMP_BUF *
-catcher_init (struct ui_out *func_uiout,
- char *errstring,
- volatile struct exception *exception,
- return_mask mask)