-/* Reasons for calling throw_exceptions(). NOTE: all reason values
- must be less than zero. enum value 0 is reserved for internal use
- as the return value from an initial setjmp(). The function
- catch_exceptions() reserves values >= 0 as legal results from its
- wrapped function. */
-
-enum return_reason
- {
- /* User interrupt. */
- RETURN_QUIT = -2,
- /* Any other error. */
- RETURN_ERROR
- };
-
-#define RETURN_MASK(reason) (1 << (int)(-reason))
-#define RETURN_MASK_QUIT RETURN_MASK (RETURN_QUIT)
-#define RETURN_MASK_ERROR RETURN_MASK (RETURN_ERROR)
-#define RETURN_MASK_ALL (RETURN_MASK_QUIT | RETURN_MASK_ERROR)
-typedef int return_mask;
-
-/* Describe all exceptions. */
-
-enum errors {
- NO_ERROR,
- /* Any generic error, the corresponding text is in
- exception.message. */
- GENERIC_ERROR,
- /* Add more errors here. */
- NR_ERRORS
-};
-
-struct exception
-{
- enum return_reason reason;
- enum errors error;
- char *message;
-};
-
-/* A pre-defined non-exception. */
-extern const struct exception exception_none;
-
-/* Throw an exception (as described by "struct exception"). Will
- execute a LONG JUMP to the inner most containing exception handler
- established using catch_exceptions() (or similar).
-
- Code normally throws an exception using error() et.al. For various
- reaons, GDB also contains code that throws an exception directly.
- For instance, the remote*.c targets contain CNTRL-C signal handlers
- that propogate the QUIT event up the exception chain. ``This could
- be a good thing or a dangerous thing.'' -- the Existential
- Wombat. */
-
-extern NORETURN void throw_exception (struct exception exception) ATTR_NORETURN;
-extern NORETURN void throw_reason (enum return_reason reason) ATTR_NORETURN;