This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH v2 17/22] Rename gdb exception types


This renames the gdb exception types.  The old types were only needed
due to the macros in common-exception.h that are now gone.

The intermediate layer of gdb_exception_RETURN_MASK_ALL did not seem
needed, so this patch removes it entirely.

gdb/ChangeLog
2019-02-27  Tom Tromey  <tom@tromey.com>

	* aarch64-tdep.c: Update.
	* ada-lang.c: Update.
	* ada-typeprint.c: Update.
	* ada-valprint.c: Update.
	* amd64-tdep.c: Update.
	* arch-utils.c: Update.
	* break-catch-throw.c: Update.
	* breakpoint.c: Update.
	* btrace.c: Update.
	* c-varobj.c: Update.
	* cli/cli-cmds.c: Update.
	* cli/cli-interp.c: Update.
	* cli/cli-script.c: Update.
	* common/common-exceptions.c: Update.
	* common/common-exceptions.h (gdb_exception_RETURN_MASK_ALL):
	Remove.
	(gdb_exception_error): Rename from
	gdb_exception_RETURN_MASK_ERROR.
	(gdb_exception_quit): Rename from gdb_exception_RETURN_MASK_QUIT.
	(gdb_quit_bad_alloc): Update.
	* common/new-op.c: Update.
	* common/selftest.c: Update.
	* compile/compile-c-symbols.c: Update.
	* compile/compile-cplus-symbols.c: Update.
	* compile/compile-object-load.c: Update.
	* compile/compile-object-run.c: Update.
	* completer.c: Update.
	* corelow.c: Update.
	* cp-abi.c: Update.
	* cp-support.c: Update.
	* cp-valprint.c: Update.
	* darwin-nat.c: Update.
	* disasm-selftests.c: Update.
	* dtrace-probe.c: Update.
	* dwarf-index-cache.c: Update.
	* dwarf-index-write.c: Update.
	* dwarf2-frame-tailcall.c: Update.
	* dwarf2-frame.c: Update.
	* dwarf2loc.c: Update.
	* dwarf2read.c: Update.
	* eval.c: Update.
	* event-loop.c: Update.
	* event-top.c: Update.
	* exec.c: Update.
	* f-valprint.c: Update.
	* fbsd-tdep.c: Update.
	* frame-unwind.c: Update.
	* frame.c: Update.
	* gcore.c: Update.
	* gdbtypes.c: Update.
	* gnu-v3-abi.c: Update.
	* guile/guile-internal.h: Update.
	* guile/scm-block.c: Update.
	* guile/scm-breakpoint.c: Update.
	* guile/scm-cmd.c: Update.
	* guile/scm-disasm.c: Update.
	* guile/scm-frame.c: Update.
	* guile/scm-lazy-string.c: Update.
	* guile/scm-math.c: Update.
	* guile/scm-param.c: Update.
	* guile/scm-ports.c: Update.
	* guile/scm-pretty-print.c: Update.
	* guile/scm-symbol.c: Update.
	* guile/scm-symtab.c: Update.
	* guile/scm-type.c: Update.
	* guile/scm-value.c: Update.
	* i386-linux-tdep.c: Update.
	* i386-tdep.c: Update.
	* inf-loop.c: Update.
	* infcall.c: Update.
	* infcmd.c: Update.
	* infrun.c: Update.
	* jit.c: Update.
	* language.c: Update.
	* linespec.c: Update.
	* linux-fork.c: Update.
	* linux-nat.c: Update.
	* linux-tdep.c: Update.
	* linux-thread-db.c: Update.
	* main.c: Update.
	* mi/mi-cmd-break.c: Update.
	* mi/mi-cmd-stack.c: Update.
	* mi/mi-interp.c: Update.
	* mi/mi-main.c: Update.
	* objc-lang.c: Update.
	* p-valprint.c: Update.
	* parse.c: Update.
	* ppc-linux-tdep.c: Update.
	* printcmd.c: Update.
	* python/py-arch.c: Update.
	* python/py-breakpoint.c: Update.
	* python/py-cmd.c: Update.
	* python/py-finishbreakpoint.c: Update.
	* python/py-frame.c: Update.
	* python/py-framefilter.c: Update.
	* python/py-gdb-readline.c: Update.
	* python/py-inferior.c: Update.
	* python/py-infthread.c: Update.
	* python/py-lazy-string.c: Update.
	* python/py-linetable.c: Update.
	* python/py-objfile.c: Update.
	* python/py-param.c: Update.
	* python/py-prettyprint.c: Update.
	* python/py-progspace.c: Update.
	* python/py-record-btrace.c: Update.
	* python/py-record.c: Update.
	* python/py-symbol.c: Update.
	* python/py-type.c: Update.
	* python/py-unwind.c: Update.
	* python/py-utils.c: Update.
	* python/py-value.c: Update.
	* python/python.c: Update.
	* record-btrace.c: Update.
	* record-full.c: Update.
	* remote-fileio.c: Update.
	* remote.c: Update.
	* riscv-tdep.c: Update.
	* rs6000-aix-tdep.c: Update.
	* rs6000-tdep.c: Update.
	* rust-exp.y: Update.
	* rust-lang.c: Update.
	* s390-tdep.c: Update.
	* selftest-arch.c: Update.
	* solib-dsbt.c: Update.
	* solib-frv.c: Update.
	* solib-spu.c: Update.
	* solib-svr4.c: Update.
	* solib.c: Update.
	* sparc64-linux-tdep.c: Update.
	* stack.c: Update.
	* symfile-mem.c: Update.
	* symmisc.c: Update.
	* target.c: Update.
	* thread.c: Update.
	* top.c: Update.
	* tracefile-tfile.c: Update.
	* tui/tui.c: Update.
	* typeprint.c: Update.
	* unittests/cli-utils-selftests.c: Update.
	* unittests/parse-connection-spec-selftests.c: Update.
	* valops.c: Update.
	* valprint.c: Update.
	* value.c: Update.
	* varobj.c: Update.
	* windows-nat.c: Update.
	* x86-linux-nat.c: Update.
	* xml-support.c: Update.

gdb/gdbserver/ChangeLog
2019-02-27  Tom Tromey  <tom@tromey.com>

	* gdbreplay.c: Update.
	* linux-low.c: Update.
	* server.c: Update.
---
 gdb/ChangeLog                                 | 150 ++++++++++++++++++
 gdb/aarch64-tdep.c                            |   4 +-
 gdb/ada-lang.c                                |  14 +-
 gdb/ada-typeprint.c                           |   2 +-
 gdb/ada-valprint.c                            |   2 +-
 gdb/amd64-tdep.c                              |   6 +-
 gdb/arch-utils.c                              |   2 +-
 gdb/break-catch-throw.c                       |   6 +-
 gdb/breakpoint.c                              |  28 ++--
 gdb/btrace.c                                  |  14 +-
 gdb/c-varobj.c                                |   8 +-
 gdb/cli/cli-cmds.c                            |   2 +-
 gdb/cli/cli-interp.c                          |   2 +-
 gdb/cli/cli-script.c                          |   4 +-
 gdb/common/common-exceptions.c                |   4 +-
 gdb/common/common-exceptions.h                |  10 +-
 gdb/common/new-op.c                           |   2 +-
 gdb/common/selftest.c                         |   2 +-
 gdb/compile/compile-c-symbols.c               |   6 +-
 gdb/compile/compile-cplus-symbols.c           |   4 +-
 gdb/compile/compile-object-load.c             |   2 +-
 gdb/compile/compile-object-run.c              |   2 +-
 gdb/completer.c                               |   8 +-
 gdb/corelow.c                                 |   4 +-
 gdb/cp-abi.c                                  |   4 +-
 gdb/cp-support.c                              |   6 +-
 gdb/cp-valprint.c                             |   4 +-
 gdb/darwin-nat.c                              |   4 +-
 gdb/disasm-selftests.c                        |   2 +-
 gdb/dtrace-probe.c                            |   2 +-
 gdb/dwarf-index-cache.c                       |   4 +-
 gdb/dwarf-index-write.c                       |   2 +-
 gdb/dwarf2-frame-tailcall.c                   |   2 +-
 gdb/dwarf2-frame.c                            |   6 +-
 gdb/dwarf2loc.c                               |   6 +-
 gdb/dwarf2read.c                              |   2 +-
 gdb/eval.c                                    |  10 +-
 gdb/event-loop.c                              |   2 +-
 gdb/event-top.c                               |   6 +-
 gdb/exec.c                                    |   4 +-
 gdb/f-valprint.c                              |   2 +-
 gdb/fbsd-tdep.c                               |   2 +-
 gdb/frame-unwind.c                            |   2 +-
 gdb/frame.c                                   |  12 +-
 gdb/gcore.c                                   |   2 +-
 gdb/gdbserver/ChangeLog                       |   6 +
 gdb/gdbserver/gdbreplay.c                     |   2 +-
 gdb/gdbserver/linux-low.c                     |   4 +-
 gdb/gdbserver/server.c                        |  12 +-
 gdb/gdbtypes.c                                |   4 +-
 gdb/gnu-v3-abi.c                              |   2 +-
 gdb/guile/guile-internal.h                    |   2 +-
 gdb/guile/scm-block.c                         |   2 +-
 gdb/guile/scm-breakpoint.c                    |  16 +-
 gdb/guile/scm-cmd.c                           |   2 +-
 gdb/guile/scm-disasm.c                        |   2 +-
 gdb/guile/scm-frame.c                         |  38 ++---
 gdb/guile/scm-lazy-string.c                   |   2 +-
 gdb/guile/scm-math.c                          |   2 +-
 gdb/guile/scm-param.c                         |   4 +-
 gdb/guile/scm-ports.c                         |   2 +-
 gdb/guile/scm-pretty-print.c                  |   2 +-
 gdb/guile/scm-symbol.c                        |  10 +-
 gdb/guile/scm-symtab.c                        |   2 +-
 gdb/guile/scm-type.c                          |  24 +--
 gdb/guile/scm-value.c                         |  30 ++--
 gdb/i386-linux-tdep.c                         |   2 +-
 gdb/i386-tdep.c                               |   6 +-
 gdb/inf-loop.c                                |   2 +-
 gdb/infcall.c                                 |   2 +-
 gdb/infcmd.c                                  |   4 +-
 gdb/infrun.c                                  |  14 +-
 gdb/jit.c                                     |   2 +-
 gdb/language.c                                |   2 +-
 gdb/linespec.c                                |  12 +-
 gdb/linux-fork.c                              |   2 +-
 gdb/linux-nat.c                               |   8 +-
 gdb/linux-tdep.c                              |   2 +-
 gdb/linux-thread-db.c                         |   6 +-
 gdb/main.c                                    |   6 +-
 gdb/mi/mi-cmd-break.c                         |   2 +-
 gdb/mi/mi-cmd-stack.c                         |   2 +-
 gdb/mi/mi-interp.c                            |   2 +-
 gdb/mi/mi-main.c                              |   4 +-
 gdb/objc-lang.c                               |   2 +-
 gdb/p-valprint.c                              |   2 +-
 gdb/parse.c                                   |   4 +-
 gdb/ppc-linux-tdep.c                          |   2 +-
 gdb/printcmd.c                                |   8 +-
 gdb/python/py-arch.c                          |   2 +-
 gdb/python/py-breakpoint.c                    |  16 +-
 gdb/python/py-cmd.c                           |   2 +-
 gdb/python/py-finishbreakpoint.c              |  12 +-
 gdb/python/py-frame.c                         |  36 ++---
 gdb/python/py-framefilter.c                   |   4 +-
 gdb/python/py-gdb-readline.c                  |   2 +-
 gdb/python/py-inferior.c                      |  10 +-
 gdb/python/py-infthread.c                     |   2 +-
 gdb/python/py-lazy-string.c                   |   2 +-
 gdb/python/py-linetable.c                     |   2 +-
 gdb/python/py-objfile.c                       |   4 +-
 gdb/python/py-param.c                         |   2 +-
 gdb/python/py-prettyprint.c                   |   4 +-
 gdb/python/py-progspace.c                     |   4 +-
 gdb/python/py-record-btrace.c                 |   8 +-
 gdb/python/py-record.c                        |   4 +-
 gdb/python/py-symbol.c                        |  10 +-
 gdb/python/py-type.c                          |  36 ++---
 gdb/python/py-unwind.c                        |   8 +-
 gdb/python/py-utils.c                         |   2 +-
 gdb/python/py-value.c                         |  60 +++----
 gdb/python/python.c                           |  14 +-
 gdb/record-btrace.c                           |  18 +--
 gdb/record-full.c                             |   8 +-
 gdb/remote-fileio.c                           |   2 +-
 gdb/remote.c                                  |  10 +-
 gdb/riscv-tdep.c                              |   4 +-
 gdb/rs6000-aix-tdep.c                         |   2 +-
 gdb/rs6000-tdep.c                             |   4 +-
 gdb/rust-exp.y                                |   2 +-
 gdb/rust-lang.c                               |   2 +-
 gdb/s390-tdep.c                               |   2 +-
 gdb/selftest-arch.c                           |   2 +-
 gdb/solib-dsbt.c                              |   2 +-
 gdb/solib-frv.c                               |   2 +-
 gdb/solib-spu.c                               |   2 +-
 gdb/solib-svr4.c                              |  12 +-
 gdb/solib.c                                   |   8 +-
 gdb/sparc64-linux-tdep.c                      |   2 +-
 gdb/stack.c                                   |  22 +--
 gdb/symfile-mem.c                             |   2 +-
 gdb/symmisc.c                                 |   2 +-
 gdb/target.c                                  |   2 +-
 gdb/thread.c                                  |   2 +-
 gdb/top.c                                     |   8 +-
 gdb/tracefile-tfile.c                         |   2 +-
 gdb/tui/tui.c                                 |   2 +-
 gdb/typeprint.c                               |   2 +-
 gdb/unittests/cli-utils-selftests.c           |   4 +-
 .../parse-connection-spec-selftests.c         |   2 +-
 gdb/valops.c                                  |   4 +-
 gdb/valprint.c                                |   2 +-
 gdb/value.c                                   |   4 +-
 gdb/varobj.c                                  |  12 +-
 gdb/windows-nat.c                             |   2 +-
 gdb/x86-linux-nat.c                           |   2 +-
 gdb/xml-support.c                             |   4 +-
 147 files changed, 602 insertions(+), 450 deletions(-)

diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index b4f1cf895a5..bee1e7ed93b 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -780,7 +780,7 @@ aarch64_make_prologue_cache (struct frame_info *this_frame, void **this_cache)
     {
       aarch64_make_prologue_cache_1 (this_frame, cache);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
 	throw_exception (ex);
@@ -906,7 +906,7 @@ aarch64_make_stub_cache (struct frame_info *this_frame, void **this_cache)
       cache->prev_pc = get_frame_pc (this_frame);
       cache->available_p = 1;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
 	throw_exception (ex);
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 61fef64a488..17a11842634 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -6717,7 +6717,7 @@ ada_tag_value_at_base_address (struct value *obj)
       offset_to_top = value_as_long (value_ind (value_ptradd (val, -2)));
     }
 
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       return obj;
     }
@@ -6864,7 +6864,7 @@ ada_tag_name (struct value *tag)
       if (tsd != NULL)
 	name = ada_tag_name_from_tsd (tsd);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
     }
 
