diff options
Diffstat (limited to 'gdb/common')
-rw-r--r-- | gdb/common/common-exceptions.c | 4 | ||||
-rw-r--r-- | gdb/common/common-exceptions.h | 22 | ||||
-rw-r--r-- | gdb/common/new-op.c | 2 | ||||
-rw-r--r-- | gdb/common/selftest.c | 2 |
4 files changed, 11 insertions, 19 deletions
diff --git a/gdb/common/common-exceptions.c b/gdb/common/common-exceptions.c index b2d8e25..d00a805 100644 --- a/gdb/common/common-exceptions.c +++ b/gdb/common/common-exceptions.c @@ -195,12 +195,12 @@ throw_exception_cxx (struct gdb_exception exception) { if (exception.reason == RETURN_QUIT) { - gdb_exception_RETURN_MASK_QUIT ex (exception); + gdb_exception_quit ex (exception); throw ex; } else if (exception.reason == RETURN_ERROR) { - gdb_exception_RETURN_MASK_ERROR ex (exception); + gdb_exception_error ex (exception); throw ex; } else diff --git a/gdb/common/common-exceptions.h b/gdb/common/common-exceptions.h index 54e7404..55ce02d 100644 --- a/gdb/common/common-exceptions.h +++ b/gdb/common/common-exceptions.h @@ -253,26 +253,18 @@ extern void exception_rethrow (void) ATTRIBUTE_NORETURN; around gdb_exception that add nothing but type info. Which is used is selected depending on the MASK argument passed to CATCH. */ -struct gdb_exception_RETURN_MASK_ALL : public gdb_exception +struct gdb_exception_error : public gdb_exception { - explicit gdb_exception_RETURN_MASK_ALL (const gdb_exception &ex) noexcept + explicit gdb_exception_error (const gdb_exception &ex) noexcept : gdb_exception (ex) { } }; -struct gdb_exception_RETURN_MASK_ERROR : public gdb_exception_RETURN_MASK_ALL +struct gdb_exception_quit : public gdb_exception { - explicit gdb_exception_RETURN_MASK_ERROR (const gdb_exception &ex) noexcept - : gdb_exception_RETURN_MASK_ALL (ex) - { - } -}; - -struct gdb_exception_RETURN_MASK_QUIT : public gdb_exception_RETURN_MASK_ALL -{ - explicit gdb_exception_RETURN_MASK_QUIT (const gdb_exception &ex) noexcept - : gdb_exception_RETURN_MASK_ALL (ex) + explicit gdb_exception_quit (const gdb_exception &ex) noexcept + : gdb_exception (ex) { } }; @@ -284,11 +276,11 @@ struct gdb_exception_RETURN_MASK_QUIT : public gdb_exception_RETURN_MASK_ALL spread around the codebase. */ struct gdb_quit_bad_alloc - : public gdb_exception_RETURN_MASK_QUIT, + : public gdb_exception_quit, public std::bad_alloc { explicit gdb_quit_bad_alloc (const gdb_exception &ex) noexcept - : gdb_exception_RETURN_MASK_QUIT (ex), + : gdb_exception_quit (ex), std::bad_alloc () { } diff --git a/gdb/common/new-op.c b/gdb/common/new-op.c index c358b80..b230f11 100644 --- a/gdb/common/new-op.c +++ b/gdb/common/new-op.c @@ -64,7 +64,7 @@ operator new (std::size_t sz) { malloc_failure (sz); } - catch (const gdb_exception_RETURN_MASK_ALL &ex) + catch (const gdb_exception &ex) { throw gdb_quit_bad_alloc (ex); } diff --git a/gdb/common/selftest.c b/gdb/common/selftest.c index 3f3ff74..f5a7b3c 100644 --- a/gdb/common/selftest.c +++ b/gdb/common/selftest.c @@ -87,7 +87,7 @@ run_tests (const char *filter) ++ran; (*test) (); } - catch (const gdb_exception_RETURN_MASK_ERROR &ex) + catch (const gdb_exception_error &ex) { ++failed; debug_printf ("Self test failed: %s\n", ex.what ()); |