-#if GDB_XCPT == GDB_XCPT_TRY
-
-/* We still need to wrap TRY/CATCH in C++ so that cleanups and C++
- exceptions can coexist. The TRY blocked is wrapped in a
- do/while(0) so that break/continue within the block works the same
- as in C. */
-#define TRY \
- try \
- { \
- exception_try_scope exception_try_scope_instance; \
- do \
- {
-
-#define CATCH(EXCEPTION, MASK) \
- } while (0); \
- } \
- catch (struct gdb_exception ## _ ## MASK &EXCEPTION)
-
-#define END_CATCH \
- catch (...) \
- { \
- exception_rethrow (); \
+ explicit gdb_exception_error (gdb_exception &&ex) noexcept
+ : gdb_exception (std::move (ex))
+ {
+ gdb_assert (ex.reason == RETURN_ERROR);