@@ -9045,7 +9045,7 @@ ada_to_fixed_type_1 (struct type *type, const gdb_byte *valaddr,
 	      {
 		xvz_found = get_int_var_value (xvz_name, size);
 	      }
-	    catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	    catch (const struct gdb_exception_error &except)
 	      {
 		/* We found the variable, but somehow failed to read
 		   its value.  Rethrow the same error, but with a little
@@ -12335,7 +12335,7 @@ ada_exception_message (void)
     {
       e_msg = ada_exception_message_1 ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       e_msg.reset (nullptr);
     }
@@ -12359,7 +12359,7 @@ ada_exception_name_addr (enum ada_exception_catchpoint_kind ex,
       result = ada_exception_name_addr_1 (ex, b);
     }
 
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       warning (_("failed to get exception name: %s"), e.message.c_str ());
       return 0;
@@ -12450,7 +12450,7 @@ create_excep_cond_exprs (struct ada_catchpoint *c,
 				 block_for_pc (bl->address),
 				 0);
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+	  catch (const struct gdb_exception_error &e)
 	    {
 	      warning (_("failed to reevaluate internal exception condition "
 			 "for catchpoint %d: %s"),
@@ -12521,7 +12521,7 @@ should_stop_exception (const struct bp_location *bl)
       stop = value_true (evaluate_expression (ada_loc->excep_cond_expr.get ()));
       value_free_to_mark (mark);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       exception_fprintf (gdb_stderr, ex,
 			 _("Error in testing exception condition:\n"));
diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
index d3008cd2d96..2b50bc6b21c 100644
--- a/gdb/ada-typeprint.c
+++ b/gdb/ada-typeprint.c
@@ -168,7 +168,7 @@ print_range (struct type *type, struct ui_file *stream,
 	    lo = ada_discrete_type_low_bound (type);
 	    hi = ada_discrete_type_high_bound (type);
 	  }
-	catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+	catch (const struct gdb_exception_error &e)
 	  {
 	    /* This can happen when the range is dynamic.  Sometimes,
 	       resolving dynamic property values requires us to have
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index 57336ed6c3a..7a3ad46fa0a 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -1210,7 +1210,7 @@ ada_val_print (struct type *type,
 		       stream, recurse, val, options,
 		       current_language);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       fprintf_filtered (stream, _("<error reading variable: %s>"),
 			except.message.c_str ());
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index eeb0a9dd73c..cff1d2419b8 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -2585,7 +2585,7 @@ amd64_frame_cache (struct frame_info *this_frame, void **this_cache)
     {
       amd64_frame_cache_1 (this_frame, cache);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
 	throw_exception (ex);
@@ -2712,7 +2712,7 @@ amd64_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
 
       cache->base_p = 1;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
 	throw_exception (ex);
@@ -2892,7 +2892,7 @@ amd64_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
 
       cache->base_p = 1;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
 	throw_exception (ex);
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 442ab89db81..e274d7820b7 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -973,7 +973,7 @@ gdbarch_skip_prologue_noexcept (gdbarch *gdbarch, CORE_ADDR pc) noexcept
     {
       new_pc = gdbarch_skip_prologue (gdbarch, pc);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {}
 
   return new_pc;
diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c
index b7c72f0a755..ca1d7c71bd7 100644
--- a/gdb/break-catch-throw.c
+++ b/gdb/break-catch-throw.c
@@ -166,7 +166,7 @@ check_status_exception_catchpoint (struct bpstats *bs)
       if (!canon.empty ())
 	std::swap (type_name, canon);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       exception_print (gdb_stderr, e);
     }
@@ -194,7 +194,7 @@ re_set_exception_catchpoint (struct breakpoint *self)
 	= new_probe_location (exception_functions[kind].probe);
       sals = parse_probes (location.get (), filter_pspace, NULL);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       /* Using the probe interface failed.  Let's fallback to the normal
 	 catchpoint mode.  */
@@ -209,7 +209,7 @@ re_set_exception_catchpoint (struct breakpoint *self)
 	  sals = self->ops->decode_location (self, location.get (),
 					     filter_pspace);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  /* NOT_FOUND_ERROR just means the breakpoint will be
 	     pending, so let it through.  */
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 50555bb38ce..35dbc867f7a 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -2101,7 +2101,7 @@ parse_cond_to_aexpr (CORE_ADDR scope, struct expression *cond)
       aexpr = gen_eval_for_expr (scope, cond);
     }
 
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       /* If we got here, it means the condition could not be parsed to a valid
 	 bytecode expression and thus can't be evaluated on the target's side.
@@ -2276,7 +2276,7 @@ parse_cmd_to_aexpr (CORE_ADDR scope, char *cmd)
 			  format_start, format_end - format_start,
 			  argvec.size (), argvec.data ());
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       /* If we got here, it means the command could not be parsed to a valid
 	 bytecode expression and thus can't be evaluated on the target's side.
@@ -2544,7 +2544,7 @@ insert_bp_location (struct bp_location *bl,
 	      if (val)
 		bp_excpt = gdb_exception {RETURN_ERROR, GENERIC_ERROR};
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ALL &e)
+	  catch (const struct gdb_exception &e)
 	    {
 	      bp_excpt = e;
 	    }
@@ -2583,7 +2583,7 @@ insert_bp_location (struct bp_location *bl,
 			bp_excpt
 			  = gdb_exception {RETURN_ERROR, GENERIC_ERROR};
 		    }
-		  catch (const struct gdb_exception_RETURN_MASK_ALL &e)
+		  catch (const struct gdb_exception &e)
 		    {
 		      bp_excpt = e;
 		    }
@@ -2607,7 +2607,7 @@ insert_bp_location (struct bp_location *bl,
 		  if (val)
 		    bp_excpt = gdb_exception {RETURN_ERROR, GENERIC_ERROR};
 	        }
-	      catch (const struct gdb_exception_RETURN_MASK_ALL &e)
+	      catch (const struct gdb_exception &e)
 	        {
 		  bp_excpt = e;
 	        }
@@ -5015,7 +5015,7 @@ bpstat_check_watchpoint (bpstat bs)
 	    {
 	      e = watchpoint_check (bs);
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+	  catch (const struct gdb_exception &ex)
 	    {
 	      exception_fprintf (gdb_stderr, ex,
 				 "Error evaluating expression "
@@ -5252,7 +5252,7 @@ bpstat_check_breakpoint_conditions (bpstat bs, thread_info *thread)
 	    {
 	      condition_result = breakpoint_cond_eval (cond);
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+	  catch (const struct gdb_exception &ex)
 	    {
 	      exception_fprintf (gdb_stderr, ex,
 				 "Error in testing breakpoint condition:\n");
@@ -9233,7 +9233,7 @@ create_breakpoint (struct gdbarch *gdbarch,
     {
       ops->create_sals_from_location (location, &canonical, type_wanted);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       /* If caller is interested in rc value from parse, set
 	 value.  */
@@ -12046,7 +12046,7 @@ update_global_location_list_nothrow (enum ugll_insert_mode insert_mode)
     {
       update_global_location_list (insert_mode);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
     }
 }
@@ -13516,7 +13516,7 @@ update_breakpoint_locations (struct breakpoint *b,
 					   block_for_pc (sal.pc),
 					   0);
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+	  catch (const struct gdb_exception_error &e)
 	    {
 	      warning (_("failed to reevaluate condition "
 			 "for breakpoint %d: %s"), 
@@ -13593,7 +13593,7 @@ location_to_sals (struct breakpoint *b, struct event_location *location,
     {
       sals = b->ops->decode_location (b, location, search_pspace);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       int not_found_and_ok = 0;
 
@@ -13803,7 +13803,7 @@ breakpoint_re_set (void)
 	  {
 	    breakpoint_re_set_one (b);
 	  }
-	catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+	catch (const struct gdb_exception &ex)
 	  {
 	    exception_fprintf (gdb_stderr, ex,
 			       "Error in re-setting breakpoint %d: ",
@@ -14283,7 +14283,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition,
 	  bpt->enable_state = bp_enabled;
 	  update_watchpoint (w, 1 /* reparse */);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &e)
+      catch (const struct gdb_exception &e)
 	{
 	  bpt->enable_state = orig_enable_state;
 	  exception_fprintf (gdb_stderr, e, _("Cannot enable watchpoint %d: "),
@@ -15021,7 +15021,7 @@ save_breakpoints (const char *filename, int from_tty,
 	  {
 	    print_command_lines (current_uiout, tp->commands.get (), 2);
 	  }
-	catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+	catch (const struct gdb_exception &ex)
 	  {
 	  current_uiout->redirect (NULL);
 	    throw_exception (ex);
diff --git a/gdb/btrace.c b/gdb/btrace.c
index d978b5d206d..26a6ede4dd5 100644
--- a/gdb/btrace.c
+++ b/gdb/btrace.c
@@ -687,7 +687,7 @@ ftrace_classify_insn (struct gdbarch *gdbarch, CORE_ADDR pc)
       else if (gdbarch_insn_is_jump (gdbarch, pc))
 	iclass = BTRACE_INSN_JUMP;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &error)
+  catch (const struct gdb_exception_error &error)
     {
     }
 
@@ -1106,7 +1106,7 @@ btrace_compute_ftrace_bts (struct thread_info *tp,
 	    {
 	      size = gdb_insn_length (gdbarch, pc);
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &error)
+	  catch (const struct gdb_exception_error &error)
 	    {
 	    }
 
@@ -1374,7 +1374,7 @@ btrace_pt_readmem_callback (gdb_byte *buffer, size_t size,
       if (errcode != 0)
 	result = -pte_nomap;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &error)
+  catch (const struct gdb_exception_error &error)
     {
       result = -pte_nomap;
     }
@@ -1476,7 +1476,7 @@ btrace_compute_ftrace_pt (struct thread_info *tp,
 
       ftrace_add_pt (btinfo, decoder, &level, gaps);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &error)
+  catch (const struct gdb_exception &error)
     {
       /* Indicate a gap in the trace if we quit trace processing.  */
       if (error.reason == RETURN_QUIT && !btinfo->functions.empty ())
@@ -1556,7 +1556,7 @@ btrace_compute_ftrace (struct thread_info *tp, struct btrace_data *btrace,
     {
       btrace_compute_ftrace_1 (tp, btrace, cpu, gaps);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &error)
+  catch (const struct gdb_exception &error)
     {
       btrace_finalize_ftrace (tp, gaps);
 
@@ -1627,7 +1627,7 @@ btrace_enable (struct thread_info *tp, const struct btrace_config *conf)
 	  && can_access_registers_thread (tp))
 	btrace_add_pc (tp);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &exception)
+  catch (const struct gdb_exception &exception)
     {
       btrace_disable (tp);
 
@@ -3060,7 +3060,7 @@ btrace_maint_update_pt_packets (struct btrace_thread_info *btinfo)
     {
       btrace_maint_decode_pt (&btinfo->maint, decoder);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       pt_pkt_free_decoder (decoder);
 
diff --git a/gdb/c-varobj.c b/gdb/c-varobj.c
index df06caacb32..c7f841694b7 100644
--- a/gdb/c-varobj.c
+++ b/gdb/c-varobj.c
@@ -97,7 +97,7 @@ adjust_value_for_child_access (struct value **value,
 		  *value = value_ind (*value);
 		}
 
-	      catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	      catch (const struct gdb_exception_error &except)
 		{
 		  *value = NULL;
 		}
@@ -259,7 +259,7 @@ value_struct_element_index (struct value *value, int type_index)
       else
 	result = value_primitive_field (value, 0, type_index, type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       return NULL;
     }
@@ -318,7 +318,7 @@ c_describe_child (const struct varobj *parent, int index,
 	    {
 	      *cvalue = value_subscript (value, real_index);
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	  catch (const struct gdb_exception_error &except)
 	    {
 	    }
 	}
@@ -395,7 +395,7 @@ c_describe_child (const struct varobj *parent, int index,
 	      *cvalue = value_ind (value);
 	    }
 
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	  catch (const struct gdb_exception_error &except)
 	    {
 	      *cvalue = NULL;
 	    }
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 4cf2a5919cf..1611362158d 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -267,7 +267,7 @@ complete_command (const char *arg, int from_tty)
 	  tracker = &tracker_handle_completions;
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       return;
     }
diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c
index 15373be77f1..02c956affd2 100644
--- a/gdb/cli/cli-interp.c
+++ b/gdb/cli/cli-interp.c
@@ -367,7 +367,7 @@ safe_execute_command (struct ui_out *command_uiout, const char *command,
     {
       execute_command (command, from_tty);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &exception)
+  catch (const struct gdb_exception &exception)
     {
       e = exception;
     }
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index f0080f950f1..3730827d9b4 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -1054,7 +1054,7 @@ process_next_line (const char *p, struct command_line **command,
 	{
 	  validator ((*command)->line);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	  free_command_lines (command);
 	  throw_exception (ex);
@@ -1546,7 +1546,7 @@ script_from_file (FILE *stream, const char *file)
     {
       read_command_file (stream);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       /* Re-throw the error, but with the file name information
 	 prepended.  */
diff --git a/gdb/common/common-exceptions.c b/gdb/common/common-exceptions.c
index 15b59f4dd94..c2275fe6382 100644
--- a/gdb/common/common-exceptions.c
+++ b/gdb/common/common-exceptions.c
@@ -203,14 +203,14 @@ throw_exception_cxx (struct gdb_exception exception)
 {
   if (exception.reason == RETURN_QUIT)
     {
-      gdb_exception_RETURN_MASK_QUIT ex;
+      gdb_exception_quit ex;
 
       gdb_exception_sliced_copy (&ex, &exception);
       throw ex;
     }
   else if (exception.reason == RETURN_ERROR)
     {
-      gdb_exception_RETURN_MASK_ERROR ex;
+      gdb_exception_error ex;
 
       gdb_exception_sliced_copy (&ex, &exception);
       throw ex;
diff --git a/gdb/common/common-exceptions.h b/gdb/common/common-exceptions.h
index d4b30104239..e3ceb52553c 100644
--- a/gdb/common/common-exceptions.h
+++ b/gdb/common/common-exceptions.h
@@ -214,15 +214,11 @@ 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
 {
 };
 
-struct gdb_exception_RETURN_MASK_ERROR : public gdb_exception_RETURN_MASK_ALL
-{
-};
-
-struct gdb_exception_RETURN_MASK_QUIT : public gdb_exception_RETURN_MASK_ALL
+struct gdb_exception_quit : public gdb_exception
 {
 };
 
@@ -233,7 +229,7 @@ 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 (gdb_exception ex)
diff --git a/gdb/common/new-op.c b/gdb/common/new-op.c
index b6c13afca19..9461e7eaa34 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 struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	  throw gdb_quit_bad_alloc (ex);
 	}
diff --git a/gdb/common/selftest.c b/gdb/common/selftest.c
index cd43b2740c8..37f6d02efd1 100644
--- a/gdb/common/selftest.c
+++ b/gdb/common/selftest.c
@@ -87,7 +87,7 @@ run_tests (const char *filter)
 	  ++ran;
 	  (*test) ();
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  ++failed;
 	  debug_printf ("Self test failed: %s\n", ex.message.c_str ());
diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbols.c
index a75161c5ca4..9b33c7df43b 100644
--- a/gdb/compile/compile-c-symbols.c
+++ b/gdb/compile/compile-c-symbols.c
@@ -367,7 +367,7 @@ gcc_convert_symbol (void *datum,
 	}
     }
 
-  catch (const struct gdb_exception_RETURN_MASK_ALL &e)
+  catch (const struct gdb_exception &e)
     {
       context->plugin ().error (e.message.c_str ());
     }
@@ -429,7 +429,7 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
 	}
     }
 
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       context->plugin ().error (e.message.c_str ());
     }
@@ -598,7 +598,7 @@ generate_c_for_for_one_variable (compile_instance *compiler,
 	}
     }
 
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       compiler->insert_symbol_error (sym, e.message.c_str ());
     }
diff --git a/gdb/compile/compile-cplus-symbols.c b/gdb/compile/compile-cplus-symbols.c
index cc8f6ee3176..dcf0cdc7113 100644
--- a/gdb/compile/compile-cplus-symbols.c
+++ b/gdb/compile/compile-cplus-symbols.c
@@ -388,7 +388,7 @@ gcc_cplus_convert_symbol (void *datum,
 	    }
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &e)
+  catch (const struct gdb_exception &e)
     {
       /* We can't allow exceptions to escape out of this callback.  Safest
 	 is to simply emit a gcc error.  */
@@ -466,7 +466,7 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context,
 	}
     }
 
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       instance->plugin ().error (e.message.c_str ());
     }
diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index 4885929d608..588e31aa3ef 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -54,7 +54,7 @@ munmap_list::~munmap_list ()
 	{
 	  gdbarch_infcall_munmap (target_gdbarch (), item.addr, item.size);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  /* There's not much the user can do, so just ignore
 	     this.  */
diff --git a/gdb/compile/compile-object-run.c b/gdb/compile/compile-object-run.c
index 3639efd4179..ea24eee73b8 100644
--- a/gdb/compile/compile-object-run.c
+++ b/gdb/compile/compile-object-run.c
@@ -173,7 +173,7 @@ compile_object_run (struct compile_module *module)
       call_function_by_hand_dummy (func_val, NULL, args,
 				   do_module_cleanup, data);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       /* In the case of DTOR_FOUND or in the case of EXECUTED nothing
 	 needs to be done.  */
diff --git a/gdb/completer.c b/gdb/completer.c
index b946c696f23..748198500c1 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -1025,7 +1025,7 @@ complete_expression (completion_tracker &tracker,
     {
       type = parse_expression_for_completion (text, &fieldname, &code);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       return;
     }
@@ -1448,7 +1448,7 @@ complete_line_internal (completion_tracker &tracker,
     {
       complete_line_internal_1 (tracker, text, line_buffer, point, reason);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       if (except.error != MAX_COMPLETIONS_REACHED_ERROR)
 	throw_exception (except);
@@ -1861,7 +1861,7 @@ gdb_completion_word_break_characters ()
     {
       return gdb_completion_word_break_characters_throw ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       /* Set this to that gdb_rl_attempted_completion_function knows
 	 to abort early.  */
@@ -2208,7 +2208,7 @@ gdb_rl_attempted_completion_function (const char *text, int start, int end)
     {
       return gdb_rl_attempted_completion_function_throw (text, start, end);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
     }
 
diff --git a/gdb/corelow.c b/gdb/corelow.c
index f162ff9606c..e2d35e5604d 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -466,7 +466,7 @@ core_target_open (const char *arg, int from_tty)
       target_update_thread_list ();
     }
 
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       exception_print (gdb_stderr, except);
     }
@@ -520,7 +520,7 @@ core_target_open (const char *arg, int from_tty)
 	{
 	  thread_command (NULL, from_tty);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+      catch (const struct gdb_exception_error &except)
 	{
 	  exception_print (gdb_stderr, except);
 	}
diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c
index 800a3b41322..23dad4b1748 100644
--- a/gdb/cp-abi.c
+++ b/gdb/cp-abi.c
@@ -79,7 +79,7 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
 						embedded_offset,
 						address, val);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
 	throw_exception (ex);
@@ -115,7 +115,7 @@ value_rtti_type (struct value *v, int *full,
     {
       ret = (*current_cp_abi.rtti_type) (v, full, top, using_enc);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       return NULL;
     }
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 87ae5361ebd..79457f991fa 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -155,7 +155,7 @@ inspect_type (struct demangle_parse_info *info,
     {
       sym = lookup_symbol (name, 0, VAR_DOMAIN, 0).symbol;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       return 0;
     }
@@ -228,7 +228,7 @@ inspect_type (struct demangle_parse_info *info,
 	    }
 	  /* If type_print threw an exception, there is little point
 	     in continuing, so just bow out gracefully.  */
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	  catch (const struct gdb_exception_error &except)
 	    {
 	      return 0;
 	    }
@@ -427,7 +427,7 @@ replace_typedefs (struct demangle_parse_info *info,
 		  sym = lookup_symbol (local_name.get (), 0,
 				       VAR_DOMAIN, 0).symbol;
 		}
-	      catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+	      catch (const struct gdb_exception &except)
 		{
 		}
 
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 0d4cd49683a..0978bb7b21e 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -321,7 +321,7 @@ cp_print_value_fields (struct type *type, struct type *real_type,
 		      v = value_static_field (type, i);
 		    }
 
-		  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+		  catch (const struct gdb_exception_error &ex)
 		    {
 		      fprintf_filtered (stream,
 					_("<error reading variable: %s>"),
@@ -508,7 +508,7 @@ cp_print_value (struct type *type, struct type *real_type,
 	{
 	  boffset = baseclass_offset (type, i, valaddr, offset, address, val);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  if (ex.error == NOT_AVAILABLE_ERROR)
 	    skip = -1;
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 7ac1df0c90f..1d4c267e074 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -1688,7 +1688,7 @@ darwin_attach_pid (struct inferior *inf)
 
       darwin_setup_exceptions (inf);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       exit_inferior (inf);
       inferior_ptid = null_ptid;
@@ -1952,7 +1952,7 @@ The error was: %s"),
 	{
 	  copy_shell_to_cache (shell, new_name);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  warning (_("This version of macOS has System Integrity Protection.\n\
 Because `startup-with-shell' is enabled, gdb tried to work around SIP by\n\
diff --git a/gdb/disasm-selftests.c b/gdb/disasm-selftests.c
index 8d2bb2e79ef..93e5f39e08c 100644
--- a/gdb/disasm-selftests.c
+++ b/gdb/disasm-selftests.c
@@ -196,7 +196,7 @@ memory_error_test (struct gdbarch *gdbarch)
     {
       di.print_insn (0);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error == MEMORY_ERROR)
 	saw_memory_error = true;
diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c
index 075eb2725d2..6ebab2289d1 100644
--- a/gdb/dtrace-probe.c
+++ b/gdb/dtrace-probe.c
@@ -489,7 +489,7 @@ dtrace_process_dof_probe (struct objfile *objfile,
 	      expr = parse_expression_with_language (type_str.c_str (),
 						     language_c);
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+	  catch (const struct gdb_exception_error &ex)
 	    {
 	    }
 
diff --git a/gdb/dwarf-index-cache.c b/gdb/dwarf-index-cache.c
index 5057d5e744b..e295f865cff 100644
--- a/gdb/dwarf-index-cache.c
+++ b/gdb/dwarf-index-cache.c
@@ -129,7 +129,7 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile)
       write_psymtabs_to_index (dwarf2_per_objfile, m_dir.c_str (),
 			       build_id_str.c_str (), dw_index_kind::GDB_INDEX);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       if (debug_index_cache)
 	printf_unfiltered ("index cache: couldn't store index cache for objfile "
@@ -188,7 +188,7 @@ index_cache::lookup_gdb_index (const bfd_build_id *build_id,
 	  ((const gdb_byte *) mmap_resource->mapping.get (),
 	   mmap_resource->mapping.size ());
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       if (debug_index_cache)
 	printf_unfiltered ("index cache: couldn't read %s: %s\n",
diff --git a/gdb/dwarf-index-write.c b/gdb/dwarf-index-write.c
index 89cafdc8585..db036b1f922 100644
--- a/gdb/dwarf-index-write.c
+++ b/gdb/dwarf-index-write.c
@@ -1681,7 +1681,7 @@ save_gdb_index_command (const char *arg, int from_tty)
 	      write_psymtabs_to_index (dwarf2_per_objfile, arg, basename,
 				       index_kind);
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	  catch (const struct gdb_exception_error &except)
 	    {
 	      exception_fprintf (gdb_stderr, except,
 				 _("Error while writing index for `%s': "),
diff --git a/gdb/dwarf2-frame-tailcall.c b/gdb/dwarf2-frame-tailcall.c
index adb38b9cf84..0a31f4ada40 100644
--- a/gdb/dwarf2-frame-tailcall.c
+++ b/gdb/dwarf2-frame-tailcall.c
@@ -399,7 +399,7 @@ dwarf2_tailcall_sniffer_first (struct frame_info *this_frame,
 	    }
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       if (entry_values_debug)
 	exception_print (gdb_stdout, except);
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index ca5ced7135e..5067b94f834 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -1068,7 +1068,7 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
 	  internal_error (__FILE__, __LINE__, _("Unknown CFA rule."));
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error == NOT_AVAILABLE_ERROR)
 	{
@@ -2253,7 +2253,7 @@ dwarf2_build_frame_info (struct objfile *objfile)
 						EH_CIE_OR_FDE_TYPE_ID);
 	    }
 
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+	  catch (const struct gdb_exception_error &e)
 	    {
 	      warning (_("skipping .eh_frame info of %s: %s"),
 		       objfile_name (objfile), e.message.c_str ());
@@ -2293,7 +2293,7 @@ dwarf2_build_frame_info (struct objfile *objfile)
 					    &cie_table, &fde_table,
 					    EH_CIE_OR_FDE_TYPE_ID);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+      catch (const struct gdb_exception_error &e)
 	{
 	  warning (_("skipping .debug_frame info of %s: %s"),
 		   objfile_name (objfile), e.message.c_str ());
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 80d0b44306f..263d9c55e37 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -1199,7 +1199,7 @@ call_site_find_chain (struct gdbarch *gdbarch, CORE_ADDR caller_pc,
     {
       retval = call_site_find_chain_1 (gdbarch, caller_pc, callee_pc);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       if (e.error == NO_ENTRY_VALUE_ERROR)
 	{
@@ -2168,7 +2168,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
     {
       ctx.eval (data, size);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error == NOT_AVAILABLE_ERROR)
 	{
@@ -2385,7 +2385,7 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
     {
       ctx.eval (dlbaton->data, dlbaton->size);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error == NOT_AVAILABLE_ERROR)
 	{
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 0d6f84c59a6..20c930bb4f8 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -6345,7 +6345,7 @@ dwarf2_build_psymtabs (struct objfile *objfile)
       /* (maybe) store an index in the cache.  */
       global_index_cache.store (dwarf2_per_objfile);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       exception_print (gdb_stderr, except);
     }
diff --git a/gdb/eval.c b/gdb/eval.c
index 7a1efbe25fd..f46222d920a 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -205,7 +205,7 @@ fetch_subexp_value (struct expression *exp, int *pc, struct value **valp,
     {
       result = evaluate_subexp (NULL_TYPE, exp, pc, EVAL_NORMAL);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       /* Ignore memory errors if we want watchpoints pointing at
 	 inaccessible memory to still be created; otherwise, throw the
@@ -242,7 +242,7 @@ fetch_subexp_value (struct expression *exp, int *pc, struct value **valp,
 	      value_fetch_lazy (result);
 	      *valp = result;
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	  catch (const struct gdb_exception_error &except)
 	    {
 	    }
 	}
@@ -719,7 +719,7 @@ evaluate_var_value (enum noside noside, const block *blk, symbol *var)
       ret = value_of_variable (var, blk);
     }
 
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       if (noside != EVAL_AVOID_SIDE_EFFECTS)
 	throw_exception (except);
@@ -959,7 +959,7 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
 		  value = value_x_unop (arg2, op, noside);
 		}
 
-	      catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	      catch (const struct gdb_exception_error &except)
 		{
 		  if (except.error == NOT_FOUND_ERROR)
 		    break;
@@ -2031,7 +2031,7 @@ evaluate_subexp_standard (struct type *expect_type,
 	      value = value_x_unop (arg1, op, noside);
 	    }
 
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	  catch (const struct gdb_exception_error &except)
 	    {
 	      if (except.error == NOT_FOUND_ERROR)
 		break;
diff --git a/gdb/event-loop.c b/gdb/event-loop.c
index e73443ed779..aa334fed156 100644
--- a/gdb/event-loop.c
+++ b/gdb/event-loop.c
@@ -370,7 +370,7 @@ start_event_loop (void)
 	{
 	  result = gdb_do_one_event ();
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	  exception_print (gdb_stderr, ex);
 
diff --git a/gdb/event-top.c b/gdb/event-top.c
index ea056dd99e2..6e4031165c7 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -212,7 +212,7 @@ gdb_rl_callback_handler (char *rl) noexcept
     {
       ui->input_handler (gdb::unique_xmalloc_ptr<char> (rl));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       gdb_rl_expt = ex;
     }
@@ -1086,7 +1086,7 @@ async_disconnect (gdb_client_data arg)
       quit_cover ();
     }
 
-  catch (const struct gdb_exception_RETURN_MASK_ALL &exception)
+  catch (const struct gdb_exception &exception)
     {
       fputs_filtered ("Could not kill the program being debugged",
 		      gdb_stderr);
@@ -1097,7 +1097,7 @@ async_disconnect (gdb_client_data arg)
     {
       pop_all_targets ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &exception)
+  catch (const struct gdb_exception &exception)
     {
     }
 
diff --git a/gdb/exec.c b/gdb/exec.c
index fcee12da87b..c31ece2fa17 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -167,7 +167,7 @@ try_open_exec_file (const char *exec_file_host, struct inferior *inf,
 	 exec_file_attach will clear state.  */
       exec_file_attach (exec_file_host, add_flags & SYMFILE_VERBOSE);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &err)
+  catch (const struct gdb_exception_error &err)
     {
       if (!err.message.empty ())
 	warning ("%s", err.message.c_str ());
@@ -181,7 +181,7 @@ try_open_exec_file (const char *exec_file_host, struct inferior *inf,
 	{
 	  symbol_file_add_main (exec_file_host, add_flags);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &err)
+      catch (const struct gdb_exception_error &err)
 	{
 	  if (!exception_print_same (prev_err, err))
 	    warning ("%s", err.message.c_str ());
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index c82d7f3d749..757f188d591 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -414,7 +414,7 @@ info_common_command_for_block (const struct block *block, const char *comname,
 		value_print (val, gdb_stdout, &opts);
 	      }
 
-	    catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	    catch (const struct gdb_exception_error &except)
 	      {
 		printf_filtered ("<error reading variable: %s>",
 				 except.message.c_str ());
diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c
index eeac945e713..9df6841a765 100644
--- a/gdb/fbsd-tdep.c
+++ b/gdb/fbsd-tdep.c
@@ -719,7 +719,7 @@ fbsd_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
     {
       update_thread_list ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       exception_print (gdb_stderr, e);
     }
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index 5ef11d50cf0..714e44475ac 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -105,7 +105,7 @@ frame_unwind_try_unwinder (struct frame_info *this_frame, void **this_cache,
     {
       res = unwinder->sniffer (unwinder, this_frame, this_cache);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       /* Catch all exceptions, caused by either interrupt or error.
 	 Reset *THIS_CACHE.  */
diff --git a/gdb/frame.c b/gdb/frame.c
index 43cc168b841..8665817658e 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -899,7 +899,7 @@ frame_unwind_pc (struct frame_info *this_frame)
 	  pc = gdbarch_unwind_pc (prev_gdbarch, this_frame);
 	  pc_p = 1;
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  if (ex.error == NOT_AVAILABLE_ERROR)
 	    {
@@ -1913,7 +1913,7 @@ get_prev_frame_if_no_cycle (struct frame_info *this_frame)
 	  prev_frame = NULL;
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       prev_frame->next = NULL;
       this_frame->prev = NULL;
@@ -2094,7 +2094,7 @@ get_prev_frame_always (struct frame_info *this_frame)
     {
       prev_frame = get_prev_frame_always_1 (this_frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error == MEMORY_ERROR)
 	{
@@ -2380,7 +2380,7 @@ get_frame_pc_if_available (struct frame_info *frame, CORE_ADDR *pc)
     {
       *pc = frame_unwind_pc (frame->next);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error == NOT_AVAILABLE_ERROR)
 	return 0;
@@ -2462,7 +2462,7 @@ get_frame_address_in_block_if_available (struct frame_info *this_frame,
     {
       *pc = get_frame_address_in_block (this_frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error == NOT_AVAILABLE_ERROR)
 	return 0;
@@ -2747,7 +2747,7 @@ get_frame_language (struct frame_info *frame)
       pc = get_frame_address_in_block (frame);
       pc_p = 1;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
 	throw_exception (ex);
diff --git a/gdb/gcore.c b/gdb/gcore.c
index e15ed7f44fb..0e4596241b7 100644
--- a/gdb/gcore.c
+++ b/gdb/gcore.c
@@ -122,7 +122,7 @@ write_gcore_file (bfd *obfd)
     {
       write_gcore_file_1 (obfd);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &e)
+  catch (const struct gdb_exception &e)
     {
       except = e;
     }
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
index bc465b64dd8..496afce71f5 100644
--- a/gdb/gdbserver/gdbreplay.c
+++ b/gdb/gdbserver/gdbreplay.c
@@ -529,7 +529,7 @@ main (int argc, char *argv[])
     {
       captured_main (argc, argv);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &exception)
+  catch (const struct gdb_exception &exception)
     {
       if (exception.reason == RETURN_ERROR)
 	{
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index c42a2b56b13..71eb5145ec0 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -1536,7 +1536,7 @@ linux_detach_one_lwp (struct lwp_info *lwp)
       if (the_low_target.prepare_to_resume != NULL)
 	the_low_target.prepare_to_resume (lwp);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (!check_ptrace_stopped_lwp_gone (lwp))
 	throw_exception (ex);
@@ -4508,7 +4508,7 @@ linux_resume_one_lwp (struct lwp_info *lwp,
     {
       linux_resume_one_lwp_throw (lwp, step, signal, info);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (!check_ptrace_stopped_lwp_gone (lwp))
 	throw_exception (ex);
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 58a7d6bd0f3..c547fcaaac2 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -472,7 +472,7 @@ handle_btrace_general_set (char *own_buf)
 
       write_ok (own_buf);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &exception)
+  catch (const struct gdb_exception_error &exception)
     {
       sprintf (own_buf, "E.%s", exception.message.c_str ());
     }
@@ -1881,7 +1881,7 @@ handle_qxfer_btrace (const char *annex,
 	  if (result != 0)
 	    memcpy (cs.own_buf, cache.buffer, cache.used_size);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &exception)
+      catch (const struct gdb_exception_error &exception)
 	{
 	  sprintf (cs.own_buf, "E.%s", exception.message.c_str ());
 	  result = -1;
@@ -1952,7 +1952,7 @@ handle_qxfer_btrace_conf (const char *annex,
 	  if (result != 0)
 	    memcpy (cs.own_buf, cache.buffer, cache.used_size);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &exception)
+      catch (const struct gdb_exception_error &exception)
 	{
 	  sprintf (cs.own_buf, "E.%s", exception.message.c_str ());
 	  result = -1;
@@ -3553,7 +3553,7 @@ detach_or_kill_for_exit_cleanup ()
     {
       detach_or_kill_for_exit ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &exception)
+  catch (const struct gdb_exception &exception)
     {
       fflush (stdout);
       fprintf (stderr, "Detach or kill failed: %s\n",
@@ -3927,7 +3927,7 @@ captured_main (int argc, char *argv[])
 		}
 	    }
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &exception)
+      catch (const struct gdb_exception_error &exception)
 	{
 	  fflush (stdout);
 	  fprintf (stderr, "gdbserver: %s\n", exception.message.c_str ());
@@ -3954,7 +3954,7 @@ main (int argc, char *argv[])
     {
       captured_main (argc, argv);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &exception)
+  catch (const struct gdb_exception &exception)
     {
       if (exception.reason == RETURN_ERROR)
 	{
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 53995685db3..08c292457d2 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -2591,7 +2591,7 @@ safe_parse_type (struct gdbarch *gdbarch, char *p, int length)
     {
       type = parse_and_eval_type (p, length);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       type = builtin_type (gdbarch)->builtin_void;
     }
@@ -3771,7 +3771,7 @@ types_deeply_equal (struct type *type1, struct type *type2)
     {
       result = check_types_worklist (&worklist, cache);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       except = ex;
     }
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index ae19f13d118..9dc5d782ae8 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -910,7 +910,7 @@ print_one_vtable (struct gdbarch *gdbarch, struct value *value,
 	{
 	  addr = value_as_address (vfn);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  printf_filtered (_("<error: %s>"), ex.message.c_str ());
 	  got_error = 1;
diff --git a/gdb/guile/guile-internal.h b/gdb/guile/guile-internal.h
index 122668da52f..dae135eb249 100644
--- a/gdb/guile/guile-internal.h
+++ b/gdb/guile/guile-internal.h
@@ -681,7 +681,7 @@ gdbscm_wrap (Function &&func, Args &&... args)
     {
       result = func (std::forward<Args> (args)...);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
diff --git a/gdb/guile/scm-block.c b/gdb/guile/scm-block.c
index e3d7005cd66..5bda9dc99cd 100644
--- a/gdb/guile/scm-block.c
+++ b/gdb/guile/scm-block.c
@@ -687,7 +687,7 @@ gdbscm_lookup_block (SCM pc_scm)
       if (cust != NULL && COMPUNIT_OBJFILE (cust) != NULL)
 	block = block_for_pc (pc);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
diff --git a/gdb/guile/scm-breakpoint.c b/gdb/guile/scm-breakpoint.c
index 07aebdf80ef..9b7cff6682b 100644
--- a/gdb/guile/scm-breakpoint.c
+++ b/gdb/guile/scm-breakpoint.c
@@ -465,7 +465,7 @@ gdbscm_register_breakpoint_x (SCM self)
 	  gdb_assert_not_reached ("invalid breakpoint type");
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       except = ex;
     }
@@ -493,7 +493,7 @@ gdbscm_delete_breakpoint_x (SCM self)
     {
       delete_breakpoint (bp_smob->bp);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -593,7 +593,7 @@ gdbscm_set_breakpoint_enabled_x (SCM self, SCM newvalue)
       else
 	disable_breakpoint (bp_smob->bp);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -627,7 +627,7 @@ gdbscm_set_breakpoint_silent_x (SCM self, SCM newvalue)
     {
       breakpoint_set_silent (bp_smob->bp, gdbscm_is_true (newvalue));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -667,7 +667,7 @@ gdbscm_set_breakpoint_ignore_count_x (SCM self, SCM newvalue)
     {
       set_ignore_count (bp_smob->number, (int) value, 0);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -787,7 +787,7 @@ gdbscm_set_breakpoint_task_x (SCM self, SCM newvalue)
 	{
 	  valid_id = valid_task_id (id);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+      catch (const struct gdb_exception &except)
 	{
 	  GDBSCM_HANDLE_GDB_EXCEPTION (except);
 	}
@@ -807,7 +807,7 @@ gdbscm_set_breakpoint_task_x (SCM self, SCM newvalue)
     {
       breakpoint_set_task (bp_smob->bp, id);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -972,7 +972,7 @@ gdbscm_breakpoint_commands (SCM self)
     {
       print_command_lines (current_uiout, breakpoint_commands (bp), 0);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       current_uiout->redirect (NULL);
       gdbscm_throw_gdb_exception (except);
diff --git a/gdb/guile/scm-cmd.c b/gdb/guile/scm-cmd.c
index d5b4473a88e..0543ca72fa7 100644
--- a/gdb/guile/scm-cmd.c
+++ b/gdb/guile/scm-cmd.c
@@ -776,7 +776,7 @@ gdbscm_register_command_x (SCM self)
 			 c_smob->doc, cmd_list);
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
diff --git a/gdb/guile/scm-disasm.c b/gdb/guile/scm-disasm.c
index 8d0462b31df..63899c80c82 100644
--- a/gdb/guile/scm-disasm.c
+++ b/gdb/guile/scm-disasm.c
@@ -257,7 +257,7 @@ gdbscm_arch_disassemble (SCM self, SCM start_scm, SCM rest)
 	  else
 	    insn_len = gdb_print_insn (gdbarch, pc, &buf, NULL);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+      catch (const struct gdb_exception &except)
 	{
 	  GDBSCM_HANDLE_GDB_EXCEPTION (except);
 	}
diff --git a/gdb/guile/scm-frame.c b/gdb/guile/scm-frame.c
index 282cd000242..132cb869b1b 100644
--- a/gdb/guile/scm-frame.c
+++ b/gdb/guile/scm-frame.c
@@ -248,7 +248,7 @@ frscm_scm_from_frame (struct frame_info *frame, struct inferior *inferior)
 	}
       gdbarch = get_frame_arch (frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       return gdbscm_scm_from_gdb_exception (except);
     }
@@ -400,7 +400,7 @@ gdbscm_frame_valid_p (SCM self)
     {
       frame = frscm_frame_smob_to_frame (f_smob);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -429,7 +429,7 @@ gdbscm_frame_name (SCM self)
       if (frame != NULL)
 	name = find_frame_funname (frame, &lang, NULL);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -466,7 +466,7 @@ gdbscm_frame_type (SCM self)
       if (frame != NULL)
 	type = get_frame_type (frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -495,7 +495,7 @@ gdbscm_frame_arch (SCM self)
     {
       frame = frscm_frame_smob_to_frame (f_smob);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -525,7 +525,7 @@ gdbscm_frame_unwind_stop_reason (SCM self)
     {
       frame = frscm_frame_smob_to_frame (f_smob);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -559,7 +559,7 @@ gdbscm_frame_pc (SCM self)
       if (frame != NULL)
 	pc = get_frame_pc (frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -591,7 +591,7 @@ gdbscm_frame_block (SCM self)
       if (frame != NULL)
 	block = get_frame_block (frame, NULL);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -641,7 +641,7 @@ gdbscm_frame_function (SCM self)
       if (frame != NULL)
 	sym = find_pc_function (get_frame_address_in_block (frame));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -677,7 +677,7 @@ gdbscm_frame_older (SCM self)
       if (frame != NULL)
 	prev = get_prev_frame (frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -713,7 +713,7 @@ gdbscm_frame_newer (SCM self)
       if (frame != NULL)
 	next = get_next_frame (frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -748,7 +748,7 @@ gdbscm_frame_sal (SCM self)
       if (frame != NULL)
 	sal = find_frame_sal (frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -793,7 +793,7 @@ gdbscm_frame_read_register (SCM self, SCM register_scm)
 	    value = value_of_register (regnum, frame);
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       except = ex;
     }
@@ -842,7 +842,7 @@ gdbscm_frame_read_var (SCM self, SCM symbol_scm, SCM rest)
     {
       frame = frscm_frame_smob_to_frame (f_smob);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -894,7 +894,7 @@ gdbscm_frame_read_var (SCM self, SCM symbol_scm, SCM rest)
 	    var = lookup_sym.symbol;
 	    block = lookup_sym.block;
 	  }
-	catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+	catch (const struct gdb_exception &ex)
 	  {
 	    except = ex;
 	  }
@@ -917,7 +917,7 @@ gdbscm_frame_read_var (SCM self, SCM symbol_scm, SCM rest)
     {
       value = read_var_value (var, block, frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -942,7 +942,7 @@ gdbscm_frame_select (SCM self)
       if (frame != NULL)
 	select_frame (frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -968,7 +968,7 @@ gdbscm_newest_frame (void)
     {
       frame = get_current_frame ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -988,7 +988,7 @@ gdbscm_selected_frame (void)
     {
       frame = get_selected_frame (_("No frame is currently selected"));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
diff --git a/gdb/guile/scm-lazy-string.c b/gdb/guile/scm-lazy-string.c
index ad04123c187..26ec16badc5 100644
--- a/gdb/guile/scm-lazy-string.c
+++ b/gdb/guile/scm-lazy-string.c
@@ -336,7 +336,7 @@ lsscm_safe_lazy_string_to_value (SCM string, int arg_pos,
 	  break;
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       *except_scmp = gdbscm_scm_from_gdb_exception (except);
       return NULL;
diff --git a/gdb/guile/scm-math.c b/gdb/guile/scm-math.c
index a49b93629d1..fc53c916447 100644
--- a/gdb/guile/scm-math.c
+++ b/gdb/guile/scm-math.c
@@ -836,7 +836,7 @@ vlscm_convert_typed_value_from_scheme (const char *func_name,
 	  value = NULL;
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       except_scm = gdbscm_scm_from_gdb_exception (except);
     }
diff --git a/gdb/guile/scm-param.c b/gdb/guile/scm-param.c
index e5c064f337c..a060bf8c1e8 100644
--- a/gdb/guile/scm-param.c
+++ b/gdb/guile/scm-param.c
@@ -1018,7 +1018,7 @@ gdbscm_register_parameter_x (SCM self)
 			   set_list, show_list,
 			   &p_smob->set_command, &p_smob->show_command);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -1067,7 +1067,7 @@ gdbscm_parameter_value (SCM self)
 	{
 	  found = lookup_cmd_composition (newarg, &alias, &prefix, &cmd);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	  except = ex;
 	}
diff --git a/gdb/guile/scm-ports.c b/gdb/guile/scm-ports.c
index 649c12439f1..711d6044a97 100644
--- a/gdb/guile/scm-ports.c
+++ b/gdb/guile/scm-ports.c
@@ -279,7 +279,7 @@ ioscm_write (SCM port, const void *data, size_t size)
       else
 	fputsn_filtered ((const char *) data, size, gdb_stdout);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
diff --git a/gdb/guile/scm-pretty-print.c b/gdb/guile/scm-pretty-print.c
index c0680d2bd5d..ced79b49c27 100644
--- a/gdb/guile/scm-pretty-print.c
+++ b/gdb/guile/scm-pretty-print.c
@@ -558,7 +558,7 @@ ppscm_pretty_print_one_value (SCM printer, struct value **out_value,
 	    (_("invalid result from pretty-printer to-string"), result);
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
     }
 
diff --git a/gdb/guile/scm-symbol.c b/gdb/guile/scm-symbol.c
index 609bba1b1ed..792aa450fcb 100644
--- a/gdb/guile/scm-symbol.c
+++ b/gdb/guile/scm-symbol.c
@@ -490,7 +490,7 @@ gdbscm_symbol_needs_frame_p (SCM self)
     {
       result = symbol_read_needs_frame (symbol);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -556,7 +556,7 @@ gdbscm_symbol_value (SCM self, SCM rest)
 	 can happen with nested functions).  */
       value = read_var_value (symbol, NULL, frame_info);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -607,7 +607,7 @@ gdbscm_lookup_symbol (SCM name_scm, SCM rest)
 	  selected_frame = get_selected_frame (_("no frame selected"));
 	  block = get_frame_block (selected_frame, NULL);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	  xfree (name);
 	  GDBSCM_HANDLE_GDB_EXCEPTION (ex);
@@ -620,7 +620,7 @@ gdbscm_lookup_symbol (SCM name_scm, SCM rest)
       symbol = lookup_symbol (name, block, (domain_enum) domain,
 			      &is_a_field_of_this).symbol;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       except = ex;
     }
@@ -656,7 +656,7 @@ gdbscm_lookup_global_symbol (SCM name_scm, SCM rest)
     {
       symbol = lookup_global_symbol (name, NULL, (domain_enum) domain).symbol;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       except = ex;
     }
diff --git a/gdb/guile/scm-symtab.c b/gdb/guile/scm-symtab.c
index c83c48dfe0d..e8fe1c4e037 100644
--- a/gdb/guile/scm-symtab.c
+++ b/gdb/guile/scm-symtab.c
@@ -597,7 +597,7 @@ gdbscm_find_pc_line (SCM pc_scm)
 
       sal = find_pc_line (pc, 0);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c
index 7efad975be9..0c2f0813c14 100644
--- a/gdb/guile/scm-type.c
+++ b/gdb/guile/scm-type.c
@@ -112,7 +112,7 @@ tyscm_type_name (struct type *type)
       LA_PRINT_TYPE (type, "", &stb, -1, 0, &type_print_raw_options);
       return std::move (stb.string ());
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       SCM excp = gdbscm_scm_from_gdb_exception (except);
       gdbscm_throw (excp);
@@ -238,7 +238,7 @@ tyscm_equal_p_type_smob (SCM type1_scm, SCM type2_scm)
     {
       result = types_deeply_equal (type1, type2);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -631,7 +631,7 @@ gdbscm_type_sizeof (SCM self)
     {
       check_typedef (type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
     }
 
@@ -654,7 +654,7 @@ gdbscm_type_strip_typedefs (SCM self)
     {
       type = check_typedef (type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -675,7 +675,7 @@ tyscm_get_composite (struct type *type)
 	{
 	  type = check_typedef (type);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+      catch (const struct gdb_exception &except)
 	{
 	  GDBSCM_HANDLE_GDB_EXCEPTION (except);
 	}
@@ -731,7 +731,7 @@ tyscm_array_1 (SCM self, SCM n1_scm, SCM n2_scm, int is_vector,
       if (is_vector)
 	make_vector_type (array);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -785,7 +785,7 @@ gdbscm_type_pointer (SCM self)
     {
       type = lookup_pointer_type (type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -846,7 +846,7 @@ gdbscm_type_reference (SCM self)
     {
       type = lookup_lvalue_reference_type (type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -883,7 +883,7 @@ gdbscm_type_const (SCM self)
     {
       type = make_cv_type (1, 0, type, NULL);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -905,7 +905,7 @@ gdbscm_type_volatile (SCM self)
     {
       type = make_cv_type (0, 1, type, NULL);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -927,7 +927,7 @@ gdbscm_type_unqualified (SCM self)
     {
       type = make_cv_type (0, 0, type, NULL);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -1231,7 +1231,7 @@ tyscm_lookup_typename (const char *type_name, const struct block *block)
 	type = lookup_typename (current_language, get_current_arch (),
 				type_name, block, 0);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       return NULL;
     }
diff --git a/gdb/guile/scm-value.c b/gdb/guile/scm-value.c
index 9aa250bfc8f..5ee48b7ac4a 100644
--- a/gdb/guile/scm-value.c
+++ b/gdb/guile/scm-value.c
@@ -163,7 +163,7 @@ vlscm_print_value_smob (SCM self, SCM port, scm_print_state *pstate)
       common_val_print (v_smob->value, &stb, 0, &opts, current_language);
       scm_puts (stb.c_str (), port);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -190,7 +190,7 @@ vlscm_equal_p_value_smob (SCM v1, SCM v2)
     {
       result = value_equal (v1_smob->value, v2_smob->value);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -394,7 +394,7 @@ gdbscm_value_address (SCM self)
 	    {
 	      address = vlscm_scm_from_value (value_addr (value));
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+	  catch (const struct gdb_exception &except)
 	    {
 	    }
 
@@ -529,7 +529,7 @@ gdbscm_value_dynamic_type (SCM self)
 	  type = NULL;
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -684,7 +684,7 @@ gdbscm_value_call (SCM self, SCM args)
     {
       ftype = check_typedef (value_type (function));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -752,7 +752,7 @@ gdbscm_value_to_bytevector (SCM self)
       length = TYPE_LENGTH (type);
       contents = value_contents (value);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -793,7 +793,7 @@ gdbscm_value_to_bool (SCM self)
     {
       type = check_typedef (type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -808,7 +808,7 @@ gdbscm_value_to_bool (SCM self)
       else
 	l = value_as_long (value);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -834,7 +834,7 @@ gdbscm_value_to_integer (SCM self)
     {
       type = check_typedef (type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -849,7 +849,7 @@ gdbscm_value_to_integer (SCM self)
       else
 	l = value_as_long (value);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -879,7 +879,7 @@ gdbscm_value_to_real (SCM self)
     {
       type = check_typedef (type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -906,7 +906,7 @@ gdbscm_value_to_real (SCM self)
 	  check = value_from_longest (type, (LONGEST) d);
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
@@ -999,7 +999,7 @@ gdbscm_value_to_string (SCM self, SCM rest)
       LA_GET_STRING (value, &buffer, &length, &char_type, &la_encoding);
       buffer_contents = buffer.release ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       xfree (encoding);
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
@@ -1120,7 +1120,7 @@ gdbscm_value_to_lazy_string (SCM self, SCM rest)
 
       result = lsscm_make_lazy_string (addr, length, encoding, type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       except = ex;
     }
@@ -1182,7 +1182,7 @@ gdbscm_value_print (SCM self)
     {
       common_val_print (value, &stb, 0, &opts, current_language);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index 85f761df669..41b8fd149cd 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -414,7 +414,7 @@ i386_linux_handle_segmentation_fault (struct gdbarch *gdbarch,
       access
         = parse_and_eval_long ("$_siginfo._sifields._sigfault.si_addr");
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &exception)
+  catch (const struct gdb_exception &exception)
     {
       return;
     }
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 5dee63dec23..35ad62b4d3b 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -2086,7 +2086,7 @@ i386_frame_cache (struct frame_info *this_frame, void **this_cache)
     {
       i386_frame_cache_1 (this_frame, cache);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
 	throw_exception (ex);
@@ -2265,7 +2265,7 @@ i386_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
 
       cache->base_p = 1;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
 	throw_exception (ex);
@@ -2460,7 +2460,7 @@ i386_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
 
       cache->base_p = 1;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
 	throw_exception (ex);
diff --git a/gdb/inf-loop.c b/gdb/inf-loop.c
index 86e45babe37..4cd179abfcf 100644
--- a/gdb/inf-loop.c
+++ b/gdb/inf-loop.c
@@ -71,7 +71,7 @@ inferior_event_handler (enum inferior_event_type event_type,
 	    {
 	      bpstat_do_actions ();
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ALL &e)
+	  catch (const struct gdb_exception &e)
 	    {
 	      /* If the user was running a foreground execution
 		 command, then propagate the error so that the prompt
diff --git a/gdb/infcall.c b/gdb/infcall.c
index ee63d33384b..659e6ad2cd5 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -602,7 +602,7 @@ run_inferior_call (struct call_thread_fsm *sm,
 	 target supports asynchronous execution.  */
       wait_sync_command_done ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &e)
+  catch (const struct gdb_exception &e)
     {
       caught_error = e;
     }
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 590f9dcaabe..024c5b832da 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -451,7 +451,7 @@ post_create_inferior (struct target_ops *target, int from_tty)
     {
       thr->suspend.stop_pc = regcache_read_pc (get_current_regcache ());
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
 	throw_exception (ex);
@@ -1652,7 +1652,7 @@ print_return_value (struct ui_out *uiout, struct return_value_info *rv)
 	 delete the breakpoint.  */
       print_return_value_1 (uiout, rv);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       exception_print (gdb_stdout, ex);
     }
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 3e6eaa3f511..ed245133e9f 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1778,7 +1778,7 @@ displaced_step_prepare (thread_info *thread)
     {
       prepared = displaced_step_prepare_throw (thread);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       struct displaced_step_inferior_state *displaced_state;
 
@@ -2611,7 +2611,7 @@ resume (gdb_signal sig)
     {
       resume_1 (sig);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       /* If resuming is being aborted for any reason, delete any
 	 single-step breakpoint resume_1 may have created, to avoid
@@ -7351,7 +7351,7 @@ insert_exception_resume_breakpoint (struct thread_info *tp,
 	  inferior_thread ()->control.exception_resume_breakpoint = bp;
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       /* We want to ignore errors here.  */
     }
@@ -7450,7 +7450,7 @@ check_exception_resume (struct execution_control_state *ecs,
 	    }
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
     }
 }
@@ -7583,7 +7583,7 @@ keep_going_pass_signal (struct execution_control_state *ecs)
 	{
 	  insert_breakpoints ();
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+      catch (const struct gdb_exception_error &e)
 	{
 	  exception_print (gdb_stderr, e);
 	  stop_waiting (ecs);
@@ -8114,7 +8114,7 @@ normal_stop (void)
 	{
 	  execute_cmd_pre_hook (stop_command);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	  exception_fprintf (gdb_stderr, ex,
 			     "Error while running hook_stop:\n");
@@ -8821,7 +8821,7 @@ restore_infcall_control_state (struct infcall_control_state *inf_status)
 	{
 	  restore_selected_frame (inf_status->selected_frame_id);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  exception_fprintf (gdb_stderr, ex,
 			     "Unable to restore previously selected frame:\n");
diff --git a/gdb/jit.c b/gdb/jit.c
index 26675f41142..4e9050cdf27 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -857,7 +857,7 @@ jit_reader_try_read_symtab (struct jit_code_entry *code_entry,
 			      code_entry->symfile_size))
 	status = 0;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &e)
+  catch (const struct gdb_exception &e)
     {
       status = 0;
     }
diff --git a/gdb/language.c b/gdb/language.c
index 7e62bace0d1..615c984985f 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -179,7 +179,7 @@ set_language_command (const char *ignore,
 		  frame = get_selected_frame (NULL);
 		  flang = get_frame_language (frame);
 		}
-	      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+	      catch (const struct gdb_exception_error &ex)
 		{
 		  flang = language_unknown;
 		}
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 93a3d2f9507..dcf0b5ea4ec 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -2394,7 +2394,7 @@ convert_explicit_location_to_linespec (struct linespec_state *self,
 	  *result->file_symtabs
 	    = symtabs_from_filename (source_filename, self->search_pspace);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+      catch (const struct gdb_exception_error &except)
 	{
 	  source_file_not_found_error (source_filename);
 	}
@@ -2619,7 +2619,7 @@ parse_linespec (linespec_parser *parser, const char *arg,
 	    = symtabs_from_filename (user_filename.get (),
 				     PARSER_STATE (parser)->search_pspace);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  file_exception = ex;
 	}
@@ -2936,7 +2936,7 @@ linespec_complete_label (completion_tracker &tracker,
 					     func_name_match_type,
 					     NULL, unknown_offset);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       return;
     }
@@ -2966,7 +2966,7 @@ linespec_complete (completion_tracker &tracker, const char *text,
     {
       parse_linespec (&parser, text, match_type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
     }
 
@@ -3156,7 +3156,7 @@ event_location_to_sals (linespec_parser *parser,
 	    result = parse_linespec (parser,
 				     ls->spec_string, ls->match_type);
 	  }
-	catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	catch (const struct gdb_exception_error &except)
 	  {
 	    throw_exception (except);
 	  }
@@ -3969,7 +3969,7 @@ find_linespec_symbols (struct linespec_state *state,
 
 	  /* If successful, we're done.  If NOT_FOUND_ERROR
 	     was not thrown, rethrow the exception that we did get.  */
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	  catch (const struct gdb_exception_error &except)
 	    {
 	      if (except.error != NOT_FOUND_ERROR)
 		throw_exception (except);
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index 317bac45f13..71284ddb31b 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -478,7 +478,7 @@ public:
 	    fork_load_infrun_state (m_oldfp);
 	    insert_breakpoints ();
 	  }
-	catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+	catch (const struct gdb_exception &ex)
 	  {
 	    warning (_("Couldn't restore checkpoint state in %s: %s"),
 		     target_pid_to_str (m_oldfp->ptid), ex.message.c_str ());
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index ea460dea258..72cad8880e6 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1193,7 +1193,7 @@ linux_nat_target::attach (const char *args, int from_tty)
     {
       inf_ptrace_target::attach (args, from_tty);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       pid_t pid = parse_pid_to_attach (args);
       std::string reason = linux_ptrace_attach_fail_reason (pid);
@@ -1406,7 +1406,7 @@ detach_one_lwp (struct lwp_info *lp, int *signo_p)
     {
       linux_target->low_prepare_to_resume (lp);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (!check_ptrace_stopped_lwp_gone (lp))
 	throw_exception (ex);
@@ -1587,7 +1587,7 @@ linux_resume_one_lwp (struct lwp_info *lp, int step, enum gdb_signal signo)
     {
       linux_resume_one_lwp_throw (lp, step, signo);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (!check_ptrace_stopped_lwp_gone (lp))
 	throw_exception (ex);
@@ -3539,7 +3539,7 @@ resume_stopped_resumed_lwps (struct lwp_info *lp, void *data)
 	      linux_resume_one_lwp_throw (lp, lp->step, GDB_SIGNAL_0);
 	    }
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  if (!check_ptrace_stopped_lwp_gone (lp))
 	    throw_exception (ex);
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index a4c0b790e98..83282c2da05 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -1935,7 +1935,7 @@ linux_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
     {
       update_thread_list ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
       exception_print (gdb_stderr, e);
     }
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index eaaf55fd3e8..1671537c364 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -502,7 +502,7 @@ thread_db_find_new_threads_silently (thread_info *stopped)
       thread_db_find_new_threads_2 (stopped, true);
     }
 
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       if (libthread_db_debug)
 	exception_fprintf (gdb_stdlog, except,
@@ -772,7 +772,7 @@ check_thread_db (struct thread_db_info *info, bool log_progress)
       if (!tdb_testinfo->threads_seen)
 	error (_("no threads seen"));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       if (warning_pre_print)
 	fputs_unfiltered (warning_pre_print, gdb_stderr);
@@ -1518,7 +1518,7 @@ find_new_threads_once (struct thread_db_info *info, int iteration,
 				    TD_SIGNO_MASK,
 				    TD_THR_ANY_USER_FLAGS);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       if (libthread_db_debug)
 	{
diff --git a/gdb/main.c b/gdb/main.c
index e5d93bf4065..85b7f7629de 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -373,7 +373,7 @@ catch_command_errors (catch_command_errors_const_ftype command,
 
       maybe_wait_sync_command_done (was_sync);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &e)
+  catch (const struct gdb_exception &e)
     {
       return handle_command_errors (e);
     }
@@ -1172,7 +1172,7 @@ captured_main (void *data)
 	{
 	  captured_command_loop ();
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	  exception_print (gdb_stderr, ex);
 	}
@@ -1187,7 +1187,7 @@ gdb_main (struct captured_main_args *args)
     {
       captured_main (args);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       exception_print (gdb_stderr, ex);
     }
diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c
index d8bed92d858..968e0806f5a 100644
--- a/gdb/mi/mi-cmd-break.c
+++ b/gdb/mi/mi-cmd-break.c
@@ -58,7 +58,7 @@ breakpoint_notify (struct breakpoint *b)
 	{
 	  print_breakpoint (b);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	  exception_print (gdb_stderr, ex);
 	}
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index 457712bbeaf..4ac7cd1cf3b 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -542,7 +542,7 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
 	      common_val_print (arg->val, &stb, 0, &opts,
 				language_def (SYMBOL_LANGUAGE (arg->sym)));
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	  catch (const struct gdb_exception_error &except)
 	    {
 	      error_message = std::move (except.message);
 	    }
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 75b581be5c2..c6b273c9da7 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -842,7 +842,7 @@ mi_print_breakpoint_for_event (struct mi_interp *mi, breakpoint *bp)
 
       print_breakpoint (bp);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       exception_print (gdb_stderr, ex);
     }
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 0997f6e10b9..10f185e29ce 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -1942,7 +1942,7 @@ mi_execute_command (const char *cmd, int from_tty)
     {
       command = mi_parse (cmd, &token);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &exception)
+  catch (const struct gdb_exception &exception)
     {
       mi_print_exception (token, exception);
       xfree (token);
@@ -1969,7 +1969,7 @@ mi_execute_command (const char *cmd, int from_tty)
 	{
 	  captured_mi_execute_command (current_uiout, command.get ());
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &result)
+      catch (const struct gdb_exception &result)
 	{
 	  /* Like in start_event_loop, enable input and force display
 	     of the prompt.  Otherwise, any command that calls
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index 4b3a0d4f62b..44164449979 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -1302,7 +1302,7 @@ find_objc_msgcall_submethod (int (*f) (CORE_ADDR, CORE_ADDR *),
       if (f (pc, new_pc) == 0)
 	return 1;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       exception_fprintf (gdb_stderr, ex,
 			 "Unable to determine target of "
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index 473773f279e..c90b68df79d 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -758,7 +758,7 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
 	{
 	  boffset = baseclass_offset (type, i, valaddr, offset, address, val);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  if (ex.error == NOT_AVAILABLE_ERROR)
 	    skip = -1;
diff --git a/gdb/parse.c b/gdb/parse.c
index fcdc2c2d54e..627ae580105 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -1204,7 +1204,7 @@ parse_exp_in_context_1 (const char **stringptr, CORE_ADDR pc,
     {
       lang->la_parser (&ps);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       /* If parsing for completion, allow this to succeed; but if no
 	 expression elements have been written, then there's nothing
@@ -1286,7 +1286,7 @@ parse_expression_for_completion (const char *string,
       parse_completion = 1;
       exp = parse_exp_in_context (&string, 0, 0, 0, 0, &subexp);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       /* Nothing, EXP remains NULL.  */
     }
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index c0b7505dda4..96503b02d2b 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1845,7 +1845,7 @@ ppc_linux_spe_context (int wordsize, enum bfd_endian byte_order,
 	  spe_context_cache_ptid = inferior_ptid;
 	}
 
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  return 0;
 	}
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index dc506250d4b..ecff90256a8 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1888,7 +1888,7 @@ do_one_display (struct display *d)
 	  d->exp = parse_expression (d->exp_string);
 	  d->block = innermost_block.block ();
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	  /* Can't re-parse the expression.  Disable this display item.  */
 	  d->enabled_p = 0;
@@ -1953,7 +1953,7 @@ do_one_display (struct display *d)
 	    addr = gdbarch_addr_bits_remove (d->exp->gdbarch, addr);
 	  do_examine (d->format, d->exp->gdbarch, addr);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  fprintf_filtered (gdb_stdout, _("<error: %s>\n"),
 			    ex.message.c_str ());
@@ -1987,7 +1987,7 @@ do_one_display (struct display *d)
 	  val = evaluate_expression (d->exp.get ());
 	  print_formatted (val, d->format.size, &opts, gdb_stdout);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  fprintf_filtered (gdb_stdout, _("<error: %s>"), ex.message.c_str ());
 	}
@@ -2191,7 +2191,7 @@ print_variable_and_value (const char *name, struct symbol *var,
 	 function.  */
       frame = NULL;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       fprintf_filtered (stream, "<error reading variable %s (%s)>", name,
 			except.message.c_str ());
diff --git a/gdb/python/py-arch.c b/gdb/python/py-arch.c
index 9b234577594..471a3e941b1 100644
--- a/gdb/python/py-arch.c
+++ b/gdb/python/py-arch.c
@@ -203,7 +203,7 @@ archpy_disassemble (PyObject *self, PyObject *args, PyObject *kw)
         {
           insn_len = gdb_print_insn (gdbarch, pc, &stb, NULL);
         }
-      catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+      catch (const struct gdb_exception &except)
         {
 	  gdbpy_convert_exception (except);
 	  return NULL;
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index 835d3d9dd45..04982221d68 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -145,7 +145,7 @@ bppy_set_enabled (PyObject *self, PyObject *newvalue, void *closure)
       else
 	disable_breakpoint (self_bp->bp);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_SET_HANDLE_EXCEPTION (except);
     }
@@ -250,7 +250,7 @@ bppy_set_task (PyObject *self, PyObject *newvalue, void *closure)
 	{
 	  valid_id = valid_task_id (id);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+      catch (const struct gdb_exception &except)
 	{
 	  GDB_PY_SET_HANDLE_EXCEPTION (except);
 	}
@@ -292,7 +292,7 @@ bppy_delete_breakpoint (PyObject *self, PyObject *args)
     {
       delete_breakpoint (self_bp->bp);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -333,7 +333,7 @@ bppy_set_ignore_count (PyObject *self, PyObject *newvalue, void *closure)
     {
       set_ignore_count (self_bp->number, (int) value, 0);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_SET_HANDLE_EXCEPTION (except);
     }
@@ -469,7 +469,7 @@ bppy_set_condition (PyObject *self, PyObject *newvalue, void *closure)
     {
       set_breakpoint_condition (self_bp->bp, exp, 0);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       except = ex;
     }
@@ -498,7 +498,7 @@ bppy_get_commands (PyObject *self, void *closure)
     {
       print_command_lines (current_uiout, breakpoint_commands (bp), 0);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       current_uiout->redirect (NULL);
       gdbpy_convert_exception (except);
@@ -540,7 +540,7 @@ bppy_set_commands (PyObject *self, PyObject *newvalue, void *closure)
       counted_command_line lines = read_command_lines_1 (reader, 1, nullptr);
       breakpoint_set_commands (self_bp->bp, std::move (lines));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       except = ex;
     }
@@ -864,7 +864,7 @@ bppy_init (PyObject *self, PyObject *args, PyObject *kwargs)
 	  error(_("Do not understand breakpoint type to set."));
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       bppy_pending_object = NULL;
       gdbpy_convert_exception (except);
diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c
index 4812c6acca0..339a608b0fa 100644
--- a/gdb/python/py-cmd.c
+++ b/gdb/python/py-cmd.c
@@ -572,7 +572,7 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
 	set_cmd_completer_handle_brkchars (cmd,
 					   cmdpy_completer_handle_brkchars);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       xfree (cmd_name);
       xfree (docstring);
diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c
index e23f5c18ea1..73a92990d8c 100644
--- a/gdb/python/py-finishbreakpoint.c
+++ b/gdb/python/py-finishbreakpoint.c
@@ -121,7 +121,7 @@ bpfinishpy_pre_stop_hook (struct gdbpy_breakpoint_object *bp_obj)
           self_finishbp->return_value = Py_None;
         }
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       gdbpy_convert_exception (except);
       gdbpy_print_stack ();
@@ -141,7 +141,7 @@ bpfinishpy_post_stop_hook (struct gdbpy_breakpoint_object *bp_obj)
       disable_breakpoint (bp_obj->bp);
       gdb_assert (bp_obj->bp->disposition == disp_del);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       gdbpy_convert_exception (except);
       gdbpy_print_stack ();
@@ -208,7 +208,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
 	    }
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       gdbpy_convert_exception (except);
       return -1;
@@ -267,7 +267,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
             }
         }
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       /* Just swallow.  Either the return type or the function value
 	 remain NULL.  */
@@ -302,7 +302,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
                          &bkpt_breakpoint_ops,
                          0, 1, internal_bp, 0);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_SET_HANDLE_EXCEPTION (except);
     }
@@ -364,7 +364,7 @@ bpfinishpy_detect_out_scope_cb (struct breakpoint *b, void *args)
                       || frame_find_by_id (b->frame_id) == NULL))
                 bpfinishpy_out_of_scope (finish_bp);
             }
-          catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+          catch (const struct gdb_exception &except)
             {
               gdbpy_convert_exception (except);
               gdbpy_print_stack ();
diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c
index 32891dc048a..862874cf92a 100644
--- a/gdb/python/py-frame.c
+++ b/gdb/python/py-frame.c
@@ -99,7 +99,7 @@ frapy_is_valid (PyObject *self, PyObject *args)
     {
       frame = frame_object_to_frame_info (self);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -127,7 +127,7 @@ frapy_name (PyObject *self, PyObject *args)
 
       name = find_frame_funname (frame, &lang, NULL);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -161,7 +161,7 @@ frapy_type (PyObject *self, PyObject *args)
 
       type = get_frame_type (frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -182,7 +182,7 @@ frapy_arch (PyObject *self, PyObject *args)
     {
       FRAPY_REQUIRE_VALID (self, frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -203,7 +203,7 @@ frapy_unwind_stop_reason (PyObject *self, PyObject *args)
     {
       FRAPY_REQUIRE_VALID (self, frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -228,7 +228,7 @@ frapy_pc (PyObject *self, PyObject *args)
 
       pc = get_frame_pc (frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -264,7 +264,7 @@ frapy_read_register (PyObject *self, PyObject *args)
       if (val == NULL)
         PyErr_SetString (PyExc_ValueError, _("Unknown register."));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -286,7 +286,7 @@ frapy_block (PyObject *self, PyObject *args)
       FRAPY_REQUIRE_VALID (self, frame);
       block = get_frame_block (frame, NULL);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -331,7 +331,7 @@ frapy_function (PyObject *self, PyObject *args)
       gdb::unique_xmalloc_ptr<char> funname
 	= find_frame_funname (frame, &funlang, &sym);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -373,7 +373,7 @@ frame_info_to_frame_object (struct frame_info *frame)
 	}
       frame_obj->gdbarch = get_frame_arch (frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       gdbpy_convert_exception (except);
       return NULL;
@@ -398,7 +398,7 @@ frapy_older (PyObject *self, PyObject *args)
 
       prev = get_prev_frame (frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -430,7 +430,7 @@ frapy_newer (PyObject *self, PyObject *args)
 
       next = get_next_frame (frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -462,7 +462,7 @@ frapy_find_sal (PyObject *self, PyObject *args)
       symtab_and_line sal = find_frame_sal (frame);
       sal_obj = symtab_and_line_to_sal_object (sal);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -521,7 +521,7 @@ frapy_read_var (PyObject *self, PyObject *args)
 	  var = lookup_sym.symbol;
 	  block = lookup_sym.block;
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+      catch (const struct gdb_exception &except)
 	{
 	  gdbpy_convert_exception (except);
 	  return NULL;
@@ -548,7 +548,7 @@ frapy_read_var (PyObject *self, PyObject *args)
 
       val = read_var_value (var, block, frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -569,7 +569,7 @@ frapy_select (PyObject *self, PyObject *args)
 
       select_frame (fi);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -589,7 +589,7 @@ gdbpy_newest_frame (PyObject *self, PyObject *args)
     {
       frame = get_current_frame ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -609,7 +609,7 @@ gdbpy_selected_frame (PyObject *self, PyObject *args)
     {
       frame = get_selected_frame ("No frame is currently selected.");
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
index 545ed713efd..672c324c2bf 100644
--- a/gdb/python/py-framefilter.c
+++ b/gdb/python/py-framefilter.c
@@ -1085,7 +1085,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
     {
       gdbarch = get_frame_arch (frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       /* Let gdb try to print the stack trace.  */
       return EXT_LANG_BT_NO_FILTERS;
@@ -1170,7 +1170,7 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
 	  success = py_print_frame (item.get (), flags, args_type, out, 0,
 				    levels_printed.get ());
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+      catch (const struct gdb_exception_error &except)
 	{
 	  gdbpy_convert_exception (except);
 	  success = EXT_LANG_BT_ERROR;
diff --git a/gdb/python/py-gdb-readline.c b/gdb/python/py-gdb-readline.c
index 6fefc470df9..c4764b7ac65 100644
--- a/gdb/python/py-gdb-readline.c
+++ b/gdb/python/py-gdb-readline.c
@@ -44,7 +44,7 @@ gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout,
       p = command_line_input (prompt, "python");
     }
   /* Handle errors by raising Python exceptions.  */
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       /* Detect user interrupt (Ctrl-C).  */
       if (except.reason == RETURN_QUIT)
diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c
index 082c7b1aeec..602ebbe3a99 100644
--- a/gdb/python/py-inferior.c
+++ b/gdb/python/py-inferior.c
@@ -393,7 +393,7 @@ infpy_threads (PyObject *self, PyObject *args)
     {
       update_thread_list ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -513,7 +513,7 @@ infpy_read_memory (PyObject *self, PyObject *args, PyObject *kw)
 
       read_memory (addr, buffer.get (), length);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -574,7 +574,7 @@ infpy_write_memory (PyObject *self, PyObject *args, PyObject *kw)
     {
       write_memory_with_notification (addr, buffer, length);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       except = ex;
     }
@@ -728,7 +728,7 @@ infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw)
 				    buffer, pattern_size,
 				    &found_addr);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       except = ex;
     }
@@ -787,7 +787,7 @@ infpy_thread_from_thread_handle (PyObject *self, PyObject *args, PyObject *kw)
       if (thread_info != NULL)
 	return thread_to_thread_object (thread_info).release ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
diff --git a/gdb/python/py-infthread.c b/gdb/python/py-infthread.c
index 66a3b3ef014..99ac6b03e61 100644
--- a/gdb/python/py-infthread.c
+++ b/gdb/python/py-infthread.c
@@ -185,7 +185,7 @@ thpy_switch (PyObject *self, PyObject *args)
     {
       switch_to_thread (thread_obj->thread);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
diff --git a/gdb/python/py-lazy-string.c b/gdb/python/py-lazy-string.c
index 24beac3bb75..7559c75b837 100644
--- a/gdb/python/py-lazy-string.c
+++ b/gdb/python/py-lazy-string.c
@@ -142,7 +142,7 @@ stpy_convert_to_value (PyObject *self, PyObject *args)
 	  break;
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
diff --git a/gdb/python/py-linetable.c b/gdb/python/py-linetable.c
index 9cabec788ba..1a09a497da3 100644
--- a/gdb/python/py-linetable.c
+++ b/gdb/python/py-linetable.c
@@ -168,7 +168,7 @@ ltpy_get_pcs_for_line (PyObject *self, PyObject *args)
     {
       pcs = find_pcs_for_symtab_line (symtab, py_line, &best_entry);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c
index fc2fefbaea1..be6e93741da 100644
--- a/gdb/python/py-objfile.c
+++ b/gdb/python/py-objfile.c
@@ -134,7 +134,7 @@ objfpy_get_build_id (PyObject *self, void *closure)
     {
       build_id = build_id_bfd_get (objfile->obfd);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -426,7 +426,7 @@ objfpy_add_separate_debug_file (PyObject *self, PyObject *args, PyObject *kw)
 
       symbol_file_add_separate (abfd.get (), file_name, 0, obj->objfile);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c
index b6da0d102e2..0074546d902 100644
--- a/gdb/python/py-param.c
+++ b/gdb/python/py-param.c
@@ -733,7 +733,7 @@ parmpy_init (PyObject *self, PyObject *args, PyObject *kwds)
 			   set_doc.get (), show_doc.get (),
 			   doc.get (), set_list, show_list);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       xfree (cmd_name);
       Py_DECREF (self);
diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
index 09e7dcf8ed4..63f0d9173b3 100644
--- a/gdb/python/py-prettyprint.c
+++ b/gdb/python/py-prettyprint.c
@@ -212,7 +212,7 @@ pretty_print_one_value (PyObject *printer, struct value **out_value)
 	    }
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
     }
 
@@ -645,7 +645,7 @@ gdbpy_get_varobj_pretty_printer (struct value *value)
     {
       value = value_copy (value);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c
index 58440e9b26a..bea614a69c6 100644
--- a/gdb/python/py-progspace.c
+++ b/gdb/python/py-progspace.c
@@ -391,7 +391,7 @@ pspy_block_for_pc (PyObject *o, PyObject *args)
       if (cust != NULL && COMPUNIT_OBJFILE (cust) != NULL)
 	block = block_for_pc (pc);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -436,7 +436,7 @@ pspy_find_pc_line (PyObject *o, PyObject *args)
       sal = find_pc_line (pc, 0);
       result = symtab_and_line_to_sal_object (sal);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
diff --git a/gdb/python/py-record-btrace.c b/gdb/python/py-record-btrace.c
index 10509885a5a..4cfefce59da 100644
--- a/gdb/python/py-record-btrace.c
+++ b/gdb/python/py-record-btrace.c
@@ -212,7 +212,7 @@ recpy_bt_insn_sal (PyObject *self, void *closure)
     {
       result = symtab_and_line_to_sal_object (find_pc_line (insn->pc, 0));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -283,7 +283,7 @@ recpy_bt_insn_data (PyObject *self, void *closure)
       buffer.resize (insn->size);
       read_memory (insn->pc, buffer.data (), insn->size);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -318,7 +318,7 @@ recpy_bt_insn_decoded (PyObject *self, void *closure)
     {
       gdb_print_insn (target_gdbarch (), insn->pc, &strfile, NULL);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       gdbpy_convert_exception (except);
       return NULL;
@@ -795,7 +795,7 @@ recpy_bt_goto (PyObject *self, PyObject *args)
       else
 	target_goto_record (obj->number);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
diff --git a/gdb/python/py-record.c b/gdb/python/py-record.c
index ee4a32f4aeb..05c24e540c4 100644
--- a/gdb/python/py-record.c
+++ b/gdb/python/py-record.c
@@ -607,7 +607,7 @@ gdbpy_start_recording (PyObject *self, PyObject *args)
       record_start (method, format, 0);
       ret = gdbpy_current_recording (self, args);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       gdbpy_convert_exception (except);
     }
@@ -641,7 +641,7 @@ gdbpy_stop_recording (PyObject *self, PyObject *args)
     {
       record_stop (0);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c
index 3ec526ad7bc..7b4b51b566b 100644
--- a/gdb/python/py-symbol.c
+++ b/gdb/python/py-symbol.c
@@ -200,7 +200,7 @@ sympy_needs_frame (PyObject *self, void *closure)
     {
       result = symbol_read_needs_frame (symbol);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -283,7 +283,7 @@ sympy_value (PyObject *self, PyObject *args)
 	 can happen with nested functions).  */
       value = read_var_value (symbol, NULL, frame_info);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -391,7 +391,7 @@ gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
 	  selected_frame = get_selected_frame (_("No frame selected."));
 	  block = get_frame_block (selected_frame, NULL);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+      catch (const struct gdb_exception &except)
 	{
 	  GDB_PY_HANDLE_EXCEPTION (except);
 	}
@@ -402,7 +402,7 @@ gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
       symbol = lookup_symbol (name, block, (domain_enum) domain,
 			      &is_a_field_of_this).symbol;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -451,7 +451,7 @@ gdbpy_lookup_global_symbol (PyObject *self, PyObject *args, PyObject *kw)
     {
       symbol = lookup_global_symbol (name, NULL, (domain_enum) domain).symbol;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index 27c8126827e..effbddb4c88 100644
--- a/gdb/python/py-type.c
+++ b/gdb/python/py-type.c
@@ -316,7 +316,7 @@ typy_fields_items (PyObject *self, enum gdbpy_iter_kind kind)
     {
       checked_type = check_typedef (checked_type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -423,7 +423,7 @@ typy_strip_typedefs (PyObject *self, PyObject *args)
     {
       type = check_typedef (type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -444,7 +444,7 @@ typy_get_composite (struct type *type)
 	{
 	  type = check_typedef (type);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+      catch (const struct gdb_exception &except)
 	{
 	  GDB_PY_HANDLE_EXCEPTION (except);
 	}
@@ -513,7 +513,7 @@ typy_array_1 (PyObject *self, PyObject *args, int is_vector)
       if (is_vector)
 	make_vector_type (array);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -547,7 +547,7 @@ typy_pointer (PyObject *self, PyObject *args)
     {
       type = lookup_pointer_type (type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -615,7 +615,7 @@ typy_reference (PyObject *self, PyObject *args)
     {
       type = lookup_lvalue_reference_type (type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -649,7 +649,7 @@ typy_const (PyObject *self, PyObject *args)
     {
       type = make_cv_type (1, 0, type, NULL);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -667,7 +667,7 @@ typy_volatile (PyObject *self, PyObject *args)
     {
       type = make_cv_type (0, 1, type, NULL);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -685,7 +685,7 @@ typy_unqualified (PyObject *self, PyObject *args)
     {
       type = make_cv_type (0, 0, type, NULL);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -703,7 +703,7 @@ typy_get_sizeof (PyObject *self, void *closure)
     {
       check_typedef (type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
     }
 
@@ -723,7 +723,7 @@ typy_get_alignof (PyObject *self, void *closure)
     {
       align = type_align (type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       align = 0;
     }
@@ -750,7 +750,7 @@ typy_lookup_typename (const char *type_name, const struct block *block)
 	type = lookup_typename (python_language, python_gdbarch,
 				type_name, block, 0);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -804,7 +804,7 @@ typy_lookup_type (struct demangle_component *demangled,
 	      break;
 	    }
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+      catch (const struct gdb_exception &except)
 	{
 	  GDB_PY_HANDLE_EXCEPTION (except);
 	}
@@ -846,7 +846,7 @@ typy_legacy_template_argument (struct type *type, const struct block *block,
       /* Note -- this is not thread-safe.  */
       info = cp_demangled_name_to_comp (TYPE_NAME (type), &err);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -926,7 +926,7 @@ typy_template_argument (PyObject *self, PyObject *args)
       if (TYPE_IS_REFERENCE (type))
 	type = check_typedef (TYPE_TARGET_TYPE (type));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -958,7 +958,7 @@ typy_template_argument (PyObject *self, PyObject *args)
     {
       val = value_of_variable (sym, block);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -976,7 +976,7 @@ typy_str (PyObject *self)
       LA_PRINT_TYPE (type_object_to_type (self), "", &thetype, -1, 0,
 		     &type_print_raw_options);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1010,7 +1010,7 @@ typy_richcompare (PyObject *self, PyObject *other, int op)
 	{
 	  result = types_deeply_equal (type1, type2);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+      catch (const struct gdb_exception &except)
 	{
 	  /* If there is a GDB exception, a comparison is not capable
 	     (or trusted), so exit.  */
diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c
index 135863cd417..c6d48181d7d 100644
--- a/gdb/python/py-unwind.c
+++ b/gdb/python/py-unwind.c
@@ -150,7 +150,7 @@ pyuw_value_obj_to_pointer (PyObject *pyo_value, CORE_ADDR *addr)
           rc = 1;
         }
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       gdbpy_convert_exception (except);
     }
@@ -215,7 +215,7 @@ unwind_infopy_str (PyObject *self)
                 value_print (value, &stb, &opts);
                 stb.puts (")");
               }
-            catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+            catch (const struct gdb_exception &except)
               {
                 GDB_PY_HANDLE_EXCEPTION (except);
               }
@@ -349,7 +349,7 @@ pending_framepy_str (PyObject *self)
       sp_str = core_addr_to_string_nz (get_frame_sp (frame));
       pc_str = core_addr_to_string_nz (get_frame_pc (frame));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -395,7 +395,7 @@ pending_framepy_read_register (PyObject *self, PyObject *args)
                       "Cannot read register %d from frame.",
                       regnum);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
diff --git a/gdb/python/py-utils.c b/gdb/python/py-utils.c
index 4e510c97a0d..ab733ae3b19 100644
--- a/gdb/python/py-utils.c
+++ b/gdb/python/py-utils.c
@@ -265,7 +265,7 @@ get_addr_from_python (PyObject *obj, CORE_ADDR *addr)
 	{
 	  *addr = value_as_address (value_object_to_value (obj));
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+      catch (const struct gdb_exception &except)
 	{
 	  GDB_PY_SET_HANDLE_EXCEPTION (except);
 	}
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index 44231ee92d8..88fd6c85372 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -224,7 +224,7 @@ valpy_dereference (PyObject *self, PyObject *args)
       res_val = value_ind (((value_object *) self)->value);
       result = value_to_value_object (res_val);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -267,7 +267,7 @@ valpy_referenced_value (PyObject *self, PyObject *args)
 
       result = value_to_value_object (res_val);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -290,7 +290,7 @@ valpy_reference_value (PyObject *self, PyObject *args, enum type_code refcode)
       self_val = ((value_object *) self)->value;
       result = value_to_value_object (value_ref (self_val, refcode));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -326,7 +326,7 @@ valpy_const_value (PyObject *self, PyObject *args)
       res_val = make_cv_value (1, 0, self_val);
       result = value_to_value_object (res_val);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -350,7 +350,7 @@ valpy_get_address (PyObject *self, void *closure)
 	  res_val = value_addr (val_obj->value);
 	  val_obj->address = value_to_value_object (res_val);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+      catch (const struct gdb_exception &except)
 	{
 	  val_obj->address = Py_None;
 	  Py_INCREF (Py_None);
@@ -428,7 +428,7 @@ valpy_get_dynamic_type (PyObject *self, void *closure)
 	  type = NULL;
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -534,7 +534,7 @@ valpy_lazy_string (PyObject *self, PyObject *args, PyObject *kw)
       str_obj = gdbpy_create_lazy_string_object (addr, length, user_encoding,
 						 type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -569,7 +569,7 @@ valpy_string (PyObject *self, PyObject *args, PyObject *kw)
     {
       LA_GET_STRING (value, &buffer, &length, &char_type, &la_encoding);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -617,7 +617,7 @@ valpy_do_cast (PyObject *self, PyObject *args, enum exp_opcode op)
 
       result = value_to_value_object (res_val);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -695,7 +695,7 @@ value_has_field (struct value *v, PyObject *field)
       else
 	has_field = 0;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_SET_HANDLE_EXCEPTION (except);
     }
@@ -873,7 +873,7 @@ valpy_getitem (PyObject *self, PyObject *key)
       if (res_val)
 	result = value_to_value_object (res_val);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       except = ex;
     }
@@ -906,7 +906,7 @@ valpy_call (PyObject *self, PyObject *args, PyObject *keywords)
     {
       ftype = check_typedef (value_type (function));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -953,7 +953,7 @@ valpy_call (PyObject *self, PyObject *args, PyObject *keywords)
 				 gdb::make_array_view (vargs, args_count));
       result = value_to_value_object (return_value);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -978,7 +978,7 @@ valpy_str (PyObject *self)
       common_val_print (((value_object *) self)->value, &stb, 0,
 			&opts, python_language);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -997,7 +997,7 @@ valpy_get_is_optimized_out (PyObject *self, void *closure)
     {
       opt = value_optimized_out (value);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1019,7 +1019,7 @@ valpy_get_is_lazy (PyObject *self, void *closure)
     {
       opt = value_lazy (value);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1041,7 +1041,7 @@ valpy_fetch_lazy (PyObject *self, PyObject *args)
       if (value_lazy (value))
 	value_fetch_lazy (value);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1212,7 +1212,7 @@ valpy_binop (enum valpy_opcode opcode, PyObject *self, PyObject *other)
     {
       result = valpy_binop_throw (opcode, self, other);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1280,7 +1280,7 @@ valpy_negative (PyObject *self)
       val = value_neg (((value_object *) self)->value);
       result = value_to_value_object (val);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1307,7 +1307,7 @@ valpy_absolute (PyObject *self)
       if (value_less (value, value_zero (value_type (value), not_lval)))
 	isabs = 0;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1340,7 +1340,7 @@ valpy_nonzero (PyObject *self)
 	/* All other values are True.  */
 	nonzero = 1;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       except = ex;
     }
@@ -1363,7 +1363,7 @@ valpy_invert (PyObject *self)
     {
       val = value_complement (((value_object *) self)->value);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1490,7 +1490,7 @@ valpy_richcompare (PyObject *self, PyObject *other, int op)
     {
       result = valpy_richcompare_throw (self, other, op);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1528,7 +1528,7 @@ valpy_int (PyObject *self)
 
       l = value_as_long (value);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1564,7 +1564,7 @@ valpy_long (PyObject *self)
 
       l = value_as_long (value);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1599,7 +1599,7 @@ valpy_float (PyObject *self)
       else
 	error (_("Cannot convert value to float."));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1746,7 +1746,7 @@ convert_value_from_python (PyObject *obj)
 		      PyString_AsString (PyObject_Str (obj)));
 #endif
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       gdbpy_convert_exception (except);
       return NULL;
@@ -1769,7 +1769,7 @@ gdbpy_history (PyObject *self, PyObject *args)
     {
       res_val = access_value_history (i);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1798,7 +1798,7 @@ gdbpy_convenience_variable (PyObject *self, PyObject *args)
 	    res_val = NULL;
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1844,7 +1844,7 @@ gdbpy_set_convenience_variable (PyObject *self, PyObject *args)
 	  set_internalvar (var, value);
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
diff --git a/gdb/python/python.c b/gdb/python/python.c
index a923794bccd..ff03f85a60a 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -501,7 +501,7 @@ gdbpy_parameter (PyObject *self, PyObject *args)
     {
       found = lookup_cmd_composition (newarg.c_str (), &alias, &prefix, &cmd);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       GDB_PY_HANDLE_EXCEPTION (ex);
     }
@@ -614,7 +614,7 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
       /* Do any commands attached to breakpoint we stopped at.  */
       bpstat_do_actions ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -842,7 +842,7 @@ gdbpy_decode_line (PyObject *self, PyObject *args)
 	  sals = def_sal;
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       /* We know this will always throw.  */
       gdbpy_convert_exception (ex);
@@ -900,7 +900,7 @@ gdbpy_parse_and_eval (PyObject *self, PyObject *args)
       gdbpy_allow_threads allow_threads;
       result = parse_and_eval (expr_str);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1150,7 +1150,7 @@ gdbpy_write (PyObject *self, PyObject *args, PyObject *kw)
           fprintf_filtered (gdb_stdout, "%s", arg);
         }
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
@@ -1223,7 +1223,7 @@ gdbpy_print_stack (void)
 	{
 	  begin_line ();
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+      catch (const struct gdb_exception &except)
 	{
 	}
     }
@@ -1254,7 +1254,7 @@ gdbpy_print_stack (void)
 	    fprintf_filtered (gdb_stderr, "Python Exception %s %s: \n",
 			      type.get (), msg.get ());
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+      catch (const struct gdb_exception &except)
 	{
 	}
     }
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index 8fa1b58feaf..ec45cb4aada 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -286,7 +286,7 @@ record_btrace_enable_warn (struct thread_info *tp)
     {
       btrace_enable (tp, &record_btrace_conf);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &error)
+  catch (const struct gdb_exception_error &error)
     {
       warning ("%s", error.message.c_str ());
     }
@@ -1481,7 +1481,7 @@ record_btrace_target::insert_breakpoint (struct gdbarch *gdbarch,
     {
       ret = this->beneath ()->insert_breakpoint (gdbarch, bp_tgt);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       replay_memory_access = old;
       throw_exception (except);
@@ -1511,7 +1511,7 @@ record_btrace_target::remove_breakpoint (struct gdbarch *gdbarch,
     {
       ret = this->beneath ()->remove_breakpoint (gdbarch, bp_tgt, reason);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       replay_memory_access = old;
       throw_exception (except);
@@ -1987,7 +1987,7 @@ get_thread_current_frame_id (struct thread_info *tp)
     {
       id = get_frame_id (get_current_frame ());
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       /* Restore the previous execution state.  */
       set_executing (inferior_ptid, executing);
@@ -2066,7 +2066,7 @@ record_btrace_start_replaying (struct thread_info *tp)
       if (upd_step_stack_frame_id)
 	tp->control.step_stack_frame_id = frame_id;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
       xfree (btinfo->replay);
       btinfo->replay = NULL;
@@ -2891,7 +2891,7 @@ cmd_record_btrace_bts_start (const char *args, int from_tty)
     {
       execute_command ("target record-btrace", from_tty);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &exception)
+  catch (const struct gdb_exception &exception)
     {
       record_btrace_conf.format = BTRACE_FORMAT_NONE;
       throw_exception (exception);
@@ -2912,7 +2912,7 @@ cmd_record_btrace_pt_start (const char *args, int from_tty)
     {
       execute_command ("target record-btrace", from_tty);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &exception)
+  catch (const struct gdb_exception &exception)
     {
       record_btrace_conf.format = BTRACE_FORMAT_NONE;
       throw_exception (exception);
@@ -2933,7 +2933,7 @@ cmd_record_btrace_start (const char *args, int from_tty)
     {
       execute_command ("target record-btrace", from_tty);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &exception)
+  catch (const struct gdb_exception &exception)
     {
       record_btrace_conf.format = BTRACE_FORMAT_BTS;
 
@@ -2941,7 +2941,7 @@ cmd_record_btrace_start (const char *args, int from_tty)
 	{
 	  execute_command ("target record-btrace", from_tty);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	  record_btrace_conf.format = BTRACE_FORMAT_NONE;
 	  throw_exception (ex);
diff --git a/gdb/record-full.c b/gdb/record-full.c
index c6d63354dd7..6b68e51ded5 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -761,7 +761,7 @@ record_full_message (struct regcache *regcache, enum gdb_signal signal)
       if (ret < 0)
 	error (_("Process record: failed to record execution log."));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       record_full_list_release (record_full_arch_list_tail);
       throw_exception (ex);
@@ -785,7 +785,7 @@ record_full_message_wrapper_safe (struct regcache *regcache,
     {
       record_full_message (regcache, signal);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       exception_print (gdb_stderr, ex);
       return false;
@@ -1434,7 +1434,7 @@ record_full_wait_1 (struct target_ops *ops,
 	  else
 	    status->value.sig = GDB_SIGNAL_TRAP;
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	  if (execution_direction == EXEC_REVERSE)
 	    {
@@ -2473,7 +2473,7 @@ record_full_restore (void)
 	  record_full_arch_list_add (rec);
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       record_full_list_release (record_full_arch_list_tail);
       throw_exception (ex);
diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c
index 2e2dc157599..2040f85dd9a 100644
--- a/gdb/remote-fileio.c
+++ b/gdb/remote-fileio.c
@@ -1189,7 +1189,7 @@ remote_fileio_request (remote_target *remote, char *buf, int ctrlc_pending_p)
 	{
 	  do_remote_fileio_request (remote, buf);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	  if (ex.reason == RETURN_QUIT)
 	    remote_fileio_reply (remote, -1, FILEIO_EINTR);
diff --git a/gdb/remote.c b/gdb/remote.c
index ed4cdd9e22a..c4d384f9bb7 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1151,7 +1151,7 @@ remote_target::remote_get_noisy_reply ()
 	      gdbarch_relocate_instruction (target_gdbarch (), &to, from);
 	      relocated = 1;
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+	  catch (const struct gdb_exception &ex)
 	    {
 	      if (ex.error == MEMORY_ERROR)
 		{
@@ -5603,7 +5603,7 @@ remote_target::open_1 (const char *name, int from_tty, int extended_p)
       {
 	remote->start_remote (from_tty, extended_p);
       }
-    catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+    catch (const struct gdb_exception &ex)
       {
 	/* Pop the partially set up target - unless something else did
 	   already before throwing the exception.  */
@@ -9768,7 +9768,7 @@ remote_target::remote_kill_k ()
     {
       putpkt ("k");
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error == TARGET_CLOSE_ERROR)
 	{
@@ -13143,7 +13143,7 @@ remote_target::get_trace_status (struct trace_status *ts)
     {
       p = remote_get_noisy_reply ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error != TARGET_CLOSE_ERROR)
 	{
@@ -13797,7 +13797,7 @@ remote_target::enable_btrace (ptid_t ptid, const struct btrace_config *conf)
     {
       btrace_read_config (&tinfo->conf);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &err)
+  catch (const struct gdb_exception_error &err)
     {
       if (!err.message.empty ())
 	warning ("%s", err.message.c_str ());
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index e23e0814201..691dd2deb9d 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -656,7 +656,7 @@ riscv_print_one_register_info (struct gdbarch *gdbarch,
       val = value_of_register (regnum, frame);
       regtype = value_type (val);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       /* Handle failure to read a register without interrupting the entire
          'info registers' flow.  */
@@ -2806,7 +2806,7 @@ riscv_frame_this_id (struct frame_info *this_frame,
       cache = riscv_frame_cache (this_frame, prologue_cache);
       *this_id = cache->this_id;
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       /* Ignore errors, this leaves the frame id as the predefined outer
          frame id which terminates the backtrace at this point.  */
diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c
index 05055a4a872..7303c2a95f2 100644
--- a/gdb/rs6000-aix-tdep.c
+++ b/gdb/rs6000-aix-tdep.c
@@ -674,7 +674,7 @@ rs6000_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
         {
           pc = read_memory_unsigned_integer (addr, tdep->wordsize, byte_order);
         }
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+      catch (const struct gdb_exception_error &e)
         {
           /* An error occured during reading.  Probably a memory error
              due to the section not being loaded yet.  This address
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 4213438c841..5fc841d630b 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -3468,7 +3468,7 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache)
       cache->base = get_frame_register_unsigned
 	(this_frame, gdbarch_sp_regnum (gdbarch));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
 	throw_exception (ex);
@@ -3697,7 +3697,7 @@ rs6000_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
       trad_frame_set_value (cache->saved_regs,
 			    gdbarch_pc_regnum (gdbarch), lr);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
 	throw_exception (ex);
diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y
index 97c1b5edd2d..b266bc3696e 100644
--- a/gdb/rust-exp.y
+++ b/gdb/rust-exp.y
@@ -2602,7 +2602,7 @@ rust_lex_exception_test (rust_parser *parser, const char *input,
       rust_lex_test_one (parser, input, DECIMAL_INTEGER);
       SELF_CHECK (0);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       SELF_CHECK (except.message == err);
     }
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
index 228684a6cc5..6f69a8ea525 100644
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
@@ -1748,7 +1748,7 @@ tuple structs, and tuple-like enum variants"));
 		result = value_struct_elt (&lhs, NULL, field_name,
 					   NULL, "structure");
 	      }
-	    catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	    catch (const struct gdb_exception_error &except)
 	      {
 		error (_("Could not find field %s of struct variant %s::%s"),
 		       field_name, TYPE_NAME (outer_type),
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 09946a9e531..2bef8293d96 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -2554,7 +2554,7 @@ s390_frame_unwind_cache (struct frame_info *this_frame,
       if (!s390_prologue_frame_unwind_cache (this_frame, info))
 	s390_backchain_frame_unwind_cache (this_frame, info);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
 	throw_exception (ex);
diff --git a/gdb/selftest-arch.c b/gdb/selftest-arch.c
index 063ff8d74fa..6a7688b8f26 100644
--- a/gdb/selftest-arch.c
+++ b/gdb/selftest-arch.c
@@ -72,7 +72,7 @@ struct gdbarch_selftest : public selftest
 
 	    function (gdbarch);
 	  }
-	catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+	catch (const struct gdb_exception_error &ex)
 	  {
 	    pass = false;
 	    exception_fprintf (gdb_stderr, ex,
diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c
index 9b7f3ecb382..a78417edbe1 100644
--- a/gdb/solib-dsbt.c
+++ b/gdb/solib-dsbt.c
@@ -834,7 +834,7 @@ enable_break (void)
 	{
 	  tmp_bfd = solib_bfd_open (buf);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	}
 
diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
index 70a9f5fdba6..036f905fd6c 100644
--- a/gdb/solib-frv.c
+++ b/gdb/solib-frv.c
@@ -565,7 +565,7 @@ enable_break2 (void)
         {
           tmp_bfd = solib_bfd_open (buf);
         }
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	}
 
diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c
index a36f84b5a72..31b66fa52d5 100644
--- a/gdb/solib-spu.c
+++ b/gdb/solib-spu.c
@@ -133,7 +133,7 @@ append_ocl_sos (struct so_list **link_ptr)
 		  link_ptr = &newobj->next;
 		}
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+	  catch (const struct gdb_exception &ex)
 	    {
 	      /* Ignore memory errors.  */
 	      switch (ex.error)
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index e25618d1f26..a1a782e37ad 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -874,7 +874,7 @@ solib_svr4_r_map (struct svr4_info *info)
       addr = read_memory_typed_address (info->debug_base + lmo->r_map_offset,
                                         ptr_type);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       exception_print (gdb_stderr, ex);
     }
@@ -913,7 +913,7 @@ solib_svr4_r_ldsomap (struct svr4_info *info)
 	= read_memory_unsigned_integer (info->debug_base + lmo->r_version_offset,
 					lmo->r_version_size, byte_order);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       exception_print (gdb_stderr, ex);
     }
@@ -1729,7 +1729,7 @@ solib_event_probe_action (struct probe_and_action *pa)
     {
       probe_argc = pa->prob->get_argument_count (frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       exception_print (gdb_stderr, ex);
       probe_argc = 0;
@@ -1892,7 +1892,7 @@ svr4_handle_solib_event (void)
       {
 	val = pa->prob->evaluate_argument (1, frame);
       }
-    catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+    catch (const struct gdb_exception_error &ex)
       {
 	exception_print (gdb_stderr, ex);
 	val = NULL;
@@ -1923,7 +1923,7 @@ svr4_handle_solib_event (void)
 	  {
 	    val = pa->prob->evaluate_argument (2, frame);
 	  }
-	catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+	catch (const struct gdb_exception_error &ex)
 	  {
 	    exception_print (gdb_stderr, ex);
 	    return;
@@ -2273,7 +2273,7 @@ enable_break (struct svr4_info *info, int from_tty)
         {
 	  tmp_bfd = solib_bfd_open (interp_name);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	}
 
diff --git a/gdb/solib.c b/gdb/solib.c
index 37c218e18eb..998e2f7efbb 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -700,7 +700,7 @@ solib_read_symbols (struct so_list *so, symfile_add_flags flags)
 
 	  so->symbols_loaded = 1;
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+      catch (const struct gdb_exception_error &e)
 	{
 	  exception_fprintf (gdb_stderr, e, _("Error while reading shared"
 					      " library symbols for %s:\n"),
@@ -751,7 +751,7 @@ update_solib_list (int from_tty)
 	    {
 	      ops->open_symbol_file_object (from_tty);
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+	  catch (const struct gdb_exception &ex)
 	    {
 	      exception_fprintf (gdb_stderr, ex,
 				 "Error reading attached "
@@ -877,7 +877,7 @@ update_solib_list (int from_tty)
 		}
 	    }
 
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+	  catch (const struct gdb_exception_error &e)
 	    {
 	      exception_fprintf (gdb_stderr, e,
 				 _("Error while mapping shared "
@@ -1335,7 +1335,7 @@ reload_shared_libraries_1 (int from_tty)
 	      solib_map_sections (so);
 	    }
 
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+	  catch (const struct gdb_exception_error &e)
 	    {
 	      exception_fprintf (gdb_stderr, e,
 				 _("Error while mapping "
diff --git a/gdb/sparc64-linux-tdep.c b/gdb/sparc64-linux-tdep.c
index 551a26d816b..ef49244a549 100644
--- a/gdb/sparc64-linux-tdep.c
+++ b/gdb/sparc64-linux-tdep.c
@@ -138,7 +138,7 @@ sparc64_linux_handle_segmentation_fault (struct gdbarch *gdbarch,
       if (si_code >= SEGV_ACCADI && si_code <= SEGV_ADIPERR)
         addr = parse_and_eval_long ("$_siginfo._sifields._sigfault.si_addr");
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &exception)
+  catch (const struct gdb_exception &exception)
     {
       return;
     }
diff --git a/gdb/stack.c b/gdb/stack.c
index 056ce716810..0f8f4369043 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -182,7 +182,7 @@ print_stack_frame (struct frame_info *frame, int print_level,
       if (set_current_sal)
 	set_current_sal_from_frame (frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+  catch (const struct gdb_exception_error &e)
     {
     }
 }
@@ -296,7 +296,7 @@ print_frame_arg (const struct frame_arg *arg)
 
 	      common_val_print (arg->val, &stb, 2, &opts, language);
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	  catch (const struct gdb_exception_error &except)
 	    {
 	      error_message = std::move (except.message);
 	    }
@@ -324,7 +324,7 @@ read_frame_local (struct symbol *sym, struct frame_info *frame,
     {
       argp->val = read_var_value (sym, NULL, frame);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       argp->error = xstrdup (except.message.c_str ());
     }
@@ -349,7 +349,7 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame,
 	{
 	  val = read_var_value (sym, NULL, frame);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+      catch (const struct gdb_exception_error &except)
 	{
 	  val_error = (char *) alloca (except.message.size () + 1);
 	  strcpy (val_error, except.message.c_str ());
@@ -369,7 +369,7 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame,
 	  ops = SYMBOL_COMPUTED_OPS (sym);
 	  entryval = ops->read_variable_at_entry (sym, frame);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+      catch (const struct gdb_exception_error &except)
 	{
 	  if (except.error != NO_ENTRY_VALUE_ERROR)
 	    {
@@ -425,7 +425,7 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame,
 						TYPE_LENGTH (type_deref)))
 			val_equal = 1;
 		    }
-		  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+		  catch (const struct gdb_exception_error &except)
 		    {
 		      /* If the dereferenced content could not be
 			 fetched do not display anything.  */
@@ -473,7 +473,7 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame,
 	    {
 	      val = read_var_value (sym, NULL, frame);
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	  catch (const struct gdb_exception_error &except)
 	    {
 	      val_error = (char *) alloca (except.message.size () + 1);
 	      strcpy (val_error, except.message.c_str ());
@@ -760,7 +760,7 @@ do_gdb_disassembly (struct gdbarch *gdbarch,
 		       DISASSEMBLY_RAW_INSN, how_many,
 		       low, high);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &exception)
+  catch (const struct gdb_exception_error &exception)
     {
       /* If an exception was thrown while doing the disassembly, print
 	 the error message, to give the user a clue of what happened.  */
@@ -1202,7 +1202,7 @@ print_frame (struct frame_info *frame, int print_level,
 	    {
 	      print_frame_args (func, frame, numargs, gdb_stdout);
 	    }
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &e)
+	  catch (const struct gdb_exception_error &e)
 	    {
 	    }
 
@@ -1391,7 +1391,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
 	  caller_pc = frame_unwind_caller_pc (fi);
 	  caller_pc_p = 1;
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  switch (ex.error)
 	    {
@@ -2706,7 +2706,7 @@ frame_apply_command_count (const char *which_command,
 	      printf_filtered ("%s", cmd_result.c_str ());
 	    }
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  fi = get_selected_frame (_("frame apply "
 				     "unable to get selected frame."));
diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c
index 5287e280a91..04b0bdd477d 100644
--- a/gdb/symfile-mem.c
+++ b/gdb/symfile-mem.c
@@ -198,7 +198,7 @@ add_vsyscall_page (struct target_ops *target, int from_tty)
 				       name,
 				       0 /* from_tty */);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	  exception_print (gdb_stderr, ex);
 	}
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 2efa447733d..9025217a106 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -356,7 +356,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
 		{
 		  print_symbol (gdbarch, sym, depth + 1, outfile);
 		}
-	      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+	      catch (const struct gdb_exception_error &ex)
 		{
 		  exception_fprintf (gdb_stderr, ex,
 				     "Error printing symbol:\n");
diff --git a/gdb/target.c b/gdb/target.c
index ccad0031458..605383eeee8 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -717,7 +717,7 @@ target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
 	}
       /* If an error occurred, print TLS related messages here.  Otherwise,
          throw the error to some higher catcher.  */
-      catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+      catch (const struct gdb_exception &ex)
 	{
 	  int objfile_is_library = (objfile->flags & OBJF_SHARED);
 
diff --git a/gdb/thread.c b/gdb/thread.c
index c1928c25402..2b84facbc27 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -1470,7 +1470,7 @@ thr_try_catch_cmd (thread_info *thr, const char *cmd, int from_tty,
 	  printf_filtered ("%s", cmd_result.c_str ());
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       if (!flags.silent)
 	{
diff --git a/gdb/top.c b/gdb/top.c
index 285927f5712..6bffea93764 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1625,7 +1625,7 @@ quit_force (int *exit_arg, int from_tty)
       disconnect_tracing ();
       iterate_over_inferiors (kill_or_detach, &qt);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       exception_print (gdb_stderr, ex);
     }
@@ -1636,7 +1636,7 @@ quit_force (int *exit_arg, int from_tty)
     {
       pop_all_targets ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       exception_print (gdb_stderr, ex);
     }
@@ -1664,7 +1664,7 @@ quit_force (int *exit_arg, int from_tty)
 	    gdb_safe_append_history ();
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       exception_print (gdb_stderr, ex);
     }
@@ -1674,7 +1674,7 @@ quit_force (int *exit_arg, int from_tty)
     {
       do_final_cleanups ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       exception_print (gdb_stderr, ex);
     }
diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c
index 53e85fc13f5..95cd831a30d 100644
--- a/gdb/tracefile-tfile.c
+++ b/gdb/tracefile-tfile.c
@@ -547,7 +547,7 @@ tfile_target_open (const char *arg, int from_tty)
       if (trace_regblock_size == 0)
 	error (_("No register block size recorded in trace file"));
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       /* Remove the partially set up target.  */
       unpush_target (&tfile_ops);
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 52f6bc39c44..5284751714a 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -110,7 +110,7 @@ tui_rl_switch_mode (int notused1, int notused2)
 	  tui_enable ();
 	}
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       exception_print (gdb_stderr, ex);
 
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index 42d344ea8f6..4dc95229b88 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -419,7 +419,7 @@ type_to_string (struct type *type)
       type_print (type, "", &stb, -1);
       return std::move (stb.string ());
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &except)
+  catch (const struct gdb_exception &except)
     {
     }
 
diff --git a/gdb/unittests/cli-utils-selftests.c b/gdb/unittests/cli-utils-selftests.c
index 7c1d135ecc8..f26a6d1adef 100644
--- a/gdb/unittests/cli-utils-selftests.c
+++ b/gdb/unittests/cli-utils-selftests.c
@@ -83,7 +83,7 @@ test_number_or_range_parser ()
 	minus_one.get_number ();
 	SELF_CHECK (false);
       }
-    catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+    catch (const struct gdb_exception_error &ex)
       {
 	SELF_CHECK (ex.reason == RETURN_ERROR);
 	SELF_CHECK (ex.error == GENERIC_ERROR);
@@ -219,7 +219,7 @@ test_parse_flags_qcs ()
 				&flags);
 	SELF_CHECK (false);
       }
-    catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+    catch (const struct gdb_exception_error &ex)
       {
 	SELF_CHECK (ex.reason == RETURN_ERROR);
 	SELF_CHECK (ex.error == GENERIC_ERROR);
diff --git a/gdb/unittests/parse-connection-spec-selftests.c b/gdb/unittests/parse-connection-spec-selftests.c
index 7376a53d427..de9f7ea287e 100644
--- a/gdb/unittests/parse-connection-spec-selftests.c
+++ b/gdb/unittests/parse-connection-spec-selftests.c
@@ -213,7 +213,7 @@ test_conn (const parse_conn_test &c)
     {
       ret = parse_connection_spec (c.connspec, &hint);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+  catch (const struct gdb_exception_error &ex)
     {
       /* If we caught an error, we should check if this connection
 	 spec was supposed to fail.  */
diff --git a/gdb/valops.c b/gdb/valops.c
index 117b080c70c..d5efbc6abbb 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3625,7 +3625,7 @@ value_rtti_indirect_type (struct value *v, int *full,
         {
 	  target = value_ind (v);
         }
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+      catch (const struct gdb_exception_error &except)
 	{
 	  if (except.error == MEMORY_ERROR)
 	    {
@@ -3777,7 +3777,7 @@ value_of_this_silent (const struct language_defn *lang)
     {
       ret = value_of_this (lang);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
     }
 
diff --git a/gdb/valprint.c b/gdb/valprint.c
index e4e8fbb857b..958c20ec379 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -1062,7 +1062,7 @@ val_print (struct type *type, LONGEST embedded_offset,
 			      stream, recurse, val,
 			      &local_opts);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       fprintf_filtered (stream, _("<error reading variable>"));
     }
diff --git a/gdb/value.c b/gdb/value.c
index f9e3d65f19d..033eae5a5b9 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -1409,7 +1409,7 @@ value_optimized_out (struct value *value)
 	{
 	  value_fetch_lazy (value);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  /* Fall back to checking value->optimized_out.  */
 	}
@@ -2541,7 +2541,7 @@ show_convenience (const char *ignore, int from_tty)
 	  val = value_of_internalvar (gdbarch, var);
 	  value_print (val, gdb_stdout, &opts);
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &ex)
+      catch (const struct gdb_exception_error &ex)
 	{
 	  fprintf_filtered (gdb_stdout, _("<error: %s>"), ex.message.c_str ());
 	}
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 4dfc816d835..1d2fa96f5f8 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -318,7 +318,7 @@ varobj_create (const char *objname,
 	  var->root->exp = parse_exp_1 (&p, pc, block, 0);
 	}
 
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+      catch (const struct gdb_exception_error &except)
 	{
 	  return NULL;
 	}
@@ -366,7 +366,7 @@ varobj_create (const char *objname,
 	{
 	  value = evaluate_expression (var->root->exp.get ());
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+      catch (const struct gdb_exception_error &except)
 	{
 	  /* Error getting the value.  Try to at least get the
 	     right type.  */
@@ -1036,7 +1036,7 @@ varobj_set_value (struct varobj *var, const char *expression)
       value = evaluate_expression (exp.get ());
     }
 
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       /* We cannot proceed without a valid expression.  */
       return false;
@@ -1064,7 +1064,7 @@ varobj_set_value (struct varobj *var, const char *expression)
       val = value_assign (var->value.get (), value);
     }
 
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+  catch (const struct gdb_exception_error &except)
     {
       return false;
     }
@@ -1311,7 +1311,7 @@ install_new_value (struct varobj *var, struct value *value, bool initial)
 	      value_fetch_lazy (value);
 	    }
 
-	  catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+	  catch (const struct gdb_exception_error &except)
 	    {
 	      /* Set the value to NULL, so that for the next -var-update,
 		 we don't try to compare the new value with this value,
@@ -2137,7 +2137,7 @@ value_of_root_1 (struct varobj **var_handle)
 	{
 	  new_val = evaluate_expression (var->root->exp.get ());
 	}
-      catch (const struct gdb_exception_RETURN_MASK_ERROR &except)
+      catch (const struct gdb_exception_error &except)
 	{
 	}
     }
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index f15aef0e369..17e0210287f 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -947,7 +947,7 @@ catch_errors (void (*func) ())
     {
       func ();
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       exception_print (gdb_stderr, ex);
     }
diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c
index 2ee93e7f410..94781e85b09 100644
--- a/gdb/x86-linux-nat.c
+++ b/gdb/x86-linux-nat.c
@@ -221,7 +221,7 @@ x86_linux_nat_target::enable_btrace (ptid_t ptid,
     {
       tinfo = linux_enable_btrace (ptid, conf);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ERROR &exception)
+  catch (const struct gdb_exception_error &exception)
     {
       error (_("Could not enable branch tracing for %s: %s"),
 	     target_pid_to_str (ptid), exception.message.c_str ());
diff --git a/gdb/xml-support.c b/gdb/xml-support.c
index 97cafa623d7..e6dfe8e07c4 100644
--- a/gdb/xml-support.c
+++ b/gdb/xml-support.c
@@ -387,7 +387,7 @@ gdb_xml_start_element_wrapper (void *data, const XML_Char *name,
     {
       parser->start_element (name, attrs);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       parser->set_error (ex);
     }
@@ -459,7 +459,7 @@ gdb_xml_end_element_wrapper (void *data, const XML_Char *name)
     {
       parser->end_element (name);
     }
-  catch (const struct gdb_exception_RETURN_MASK_ALL &ex)
+  catch (const struct gdb_exception &ex)
     {
       parser->set_error (ex);
     }
-- 
2.17.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]