Rewrite TRY/CATCH
authorTom Tromey <tom@tromey.com>
Wed, 3 Apr 2019 22:02:42 +0000 (16:02 -0600)
committerTom Tromey <tom@tromey.com>
Mon, 8 Apr 2019 15:05:39 +0000 (09:05 -0600)
This rewrites gdb's TRY/CATCH to plain C++ try/catch.  The patch was
largely written by script, though one change (to a comment in
common-exceptions.h) was reverted by hand.

gdb/ChangeLog
2019-04-08  Tom Tromey  <tom@tromey.com>

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

gdb/gdbserver/ChangeLog
2019-04-08  Tom Tromey  <tom@tromey.com>

* server.c: Use C++ exception handling.
* linux-low.c: Use C++ exception handling.
* gdbreplay.c: Use C++ exception handling.

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

index fb579b955bc0204e9578cc249ccf8cc5441a570d..19ae18a228adc37791cfcf9478a6a03a1695269f 100644 (file)
@@ -1,3 +1,146 @@
+2019-04-08  Tom Tromey  <tom@tromey.com>
+
+       * xml-support.c: Use C++ exception handling.
+       * x86-linux-nat.c: Use C++ exception handling.
+       * windows-nat.c: Use C++ exception handling.
+       * varobj.c: Use C++ exception handling.
+       * value.c: Use C++ exception handling.
+       * valprint.c: Use C++ exception handling.
+       * valops.c: Use C++ exception handling.
+       * unittests/parse-connection-spec-selftests.c: Use C++ exception
+       handling.
+       * unittests/cli-utils-selftests.c: Use C++ exception handling.
+       * typeprint.c: Use C++ exception handling.
+       * tui/tui.c: Use C++ exception handling.
+       * tracefile-tfile.c: Use C++ exception handling.
+       * top.c: Use C++ exception handling.
+       * thread.c: Use C++ exception handling.
+       * target.c: Use C++ exception handling.
+       * symmisc.c: Use C++ exception handling.
+       * symfile-mem.c: Use C++ exception handling.
+       * stack.c: Use C++ exception handling.
+       * sparc64-linux-tdep.c: Use C++ exception handling.
+       * solib.c: Use C++ exception handling.
+       * solib-svr4.c: Use C++ exception handling.
+       * solib-spu.c: Use C++ exception handling.
+       * solib-frv.c: Use C++ exception handling.
+       * solib-dsbt.c: Use C++ exception handling.
+       * selftest-arch.c: Use C++ exception handling.
+       * s390-tdep.c: Use C++ exception handling.
+       * rust-lang.c: Use C++ exception handling.
+       * rust-exp.y: Use C++ exception handling.
+       * rs6000-tdep.c: Use C++ exception handling.
+       * rs6000-aix-tdep.c: Use C++ exception handling.
+       * riscv-tdep.c: Use C++ exception handling.
+       * remote.c: Use C++ exception handling.
+       * remote-fileio.c: Use C++ exception handling.
+       * record-full.c: Use C++ exception handling.
+       * record-btrace.c: Use C++ exception handling.
+       * python/python.c: Use C++ exception handling.
+       * python/py-value.c: Use C++ exception handling.
+       * python/py-utils.c: Use C++ exception handling.
+       * python/py-unwind.c: Use C++ exception handling.
+       * python/py-type.c: Use C++ exception handling.
+       * python/py-symbol.c: Use C++ exception handling.
+       * python/py-record.c: Use C++ exception handling.
+       * python/py-record-btrace.c: Use C++ exception handling.
+       * python/py-progspace.c: Use C++ exception handling.
+       * python/py-prettyprint.c: Use C++ exception handling.
+       * python/py-param.c: Use C++ exception handling.
+       * python/py-objfile.c: Use C++ exception handling.
+       * python/py-linetable.c: Use C++ exception handling.
+       * python/py-lazy-string.c: Use C++ exception handling.
+       * python/py-infthread.c: Use C++ exception handling.
+       * python/py-inferior.c: Use C++ exception handling.
+       * python/py-gdb-readline.c: Use C++ exception handling.
+       * python/py-framefilter.c: Use C++ exception handling.
+       * python/py-frame.c: Use C++ exception handling.
+       * python/py-finishbreakpoint.c: Use C++ exception handling.
+       * python/py-cmd.c: Use C++ exception handling.
+       * python/py-breakpoint.c: Use C++ exception handling.
+       * python/py-arch.c: Use C++ exception handling.
+       * printcmd.c: Use C++ exception handling.
+       * ppc-linux-tdep.c: Use C++ exception handling.
+       * parse.c: Use C++ exception handling.
+       * p-valprint.c: Use C++ exception handling.
+       * objc-lang.c: Use C++ exception handling.
+       * mi/mi-main.c: Use C++ exception handling.
+       * mi/mi-interp.c: Use C++ exception handling.
+       * mi/mi-cmd-stack.c: Use C++ exception handling.
+       * mi/mi-cmd-break.c: Use C++ exception handling.
+       * main.c: Use C++ exception handling.
+       * linux-thread-db.c: Use C++ exception handling.
+       * linux-tdep.c: Use C++ exception handling.
+       * linux-nat.c: Use C++ exception handling.
+       * linux-fork.c: Use C++ exception handling.
+       * linespec.c: Use C++ exception handling.
+       * language.c: Use C++ exception handling.
+       * jit.c: Use C++ exception handling.
+       * infrun.c: Use C++ exception handling.
+       * infcmd.c: Use C++ exception handling.
+       * infcall.c: Use C++ exception handling.
+       * inf-loop.c: Use C++ exception handling.
+       * i386-tdep.c: Use C++ exception handling.
+       * i386-linux-tdep.c: Use C++ exception handling.
+       * guile/scm-value.c: Use C++ exception handling.
+       * guile/scm-type.c: Use C++ exception handling.
+       * guile/scm-symtab.c: Use C++ exception handling.
+       * guile/scm-symbol.c: Use C++ exception handling.
+       * guile/scm-pretty-print.c: Use C++ exception handling.
+       * guile/scm-ports.c: Use C++ exception handling.
+       * guile/scm-param.c: Use C++ exception handling.
+       * guile/scm-math.c: Use C++ exception handling.
+       * guile/scm-lazy-string.c: Use C++ exception handling.
+       * guile/scm-frame.c: Use C++ exception handling.
+       * guile/scm-disasm.c: Use C++ exception handling.
+       * guile/scm-cmd.c: Use C++ exception handling.
+       * guile/scm-breakpoint.c: Use C++ exception handling.
+       * guile/scm-block.c: Use C++ exception handling.
+       * guile/guile-internal.h: Use C++ exception handling.
+       * gnu-v3-abi.c: Use C++ exception handling.
+       * gdbtypes.c: Use C++ exception handling.
+       * frame.c: Use C++ exception handling.
+       * frame-unwind.c: Use C++ exception handling.
+       * fbsd-tdep.c: Use C++ exception handling.
+       * f-valprint.c: Use C++ exception handling.
+       * exec.c: Use C++ exception handling.
+       * event-top.c: Use C++ exception handling.
+       * event-loop.c: Use C++ exception handling.
+       * eval.c: Use C++ exception handling.
+       * dwarf2read.c: Use C++ exception handling.
+       * dwarf2loc.c: Use C++ exception handling.
+       * dwarf2-frame.c: Use C++ exception handling.
+       * dwarf2-frame-tailcall.c: Use C++ exception handling.
+       * dwarf-index-write.c: Use C++ exception handling.
+       * dwarf-index-cache.c: Use C++ exception handling.
+       * dtrace-probe.c: Use C++ exception handling.
+       * disasm-selftests.c: Use C++ exception handling.
+       * darwin-nat.c: Use C++ exception handling.
+       * cp-valprint.c: Use C++ exception handling.
+       * cp-support.c: Use C++ exception handling.
+       * cp-abi.c: Use C++ exception handling.
+       * corelow.c: Use C++ exception handling.
+       * completer.c: Use C++ exception handling.
+       * compile/compile-object-run.c: Use C++ exception handling.
+       * compile/compile-object-load.c: Use C++ exception handling.
+       * compile/compile-cplus-symbols.c: Use C++ exception handling.
+       * compile/compile-c-symbols.c: Use C++ exception handling.
+       * common/selftest.c: Use C++ exception handling.
+       * common/new-op.c: Use C++ exception handling.
+       * cli/cli-script.c: Use C++ exception handling.
+       * cli/cli-interp.c: Use C++ exception handling.
+       * cli/cli-cmds.c: Use C++ exception handling.
+       * c-varobj.c: Use C++ exception handling.
+       * btrace.c: Use C++ exception handling.
+       * breakpoint.c: Use C++ exception handling.
+       * break-catch-throw.c: Use C++ exception handling.
+       * arch-utils.c: Use C++ exception handling.
+       * amd64-tdep.c: Use C++ exception handling.
+       * ada-valprint.c: Use C++ exception handling.
+       * ada-typeprint.c: Use C++ exception handling.
+       * ada-lang.c: Use C++ exception handling.
+       * aarch64-tdep.c: Use C++ exception handling.
+
 2019-04-08  Tom Tromey  <tom@tromey.com>
 
        * xml-support.c (gdb_xml_parser::parse): Update.
index 68b6549ba9b2a421fc29ede97454cd6c0640ec29..bd04a67247904ca8c9f92d7e566a2fce14019471 100644 (file)
@@ -874,16 +874,15 @@ aarch64_make_prologue_cache (struct frame_info *this_frame, void **this_cache)
   cache->saved_regs = trad_frame_alloc_saved_regs (this_frame);
   *this_cache = cache;
 
-  TRY
+  try
     {
       aarch64_make_prologue_cache_1 (this_frame, cache);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
        throw_exception (ex);
     }
-  END_CATCH
 
   return cache;
 }
@@ -1006,19 +1005,18 @@ aarch64_make_stub_cache (struct frame_info *this_frame, void **this_cache)
   cache->saved_regs = trad_frame_alloc_saved_regs (this_frame);
   *this_cache = cache;
 
-  TRY
+  try
     {
       cache->prev_sp = get_frame_register_unsigned (this_frame,
                                                    AARCH64_SP_REGNUM);
       cache->prev_pc = get_frame_pc (this_frame);
       cache->available_p = 1;
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
        throw_exception (ex);
     }
-  END_CATCH
 
   return cache;
 }
index 19cc22d306e149a7302d8d3a59c2e51326765ab1..4b51ef1939a7dd40d7f80dcd481b4e9e358d1766 100644 (file)
@@ -6723,16 +6723,15 @@ ada_tag_value_at_base_address (struct value *obj)
      see ada_tag_name for more details.  We do not print the error
      message for the same reason.  */
 
-  TRY
+  try
     {
       offset_to_top = value_as_long (value_ind (value_ptradd (val, -2)));
     }
 
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       return obj;
     }
-  END_CATCH
 
   /* If offset is null, nothing to do.  */
 
@@ -6869,17 +6868,16 @@ ada_tag_name (struct value *tag)
      We also do not print the error message either (which often is very
      low-level (Eg: "Cannot read memory at 0x[...]"), but instead let
      the caller print a more meaningful message if necessary.  */
-  TRY
+  try
     {
       struct value *tsd = ada_get_tsd_from_tag (tag);
 
       if (tsd != NULL)
        name = ada_tag_name_from_tsd (tsd);
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
     }
-  END_CATCH
 
   return name;
 }
@@ -9054,11 +9052,11 @@ ada_to_fixed_type_1 (struct type *type, const gdb_byte *valaddr,
             LONGEST size;
 
             xsnprintf (xvz_name, strlen (name) + 7, "%s___XVZ", name);
-           TRY
+           try
              {
                xvz_found = get_int_var_value (xvz_name, size);
              }
-           CATCH (except, RETURN_MASK_ERROR)
+           catch (const gdb_exception_RETURN_MASK_ERROR &except)
              {
                /* We found the variable, but somehow failed to read
                   its value.  Rethrow the same error, but with a little
@@ -9069,7 +9067,6 @@ ada_to_fixed_type_1 (struct type *type, const gdb_byte *valaddr,
                             _("unable to read value of %s (%s)"),
                             xvz_name, except.what ());
              }
-           END_CATCH
 
             if (xvz_found && TYPE_LENGTH (fixed_record_type) != size)
               {
@@ -12346,15 +12343,14 @@ ada_exception_message (void)
 {
   gdb::unique_xmalloc_ptr<char> e_msg;
 
-  TRY
+  try
     {
       e_msg = ada_exception_message_1 ();
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       e_msg.reset (nullptr);
     }
-  END_CATCH
 
   return e_msg;
 }
@@ -12370,17 +12366,16 @@ ada_exception_name_addr (enum ada_exception_catchpoint_kind ex,
 {
   CORE_ADDR result = 0;
 
-  TRY
+  try
     {
       result = ada_exception_name_addr_1 (ex, b);
     }
 
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       warning (_("failed to get exception name: %s"), e.what ());
       return 0;
     }
-  END_CATCH
 
   return result;
 }
@@ -12461,19 +12456,18 @@ create_excep_cond_exprs (struct ada_catchpoint *c,
          const char *s;
 
          s = cond_string.c_str ();
-         TRY
+         try
            {
              exp = parse_exp_1 (&s, bl->address,
                                 block_for_pc (bl->address),
                                 0);
            }
-         CATCH (e, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &e)
            {
              warning (_("failed to reevaluate internal exception condition "
                         "for catchpoint %d: %s"),
                       c->number, e.what ());
            }
-         END_CATCH
        }
 
       ada_loc->excep_cond_expr = std::move (exp);
@@ -12531,7 +12525,7 @@ should_stop_exception (const struct bp_location *bl)
     }
 
   stop = 1;
-  TRY
+  try
     {
       struct value *mark;
 
@@ -12539,12 +12533,11 @@ 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 (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       exception_fprintf (gdb_stderr, ex,
                         _("Error in testing exception condition:\n"));
     }
-  END_CATCH
 
   return stop;
 }
index efcd14bedc57952be228e6f0853c071f590935e6..8b71524cd12c5669f587e82c33ad59f09c5553b5 100644 (file)
@@ -163,12 +163,12 @@ print_range (struct type *type, struct ui_file *stream,
        LONGEST lo = 0, hi = 0; /* init for gcc -Wall */
        int got_error = 0;
 
-       TRY
+       try
          {
            lo = ada_discrete_type_low_bound (type);
            hi = ada_discrete_type_high_bound (type);
          }
-       CATCH (e, RETURN_MASK_ERROR)
+       catch (const gdb_exception_RETURN_MASK_ERROR &e)
          {
            /* This can happen when the range is dynamic.  Sometimes,
               resolving dynamic property values requires us to have
@@ -178,7 +178,6 @@ print_range (struct type *type, struct ui_file *stream,
            fprintf_filtered (stream, "<>");
            got_error = 1;
          }
-       END_CATCH
 
        if (!got_error)
          {
index ac963a67561783fc10b0f61a96173d7106f5f217..5349e93dd0251a0943a2ff7df41294780dc823ae 100644 (file)
@@ -1203,18 +1203,17 @@ ada_val_print (struct type *type,
               struct value *val,
               const struct value_print_options *options)
 {
-  TRY
+  try
     {
       ada_val_print_1 (type, embedded_offset, address,
                       stream, recurse, val, options,
                       current_language);
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       fprintf_filtered (stream, _("<error reading variable: %s>"),
                        except.what ());
     }
-  END_CATCH
 }
 
 void
index d5892954d74e24bfdf558f7c74d8698e92bc52f4..dca3c4fbb4402cd40854d06d14badfb3c955c072 100644 (file)
@@ -2581,16 +2581,15 @@ amd64_frame_cache (struct frame_info *this_frame, void **this_cache)
   cache = amd64_alloc_frame_cache ();
   *this_cache = cache;
 
-  TRY
+  try
     {
       amd64_frame_cache_1 (this_frame, cache);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
        throw_exception (ex);
     }
-  END_CATCH
 
   return cache;
 }
@@ -2699,7 +2698,7 @@ amd64_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
 
   cache = amd64_alloc_frame_cache ();
 
-  TRY
+  try
     {
       get_frame_register (this_frame, AMD64_RSP_REGNUM, buf);
       cache->base = extract_unsigned_integer (buf, 8, byte_order) - 8;
@@ -2713,12 +2712,11 @@ amd64_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
 
       cache->base_p = 1;
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
        throw_exception (ex);
     }
-  END_CATCH
 
   *this_cache = cache;
   return cache;
@@ -2876,7 +2874,7 @@ amd64_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
   cache = amd64_alloc_frame_cache ();
   *this_cache = cache;
 
-  TRY
+  try
     {
       /* Cache base will be %esp plus cache->sp_offset (-8).  */
       get_frame_register (this_frame, AMD64_RSP_REGNUM, buf);
@@ -2894,12 +2892,11 @@ amd64_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
 
       cache->base_p = 1;
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
        throw_exception (ex);
     }
-  END_CATCH
 
   return cache;
 }
index 52a08daa3b9aa266046d1ae7335c71829664c04d..7623aacc8d13c5e6ea1a8d48dd600930eb651d43 100644 (file)
@@ -969,13 +969,12 @@ gdbarch_skip_prologue_noexcept (gdbarch *gdbarch, CORE_ADDR pc) noexcept
 {
   CORE_ADDR new_pc = pc;
 
-  TRY
+  try
     {
       new_pc = gdbarch_skip_prologue (gdbarch, pc);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {}
-  END_CATCH
 
   return new_pc;
 }
index c8d66e0737c5329fa4a7afe0aef1e8bd3eb80d7b..f9f468478d80ad3d66c66bcb9dc294395eaf1495 100644 (file)
@@ -154,7 +154,7 @@ check_status_exception_catchpoint (struct bpstats *bs)
   if (self->pattern == NULL)
     return;
 
-  TRY
+  try
     {
       struct value *typeinfo_arg;
       std::string canon;
@@ -166,11 +166,10 @@ check_status_exception_catchpoint (struct bpstats *bs)
       if (!canon.empty ())
        std::swap (type_name, canon);
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       exception_print (gdb_stderr, e);
     }
-  END_CATCH
 
   if (!type_name.empty ())
     {
@@ -189,17 +188,17 @@ re_set_exception_catchpoint (struct breakpoint *self)
   struct program_space *filter_pspace = current_program_space;
 
   /* We first try to use the probe interface.  */
-  TRY
+  try
     {
       event_location_up location
        = new_probe_location (exception_functions[kind].probe);
       sals = parse_probes (location.get (), filter_pspace, NULL);
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       /* Using the probe interface failed.  Let's fallback to the normal
         catchpoint mode.  */
-      TRY
+      try
        {
          struct explicit_location explicit_loc;
 
@@ -210,16 +209,14 @@ re_set_exception_catchpoint (struct breakpoint *self)
          sals = self->ops->decode_location (self, location.get (),
                                             filter_pspace);
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          /* NOT_FOUND_ERROR just means the breakpoint will be
             pending, so let it through.  */
          if (ex.error != NOT_FOUND_ERROR)
            throw_exception (ex);
        }
-      END_CATCH
     }
-  END_CATCH
 
   update_breakpoint_locations (self, filter_pspace, sals, {});
 }
index 6e835a5f6bc6ef6d669d945a1cf5ce21b9d4f922..8dfbb113a32ff22cb1b06103cb0cb44799112208 100644 (file)
@@ -2097,18 +2097,17 @@ parse_cond_to_aexpr (CORE_ADDR scope, struct expression *cond)
 
   /* We don't want to stop processing, so catch any errors
      that may show up.  */
-  TRY
+  try
     {
       aexpr = gen_eval_for_expr (scope, cond);
     }
 
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_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.
         It's no use iterating through the conditions.  */
     }
-  END_CATCH
 
   /* We have a valid agent expression.  */
   return aexpr;
@@ -2272,19 +2271,18 @@ parse_cmd_to_aexpr (CORE_ADDR scope, char *cmd)
 
   /* We don't want to stop processing, so catch any errors
      that may show up.  */
-  TRY
+  try
     {
       aexpr = gen_printf (scope, gdbarch, 0, 0,
                          format_start, format_end - format_start,
                          argvec.size (), argvec.data ());
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_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.
         It's no use iterating through the other commands.  */
     }
-  END_CATCH
 
   /* We have a valid agent expression, return it.  */
   return aexpr;
@@ -2539,7 +2537,7 @@ insert_bp_location (struct bp_location *bl,
          || !(section_is_overlay (bl->section)))
        {
          /* No overlay handling: just set the breakpoint.  */
-         TRY
+         try
            {
              int val;
 
@@ -2547,11 +2545,10 @@ insert_bp_location (struct bp_location *bl,
              if (val)
                bp_excpt = gdb_exception {RETURN_ERROR, GENERIC_ERROR};
            }
-         CATCH (e, RETURN_MASK_ALL)
+         catch (const gdb_exception_RETURN_MASK_ALL &e)
            {
              bp_excpt = e;
            }
-         END_CATCH
        }
       else
        {
@@ -2574,7 +2571,7 @@ insert_bp_location (struct bp_location *bl,
                  bl->overlay_target_info.reqstd_address = addr;
 
                  /* No overlay handling: just set the breakpoint.  */
-                 TRY
+                 try
                    {
                      int val;
 
@@ -2587,11 +2584,10 @@ insert_bp_location (struct bp_location *bl,
                        bp_excpt
                          = gdb_exception {RETURN_ERROR, GENERIC_ERROR};
                    }
-                 CATCH (e, RETURN_MASK_ALL)
+                 catch (const gdb_exception_RETURN_MASK_ALL &e)
                    {
                      bp_excpt = e;
                    }
-                 END_CATCH
 
                  if (bp_excpt.reason != 0)
                    fprintf_unfiltered (tmp_error_stream,
@@ -2604,7 +2600,7 @@ insert_bp_location (struct bp_location *bl,
          if (section_is_mapped (bl->section))
            {
              /* Yes.  This overlay section is mapped into memory.  */
-             TRY
+             try
                {
                  int val;
 
@@ -2612,11 +2608,10 @@ insert_bp_location (struct bp_location *bl,
                  if (val)
                    bp_excpt = gdb_exception {RETURN_ERROR, GENERIC_ERROR};
                }
-             CATCH (e, RETURN_MASK_ALL)
+             catch (const gdb_exception_RETURN_MASK_ALL &e)
                {
                  bp_excpt = e;
                }
-             END_CATCH
            }
          else
            {
@@ -5017,11 +5012,11 @@ bpstat_check_watchpoint (bpstat bs)
        {
          wp_check_result e;
 
-         TRY
+         try
            {
              e = watchpoint_check (bs);
            }
-         CATCH (ex, RETURN_MASK_ALL)
+         catch (const gdb_exception_RETURN_MASK_ALL &ex)
            {
              exception_fprintf (gdb_stderr, ex,
                                 "Error evaluating expression "
@@ -5036,7 +5031,6 @@ bpstat_check_watchpoint (bpstat bs)
              watchpoint_del_at_next_stop (b);
              e = WP_DELETED;
            }
-         END_CATCH
 
          switch (e)
            {
@@ -5255,16 +5249,15 @@ bpstat_check_breakpoint_conditions (bpstat bs, thread_info *thread)
        }
       if (within_current_scope)
        {
-         TRY
+         try
            {
              condition_result = breakpoint_cond_eval (cond);
            }
-         CATCH (ex, RETURN_MASK_ALL)
+         catch (const gdb_exception_RETURN_MASK_ALL &ex)
            {
              exception_fprintf (gdb_stderr, ex,
                                 "Error in testing breakpoint condition:\n");
            }
-         END_CATCH
        }
       else
        {
@@ -9246,11 +9239,11 @@ create_breakpoint (struct gdbarch *gdbarch,
   if (extra_string != NULL && *extra_string == '\0')
     extra_string = NULL;
 
-  TRY
+  try
     {
       ops->create_sals_from_location (location, &canonical, type_wanted);
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       /* If caller is interested in rc value from parse, set
         value.  */
@@ -9280,7 +9273,6 @@ create_breakpoint (struct gdbarch *gdbarch,
       else
        throw_exception (e);
     }
-  END_CATCH
 
   if (!pending && canonical.lsals.empty ())
     return 0;
@@ -12060,14 +12052,13 @@ static void
 update_global_location_list_nothrow (enum ugll_insert_mode insert_mode)
 {
 
-  TRY
+  try
     {
       update_global_location_list (insert_mode);
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
     }
-  END_CATCH
 }
 
 /* Clear BKP from a BPS.  */
@@ -13529,20 +13520,19 @@ update_breakpoint_locations (struct breakpoint *b,
          const char *s;
 
          s = b->cond_string;
-         TRY
+         try
            {
              new_loc->cond = parse_exp_1 (&s, sal.pc,
                                           block_for_pc (sal.pc),
                                           0);
            }
-         CATCH (e, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &e)
            {
              warning (_("failed to reevaluate condition "
                         "for breakpoint %d: %s"), 
                       b->number, e.what ());
              new_loc->enabled = 0;
            }
-         END_CATCH
        }
 
       if (!sals_end.empty ())
@@ -13609,11 +13599,11 @@ location_to_sals (struct breakpoint *b, struct event_location *location,
 
   std::vector<symtab_and_line> sals;
 
-  TRY
+  try
     {
       sals = b->ops->decode_location (b, location, search_pspace);
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       int not_found_and_ok = 0;
 
@@ -13648,7 +13638,6 @@ location_to_sals (struct breakpoint *b, struct event_location *location,
          throw_exception (e);
        }
     }
-  END_CATCH
 
   if (exception.reason == 0 || exception.error != NOT_FOUND_ERROR)
     {
@@ -13820,17 +13809,16 @@ breakpoint_re_set (void)
 
     ALL_BREAKPOINTS_SAFE (b, b_tmp)
       {
-       TRY
+       try
          {
            breakpoint_re_set_one (b);
          }
-       CATCH (ex, RETURN_MASK_ALL)
+       catch (const gdb_exception_RETURN_MASK_ALL &ex)
          {
            exception_fprintf (gdb_stderr, ex,
                               "Error in re-setting breakpoint %d: ",
                               b->number);
          }
-       END_CATCH
       }
 
     jit_breakpoint_re_set ();
@@ -14297,7 +14285,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition,
       /* Initialize it just to avoid a GCC false warning.  */
       enum enable_state orig_enable_state = bp_disabled;
 
-      TRY
+      try
        {
          struct watchpoint *w = (struct watchpoint *) bpt;
 
@@ -14305,14 +14293,13 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition,
          bpt->enable_state = bp_enabled;
          update_watchpoint (w, 1 /* reparse */);
        }
-      CATCH (e, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &e)
        {
          bpt->enable_state = orig_enable_state;
          exception_fprintf (gdb_stderr, e, _("Cannot enable watchpoint %d: "),
                             bpt->number);
          return;
        }
-      END_CATCH
     }
 
   bpt->enable_state = bp_enabled;
@@ -15040,16 +15027,15 @@ save_breakpoints (const char *filename, int from_tty,
        fp.puts ("  commands\n");
        
        current_uiout->redirect (&fp);
-       TRY
+       try
          {
            print_command_lines (current_uiout, tp->commands.get (), 2);
          }
-       CATCH (ex, RETURN_MASK_ALL)
+       catch (const gdb_exception_RETURN_MASK_ALL &ex)
          {
          current_uiout->redirect (NULL);
            throw_exception (ex);
          }
-       END_CATCH
 
        current_uiout->redirect (NULL);
        fp.puts ("  end\n");
index 12af46814a9db0586d8e1109574528f6cf610576..3bfd1c84e1bb360ae9fc4aeccb3672e4fa1182c9 100644 (file)
@@ -678,7 +678,7 @@ ftrace_classify_insn (struct gdbarch *gdbarch, CORE_ADDR pc)
   enum btrace_insn_class iclass;
 
   iclass = BTRACE_INSN_OTHER;
-  TRY
+  try
     {
       if (gdbarch_insn_is_call (gdbarch, pc))
        iclass = BTRACE_INSN_CALL;
@@ -687,10 +687,9 @@ ftrace_classify_insn (struct gdbarch *gdbarch, CORE_ADDR pc)
       else if (gdbarch_insn_is_jump (gdbarch, pc))
        iclass = BTRACE_INSN_JUMP;
     }
-  CATCH (error, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &error)
     {
     }
-  END_CATCH
 
   return iclass;
 }
@@ -1103,14 +1102,13 @@ btrace_compute_ftrace_bts (struct thread_info *tp,
            level = std::min (level, bfun->level);
 
          size = 0;
-         TRY
+         try
            {
              size = gdb_insn_length (gdbarch, pc);
            }
-         CATCH (error, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &error)
            {
            }
-         END_CATCH
 
          insn.pc = pc;
          insn.size = size;
@@ -1370,17 +1368,16 @@ btrace_pt_readmem_callback (gdb_byte *buffer, size_t size,
   int result, errcode;
 
   result = (int) size;
-  TRY
+  try
     {
       errcode = target_read_code ((CORE_ADDR) pc, buffer, size);
       if (errcode != 0)
        result = -pte_nomap;
     }
-  CATCH (error, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &error)
     {
       result = -pte_nomap;
     }
-  END_CATCH
 
   return result;
 }
@@ -1464,7 +1461,7 @@ btrace_compute_ftrace_pt (struct thread_info *tp,
   if (decoder == NULL)
     error (_("Failed to allocate the Intel Processor Trace decoder."));
 
-  TRY
+  try
     {
       struct pt_image *image;
 
@@ -1479,7 +1476,7 @@ btrace_compute_ftrace_pt (struct thread_info *tp,
 
       ftrace_add_pt (btinfo, decoder, &level, gaps);
     }
-  CATCH (error, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &error)
     {
       /* Indicate a gap in the trace if we quit trace processing.  */
       if (error.reason == RETURN_QUIT && !btinfo->functions.empty ())
@@ -1489,7 +1486,6 @@ btrace_compute_ftrace_pt (struct thread_info *tp,
 
       throw_exception (error);
     }
-  END_CATCH
 
   btrace_finalize_ftrace_pt (decoder, tp, level);
 }
@@ -1556,17 +1552,16 @@ btrace_compute_ftrace (struct thread_info *tp, struct btrace_data *btrace,
 {
   std::vector<unsigned int> gaps;
 
-  TRY
+  try
     {
       btrace_compute_ftrace_1 (tp, btrace, cpu, gaps);
     }
-  CATCH (error, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &error)
     {
       btrace_finalize_ftrace (tp, gaps);
 
       throw_exception (error);
     }
-  END_CATCH
 
   btrace_finalize_ftrace (tp, gaps);
 }
@@ -1617,7 +1612,7 @@ btrace_enable (struct thread_info *tp, const struct btrace_config *conf)
     return;
 
   /* We need to undo the enable in case of errors.  */
-  TRY
+  try
     {
       /* Add an entry for the current PC so we start tracing from where we
         enabled it.
@@ -1632,13 +1627,12 @@ btrace_enable (struct thread_info *tp, const struct btrace_config *conf)
          && can_access_registers_thread (tp))
        btrace_add_pc (tp);
     }
-  CATCH (exception, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &exception)
     {
       btrace_disable (tp);
 
       throw_exception (exception);
     }
-  END_CATCH
 }
 
 /* See btrace.h.  */
@@ -3062,18 +3056,17 @@ btrace_maint_update_pt_packets (struct btrace_thread_info *btinfo)
   if (decoder == NULL)
     error (_("Failed to allocate the Intel Processor Trace decoder."));
 
-  TRY
+  try
     {
       btrace_maint_decode_pt (&btinfo->maint, decoder);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       pt_pkt_free_decoder (decoder);
 
       if (except.reason < 0)
        throw_exception (except);
     }
-  END_CATCH
 
   pt_pkt_free_decoder (decoder);
 }
index 2d247745c04ae474bbf111e227e47c0f9d86d79a..36290dda2e23928337197074759ca7b19489d0d3 100644 (file)
@@ -92,16 +92,15 @@ adjust_value_for_child_access (struct value **value,
          if (value && *value)
            {
 
-             TRY
+             try
                {
                  *value = value_ind (*value);
                }
 
-             CATCH (except, RETURN_MASK_ERROR)
+             catch (const gdb_exception_RETURN_MASK_ERROR &except)
                {
                  *value = NULL;
                }
-             END_CATCH
            }
          *type = target_type;
          if (was_ptr)
@@ -253,18 +252,17 @@ value_struct_element_index (struct value *value, int type_index)
   gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
              || TYPE_CODE (type) == TYPE_CODE_UNION);
 
-  TRY
+  try
     {
       if (field_is_static (&TYPE_FIELD (type, type_index)))
        result = value_static_field (type, type_index);
       else
        result = value_primitive_field (value, 0, type_index, type);
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       return NULL;
     }
-  END_CATCH
 
   return result;
 }
@@ -316,14 +314,13 @@ c_describe_child (const struct varobj *parent, int index,
        {
          int real_index = index + TYPE_LOW_BOUND (TYPE_INDEX_TYPE (type));
 
-         TRY
+         try
            {
              *cvalue = value_subscript (value, real_index);
            }
-         CATCH (except, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &except)
            {
            }
-         END_CATCH
        }
 
       if (ctype)
@@ -393,16 +390,15 @@ c_describe_child (const struct varobj *parent, int index,
 
       if (cvalue && value)
        {
-         TRY
+         try
            {
              *cvalue = value_ind (value);
            }
 
-         CATCH (except, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &except)
            {
              *cvalue = NULL;
            }
-         END_CATCH
        }
 
       /* Don't use get_target_type because it calls
index 5dc94a5361af9a15131159ac48452cc036a0b40b..1dc82b3a875ec7a28969b96579a4ad9ac504015d 100644 (file)
@@ -250,7 +250,7 @@ complete_command (const char *arg, int from_tty)
   int quote_char = '\0';
   const char *word;
 
-  TRY
+  try
     {
       word = completion_find_completion_word (tracker_handle_brkchars,
                                              arg, &quote_char);
@@ -267,11 +267,10 @@ complete_command (const char *arg, int from_tty)
          tracker = &tracker_handle_completions;
        }
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       return;
     }
-  END_CATCH
 
   std::string arg_prefix (arg, word - arg);
 
index 088f4f1f89c0f870b9de5c7629002b01907691a0..c8cc1b4657c98528a53510d2af4fe9e8e0cc4f44 100644 (file)
@@ -363,15 +363,14 @@ safe_execute_command (struct ui_out *command_uiout, const char *command,
   scoped_restore saved_uiout = make_scoped_restore (&current_uiout,
                                                    command_uiout);
 
-  TRY
+  try
     {
       execute_command (command, from_tty);
     }
-  CATCH (exception, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &exception)
     {
       e = exception;
     }
-  END_CATCH
 
   /* FIXME: cagney/2005-01-13: This shouldn't be needed.  Instead the
      caller should print the exception.  */
index f558c06f830abaeabe16141d162397ae39446011..49645537fe32e00b318995f88c24ee5961423535 100644 (file)
@@ -1050,16 +1050,15 @@ process_next_line (const char *p, struct command_line **command,
 
   if (validator)
     {
-      TRY
+      try
        {
          validator ((*command)->line);
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
          free_command_lines (command);
          throw_exception (ex);
        }
-      END_CATCH
     }
 
   /* Nothing special.  */
@@ -1540,11 +1539,11 @@ script_from_file (FILE *stream, const char *file)
 
   scoped_restore save_async = make_scoped_restore (&current_ui->async, 0);
 
-  TRY
+  try
     {
       read_command_file (stream);
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       /* Re-throw the error, but with the file name information
         prepended.  */
@@ -1553,7 +1552,6 @@ script_from_file (FILE *stream, const char *file)
                   source_file_name.c_str (), source_line_number,
                   e.what ());
     }
-  END_CATCH
 }
 
 /* Print the definition of user command C to STREAM.  Or, if C is a
index cff6686ef12d4c523edf54bf46dc3815ce0f9bb2..c358b802fa4b1e777d73f3d3d73011838ebcbe6b 100644 (file)
@@ -60,15 +60,14 @@ operator new (std::size_t sz)
         QUIT gdb_exception.  This is necessary because operator new
         can only ever throw std::bad_alloc, or something that extends
         it.  */
-      TRY
+      try
        {
          malloc_failure (sz);
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
          throw gdb_quit_bad_alloc (ex);
        }
-      END_CATCH
     }
   return p;
 }
index 1e73708aeeada0e776b66611a47d1a9d4529c88f..3f3ff744a312f569a393cddb6be908cae014e7f3 100644 (file)
@@ -81,18 +81,17 @@ run_tests (const char *filter)
          && name.find (filter) == std::string::npos)
        continue;
 
-      TRY
+      try
        {
          debug_printf (_("Running selftest %s.\n"), name.c_str ());
          ++ran;
          (*test) ();
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          ++failed;
          debug_printf ("Self test failed: %s\n", ex.what ());
        }
-      END_CATCH
 
       reset ();
     }
index 10d9ada46127b0d10561280dd3b2bf07920fc92f..7e76db33d76023f4673c2b8a33dbeb859c870f97 100644 (file)
@@ -344,7 +344,7 @@ gcc_convert_symbol (void *datum,
 
   /* We can't allow exceptions to escape out of this callback.  Safest
      is to simply emit a gcc error.  */
-  TRY
+  try
     {
       struct block_symbol sym;
 
@@ -367,11 +367,10 @@ gcc_convert_symbol (void *datum,
        }
     }
 
-  CATCH (e, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &e)
     {
       context->plugin ().error (e.what ());
     }
-  END_CATCH
 
   if (compile_debug && !found)
     fprintf_unfiltered (gdb_stdlog,
@@ -393,7 +392,7 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
 
   /* We can't allow exceptions to escape out of this callback.  Safest
      is to simply emit a gcc error.  */
-  TRY
+  try
     {
       struct symbol *sym;
 
@@ -430,11 +429,10 @@ gcc_symbol_address (void *datum, struct gcc_c_context *gcc_context,
        }
     }
 
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       context->plugin ().error (e.what ());
     }
-  END_CATCH
 
   if (compile_debug && !found)
     fprintf_unfiltered (gdb_stdlog,
@@ -548,7 +546,7 @@ generate_c_for_for_one_variable (compile_instance *compiler,
                                 struct symbol *sym)
 {
 
-  TRY
+  try
     {
       if (is_dynamic_type (SYMBOL_TYPE (sym)))
        {
@@ -600,11 +598,10 @@ generate_c_for_for_one_variable (compile_instance *compiler,
        }
     }
 
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       compiler->insert_symbol_error (sym, e.what ());
     }
-  END_CATCH
 }
 
 /* See compile-c.h.  */
index 4914c7c3c933e5b2dc72837dc59e9189abd6da3e..1bb3a6ffbfdba4c9b6c9f83cefd0800d2a5ffbca 100644 (file)
@@ -343,7 +343,7 @@ gcc_cplus_convert_symbol (void *datum,
   bool found = false;
   compile_cplus_instance *instance = (compile_cplus_instance *) datum;
 
-  TRY
+  try
     {
       /* Symbol searching is a three part process unfortunately.  */
 
@@ -388,13 +388,12 @@ gcc_cplus_convert_symbol (void *datum,
            }
        }
     }
-  CATCH (e, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &e)
     {
       /* We can't allow exceptions to escape out of this callback.  Safest
         is to simply emit a gcc error.  */
       instance->plugin ().error (e.what ());
     }
-  END_CATCH
 
   if (compile_debug && !found)
     fprintf_unfiltered (gdb_stdlog,
@@ -431,7 +430,7 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context,
 
   /* We can't allow exceptions to escape out of this callback.  Safest
      is to simply emit a gcc error.  */
-  TRY
+  try
     {
       struct symbol *sym
        = lookup_symbol (identifier, nullptr, VAR_DOMAIN, nullptr).symbol;
@@ -467,11 +466,10 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_context *gcc_context,
        }
     }
 
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       instance->plugin ().error (e.what ());
     }
-  END_CATCH
 
   if (compile_debug && !found)
     fprintf_unfiltered (gdb_stdlog,
index db8238dc1e1f1048b5264ff0f1384ece2fe3820d..29542e744ee45335df2c79bf1da7e8e0f692db6a 100644 (file)
@@ -50,16 +50,15 @@ munmap_list::~munmap_list ()
 {
   for (auto &item : items)
     {
-      TRY
+      try
        {
          gdbarch_infcall_munmap (target_gdbarch (), item.addr, item.size);
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          /* There's not much the user can do, so just ignore
             this.  */
        }
-      END_CATCH
     }
 }
 
index 82b839336ba21542f772660af2ecf1c76869c244..1c4dd2014f096e9b3dcf3248883ea895455cf697 100644 (file)
@@ -137,7 +137,7 @@ compile_object_run (struct compile_module *module)
   xfree (module);
   module = NULL;
 
-  TRY
+  try
     {
       struct type *func_type = SYMBOL_TYPE (func_sym);
       htab_t copied_types;
@@ -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 (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       /* In the case of DTOR_FOUND or in the case of EXECUTED nothing
         needs to be done.  */
@@ -185,7 +185,6 @@ compile_object_run (struct compile_module *module)
        do_module_cleanup (data, 0);
       throw_exception (ex);
     }
-  END_CATCH
 
   dtor_found = find_dummy_frame_dtor (do_module_cleanup, data);
   gdb_assert (!dtor_found && executed);
index d7cf4fd1203efd5f38ff5b363bdd68882fe84e41..6d87174253c5461a80b57b09462cdd611e6e53b1 100644 (file)
@@ -1021,15 +1021,14 @@ complete_expression (completion_tracker &tracker,
 
   /* Perform a tentative parse of the expression, to see whether a
      field completion is required.  */
-  TRY
+  try
     {
       type = parse_expression_for_completion (text, &fieldname, &code);
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       return;
     }
-  END_CATCH
 
   if (fieldname != nullptr && type)
     {
@@ -1445,16 +1444,15 @@ complete_line_internal (completion_tracker &tracker,
                        const char *line_buffer, int point,
                        complete_line_internal_reason reason)
 {
-  TRY
+  try
     {
       complete_line_internal_1 (tracker, text, line_buffer, point, reason);
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       if (except.error != MAX_COMPLETIONS_REACHED_ERROR)
        throw_exception (except);
     }
-  END_CATCH
 }
 
 /* See completer.h.  */
@@ -1859,17 +1857,16 @@ gdb_completion_word_break_characters ()
   /* New completion starting.  */
   current_completion.aborted = false;
 
-  TRY
+  try
     {
       return gdb_completion_word_break_characters_throw ();
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       /* Set this to that gdb_rl_attempted_completion_function knows
         to abort early.  */
       current_completion.aborted = true;
     }
-  END_CATCH
 
   return NULL;
 }
@@ -2207,14 +2204,13 @@ gdb_rl_attempted_completion_function (const char *text, int start, int end)
   if (current_completion.aborted)
     return NULL;
 
-  TRY
+  try
     {
       return gdb_rl_attempted_completion_function_throw (text, start, end);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
     }
-  END_CATCH
 
   return NULL;
 }
index 7fb42970de4f87ba08c9416ac3065f4186a8de38..a0fab140a149ca5748f2ac410f76accc558c5ee2 100644 (file)
@@ -461,16 +461,15 @@ core_target_open (const char *arg, int from_tty)
      may be a thread_stratum target loaded on top of target core by
      now.  The layer above should claim threads found in the BFD
      sections.  */
-  TRY
+  try
     {
       target_update_thread_list ();
     }
 
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       exception_print (gdb_stderr, except);
     }
-  END_CATCH
 
   p = bfd_core_file_failing_command (core_bfd);
   if (p)
@@ -517,15 +516,14 @@ core_target_open (const char *arg, int from_tty)
      anything about threads.  That is why the test is >= 2.  */
   if (thread_count () >= 2)
     {
-      TRY
+      try
        {
          thread_command (NULL, from_tty);
        }
-      CATCH (except, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &except)
        {
          exception_print (gdb_stderr, except);
        }
-      END_CATCH
     }
 }
 
index b858b19066821b07048f7b03e89cd327f99a000a..f82da4b1636d15344d00b342ba9ca7e43e3cce06 100644 (file)
@@ -73,13 +73,13 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
 
   gdb_assert (current_cp_abi.baseclass_offset != NULL);
 
-  TRY
+  try
     {
       res = (*current_cp_abi.baseclass_offset) (type, index, valaddr,
                                                embedded_offset,
                                                address, val);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
        throw_exception (ex);
@@ -88,7 +88,6 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
                   _("Cannot determine virtual baseclass offset "
                     "of incomplete object"));
     }
-  END_CATCH
 
   return res;
 }
@@ -112,15 +111,14 @@ value_rtti_type (struct value *v, int *full,
 
   if ((current_cp_abi.rtti_type) == NULL)
     return NULL;
-  TRY
+  try
     {
       ret = (*current_cp_abi.rtti_type) (v, full, top, using_enc);
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       return NULL;
     }
-  END_CATCH
 
   return ret;
 }
index b79dd5c086fe0788eb62242484650b93ace474b9..07265ef88db9f2a8291ca0055dd71bb4649e8635 100644 (file)
@@ -151,15 +151,14 @@ inspect_type (struct demangle_parse_info *info,
 
   sym = NULL;
 
-  TRY
+  try
     {
       sym = lookup_symbol (name, 0, VAR_DOMAIN, 0).symbol;
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       return 0;
     }
-  END_CATCH
 
   if (sym != NULL)
     {
@@ -223,17 +222,16 @@ inspect_type (struct demangle_parse_info *info,
            }
 
          string_file buf;
-         TRY
+         try
            {
              type_print (type, "", &buf, -1);
            }
          /* If type_print threw an exception, there is little point
             in continuing, so just bow out gracefully.  */
-         CATCH (except, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &except)
            {
              return 0;
            }
-         END_CATCH
 
          len = buf.size ();
          name = (char *) obstack_copy0 (&info->obstack, buf.c_str (), len);
@@ -424,15 +422,14 @@ replace_typedefs (struct demangle_parse_info *info,
              struct symbol *sym = NULL;
 
              sym = NULL;
-             TRY
+             try
                {
                  sym = lookup_symbol (local_name.get (), 0,
                                       VAR_DOMAIN, 0).symbol;
                }
-             CATCH (except, RETURN_MASK_ALL)
+             catch (const gdb_exception_RETURN_MASK_ALL &except)
                {
                }
-             END_CATCH
 
              if (sym != NULL)
                {
index 308c25bc795c5d5444213517439b34e5cae282cb..f45bacc1f18c1d7b1e998e1e50723cea979cd69d 100644 (file)
@@ -320,18 +320,17 @@ cp_print_value_fields (struct type *type, struct type *real_type,
                {
                  struct value *v = NULL;
 
-                 TRY
+                 try
                    {
                      v = value_static_field (type, i);
                    }
 
-                 CATCH (ex, RETURN_MASK_ERROR)
+                 catch (const gdb_exception_RETURN_MASK_ERROR &ex)
                    {
                      fprintf_filtered (stream,
                                        _("<error reading variable: %s>"),
                                        ex.what ());
                    }
-                 END_CATCH
 
                  cp_print_static_field (TYPE_FIELD_TYPE (type, i),
                                         v, stream, recurse + 1,
@@ -509,18 +508,17 @@ cp_print_value (struct type *type, struct type *real_type,
       thisoffset = offset;
       thistype = real_type;
 
-      TRY
+      try
        {
          boffset = baseclass_offset (type, i, valaddr, offset, address, val);
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          if (ex.error == NOT_AVAILABLE_ERROR)
            skip = -1;
          else
            skip = 1;
        }
-      END_CATCH
 
       if (skip == 0)
        {
index 79a6599828aed740300ac627b53166324ddd7d71..caa4fd1882718ac384a8e3745d857d3e20ceac75 100644 (file)
@@ -1611,7 +1611,7 @@ darwin_attach_pid (struct inferior *inf)
   darwin_inferior *priv = new darwin_inferior;
   inf->priv.reset (priv);
 
-  TRY
+  try
     {
       kret = task_for_pid (gdb_task, inf->pid, &priv->task);
       if (kret != KERN_SUCCESS)
@@ -1688,14 +1688,13 @@ darwin_attach_pid (struct inferior *inf)
 
       darwin_setup_exceptions (inf);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       exit_inferior (inf);
       inferior_ptid = null_ptid;
 
       throw_exception (ex);
     }
-  END_CATCH
 
   target_ops *darwin_ops = get_native_target ();
   if (!target_is_pushed (darwin_ops))
@@ -1949,11 +1948,11 @@ The error was: %s"),
   /* Maybe it was cached by some earlier gdb.  */
   if (stat (new_name.c_str (), &sb) != 0 || !S_ISREG (sb.st_mode))
     {
-      TRY
+      try
        {
          copy_shell_to_cache (shell, new_name);
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_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\
@@ -1965,7 +1964,6 @@ you \"run\".  To prevent these attempts, you can use:\n\
                   ex.what ());
          return false;
        }
-      END_CATCH
 
       printf_filtered (_("Note: this version of macOS has System Integrity Protection.\n\
 Because `startup-with-shell' is enabled, gdb has worked around this by\n\
index 48b466baf13ad0f9e114d214d1c144206e1cf4d6..aa4d499206a970122e2d16ab99f391fbb5416680 100644 (file)
@@ -192,16 +192,15 @@ memory_error_test (struct gdbarch *gdbarch)
   gdb_disassembler_test di (gdbarch);
   bool saw_memory_error = false;
 
-  TRY
+  try
     {
       di.print_insn (0);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error == MEMORY_ERROR)
        saw_memory_error = true;
     }
-  END_CATCH
 
   /* Expect MEMORY_ERROR.  */
   SELF_CHECK (saw_memory_error);
index bd5cddcf804c9dcb745b5a836dcd386f7298ec90..92fda24a3f7dc1d500d1652ee595ac102fe6c9bd 100644 (file)
@@ -484,15 +484,14 @@ dtrace_process_dof_probe (struct objfile *objfile,
             int'.  */
           struct type *type = builtin_type (gdbarch)->builtin_long;
 
-         TRY
+         try
            {
              expr = parse_expression_with_language (type_str.c_str (),
                                                     language_c);
            }
-         CATCH (ex, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &ex)
            {
            }
-         END_CATCH
 
          if (expr != NULL && expr.get ()->elts[0].opcode == OP_TYPE)
            type = expr.get ()->elts[1].type;
index 6e087f94d920dd1f075c96d42c07ac90f2410106..e03bbfc9f6fc44a4768fbb336ec7387ea7c226ce 100644 (file)
@@ -110,7 +110,7 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile)
 
   std::string build_id_str = build_id_to_string (build_id);
 
-  TRY
+  try
     {
       /* Try to create the containing directory.  */
       if (!mkdir_recursive (m_dir.c_str ()))
@@ -129,13 +129,12 @@ 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 (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       if (debug_index_cache)
        printf_unfiltered ("index cache: couldn't store index cache for objfile "
                           "%s: %s", objfile_name (obj), except.what ());
     }
-  END_CATCH
 }
 
 #if HAVE_SYS_MMAN_H
@@ -172,7 +171,7 @@ index_cache::lookup_gdb_index (const bfd_build_id *build_id,
   /* Compute where we would expect a gdb index file for this build id to be.  */
   std::string filename = make_index_filename (build_id, INDEX4_SUFFIX);
 
-  TRY
+  try
     {
       if (debug_index_cache)
         printf_unfiltered ("index cache: trying to read %s\n",
@@ -189,13 +188,12 @@ index_cache::lookup_gdb_index (const bfd_build_id *build_id,
          ((const gdb_byte *) mmap_resource->mapping.get (),
           mmap_resource->mapping.size ());
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       if (debug_index_cache)
        printf_unfiltered ("index cache: couldn't read %s: %s\n",
                           filename.c_str (), except.what ());
     }
-  END_CATCH
 
   return {};
 }
index 01c1256bcb63ef81a5341ec6a13bf2d8a97cb648..531256f2d58d05989271fc5edf505b34faf64329 100644 (file)
@@ -1675,19 +1675,18 @@ save_gdb_index_command (const char *arg, int from_tty)
 
       if (dwarf2_per_objfile != NULL)
        {
-         TRY
+         try
            {
              const char *basename = lbasename (objfile_name (objfile));
              write_psymtabs_to_index (dwarf2_per_objfile, arg, basename,
                                       index_kind);
            }
-         CATCH (except, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &except)
            {
              exception_fprintf (gdb_stderr, except,
                                 _("Error while writing index for `%s': "),
                                 objfile_name (objfile));
            }
-         END_CATCH
            }
 
     }
index 4cf7f5ff63abe94358c1aaa3d842e0ad84ac71cf..178a65c3be44e2dccb32039432fbd0f6a0d246c2 100644 (file)
@@ -377,7 +377,7 @@ dwarf2_tailcall_sniffer_first (struct frame_info *this_frame,
   this_pc = get_frame_address_in_block (this_frame);
 
   /* Catch any unwinding errors.  */
-  TRY
+  try
     {
       int sp_regnum;
 
@@ -399,13 +399,12 @@ dwarf2_tailcall_sniffer_first (struct frame_info *this_frame,
            }
        }
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       if (entry_values_debug)
        exception_print (gdb_stdout, except);
       return;
     }
-  END_CATCH
 
   /* Ambiguous unwind or unambiguous unwind verified as matching.  */
   if (chain == NULL || chain->length == 0)
index f1ba0c97c6bd2626afac74487663874651366a9a..2274d67201a17fae34f2d36fb6b678a32ed9af0f 100644 (file)
@@ -1044,7 +1044,7 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
   execute_cfa_program (fde, instr, fde->end, gdbarch,
                       get_frame_address_in_block (this_frame), &fs);
 
-  TRY
+  try
     {
       /* Calculate the CFA.  */
       switch (fs.regs.cfa_how)
@@ -1068,7 +1068,7 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
          internal_error (__FILE__, __LINE__, _("Unknown CFA rule."));
        }
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error == NOT_AVAILABLE_ERROR)
        {
@@ -1078,7 +1078,6 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
 
       throw_exception (ex);
     }
-  END_CATCH
 
   /* Initialize the register state.  */
   {
@@ -2245,7 +2244,7 @@ dwarf2_build_frame_info (struct objfile *objfile)
           if (txt)
             unit->tbase = txt->vma;
 
-         TRY
+         try
            {
              frame_ptr = unit->dwarf_frame_buffer;
              while (frame_ptr < unit->dwarf_frame_buffer + unit->dwarf_frame_size)
@@ -2254,7 +2253,7 @@ dwarf2_build_frame_info (struct objfile *objfile)
                                                EH_CIE_OR_FDE_TYPE_ID);
            }
 
-         CATCH (e, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &e)
            {
              warning (_("skipping .eh_frame info of %s: %s"),
                       objfile_name (objfile), e.what ());
@@ -2267,7 +2266,6 @@ dwarf2_build_frame_info (struct objfile *objfile)
                }
              /* The cie_table is discarded by the next if.  */
            }
-         END_CATCH
 
           if (cie_table.num_entries != 0)
             {
@@ -2287,7 +2285,7 @@ dwarf2_build_frame_info (struct objfile *objfile)
     {
       int num_old_fde_entries = fde_table.num_entries;
 
-      TRY
+      try
        {
          frame_ptr = unit->dwarf_frame_buffer;
          while (frame_ptr < unit->dwarf_frame_buffer + unit->dwarf_frame_size)
@@ -2295,7 +2293,7 @@ dwarf2_build_frame_info (struct objfile *objfile)
                                            &cie_table, &fde_table,
                                            EH_CIE_OR_FDE_TYPE_ID);
        }
-      CATCH (e, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &e)
        {
          warning (_("skipping .debug_frame info of %s: %s"),
                   objfile_name (objfile), e.what ());
@@ -2318,7 +2316,6 @@ dwarf2_build_frame_info (struct objfile *objfile)
          fde_table.num_entries = num_old_fde_entries;
          /* The cie_table is discarded by the next if.  */
        }
-      END_CATCH
     }
 
   /* Discard the cie_table, it is no longer needed.  */
index 29d289b4d0c3136afa1453b7f67ce91d857607cf..d712c29a7c268e49acd87a9d2dbc90cceab29f57 100644 (file)
@@ -1195,11 +1195,11 @@ call_site_find_chain (struct gdbarch *gdbarch, CORE_ADDR caller_pc,
 {
   struct call_site_chain *retval = NULL;
 
-  TRY
+  try
     {
       retval = call_site_find_chain_1 (gdbarch, caller_pc, callee_pc);
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       if (e.error == NO_ENTRY_VALUE_ERROR)
        {
@@ -1211,7 +1211,6 @@ call_site_find_chain (struct gdbarch *gdbarch, CORE_ADDR caller_pc,
       else
        throw_exception (e);
     }
-  END_CATCH
 
   return retval;
 }
@@ -2164,11 +2163,11 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
   ctx.ref_addr_size = dwarf2_per_cu_ref_addr_size (per_cu);
   ctx.offset = dwarf2_per_cu_text_offset (per_cu);
 
-  TRY
+  try
     {
       ctx.eval (data, size);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error == NOT_AVAILABLE_ERROR)
        {
@@ -2188,7 +2187,6 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
       else
        throw_exception (ex);
     }
-  END_CATCH
 
   if (ctx.pieces.size () > 0)
     {
@@ -2382,11 +2380,11 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
   ctx.ref_addr_size = dwarf2_per_cu_ref_addr_size (dlbaton->per_cu);
   ctx.offset = dwarf2_per_cu_text_offset (dlbaton->per_cu);
 
-  TRY
+  try
     {
       ctx.eval (dlbaton->data, dlbaton->size);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error == NOT_AVAILABLE_ERROR)
        {
@@ -2401,7 +2399,6 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
       else
        throw_exception (ex);
     }
-  END_CATCH
 
   switch (ctx.location)
     {
index 8881a1e28a83ac21e1cd57f7647bdd1051826e77..6453e4a28279b0ba6a159a2bb838d42583973c8a 100644 (file)
@@ -6332,7 +6332,7 @@ dwarf2_build_psymtabs (struct objfile *objfile)
 
   init_psymbol_list (objfile, 1024);
 
-  TRY
+  try
     {
       /* This isn't really ideal: all the data we allocate on the
         objfile's obstack is still uselessly kept around.  However,
@@ -6344,11 +6344,10 @@ dwarf2_build_psymtabs (struct objfile *objfile)
       /* (maybe) store an index in the cache.  */
       global_index_cache.store (dwarf2_per_objfile);
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       exception_print (gdb_stderr, except);
     }
-  END_CATCH
 }
 
 /* Return the total length of the CU described by HEADER.  */
index 3f768b45309c7aba119580bb56cbd5d9e569a5a1..fa65fb1ed765299cee03558c47051c90a74a78c3 100644 (file)
@@ -201,11 +201,11 @@ fetch_subexp_value (struct expression *exp, int *pc, struct value **valp,
   mark = value_mark ();
   result = NULL;
 
-  TRY
+  try
     {
       result = evaluate_subexp (NULL_TYPE, exp, pc, EVAL_NORMAL);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       /* Ignore memory errors if we want watchpoints pointing at
         inaccessible memory to still be created; otherwise, throw the
@@ -221,7 +221,6 @@ fetch_subexp_value (struct expression *exp, int *pc, struct value **valp,
          break;
        }
     }
-  END_CATCH
 
   new_mark = value_mark ();
   if (mark == new_mark)
@@ -238,15 +237,14 @@ fetch_subexp_value (struct expression *exp, int *pc, struct value **valp,
       else
        {
 
-         TRY
+         try
            {
              value_fetch_lazy (result);
              *valp = result;
            }
-         CATCH (except, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &except)
            {
            }
-         END_CATCH
        }
     }
 
@@ -716,19 +714,18 @@ evaluate_var_value (enum noside noside, const block *blk, symbol *var)
 
   struct value *ret = NULL;
 
-  TRY
+  try
     {
       ret = value_of_variable (var, blk);
     }
 
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       if (noside != EVAL_AVOID_SIDE_EFFECTS)
        throw_exception (except);
 
       ret = value_zero (SYMBOL_TYPE (var), not_lval);
     }
-  END_CATCH
 
   return ret;
 }
@@ -957,19 +954,18 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
          while (unop_user_defined_p (op, arg2))
            {
              struct value *value = NULL;
-             TRY
+             try
                {
                  value = value_x_unop (arg2, op, noside);
                }
 
-             CATCH (except, RETURN_MASK_ERROR)
+             catch (const gdb_exception_RETURN_MASK_ERROR &except)
                {
                  if (except.error == NOT_FOUND_ERROR)
                    break;
                  else
                    throw_exception (except);
                }
-             END_CATCH
 
                arg2 = value;
            }
@@ -2047,19 +2043,18 @@ evaluate_subexp_standard (struct type *expect_type,
       while (unop_user_defined_p (op, arg1))
        {
          struct value *value = NULL;
-         TRY
+         try
            {
              value = value_x_unop (arg1, op, noside);
            }
 
-         CATCH (except, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &except)
            {
              if (except.error == NOT_FOUND_ERROR)
                break;
              else
                throw_exception (except);
            }
-         END_CATCH
 
          arg1 = value;
        }
index 28e81646fbdc51ce82f52c77b6109591048c278d..0219578bb12e48d5633189059380a6da530b71b2 100644 (file)
@@ -366,11 +366,11 @@ start_event_loop (void)
     {
       int result = 0;
 
-      TRY
+      try
        {
          result = gdb_do_one_event ();
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
          exception_print (gdb_stderr, ex);
 
@@ -394,7 +394,6 @@ start_event_loop (void)
          /* Maybe better to set a flag to be checked somewhere as to
             whether display the prompt or not.  */
        }
-      END_CATCH
 
       if (result < 0)
        break;
index fb5d51c6e10b0148df9585f72f8d6aefba7b8c4d..2d6dda37735f9bfac1c5b37e52c3474956eef44e 100644 (file)
@@ -208,15 +208,14 @@ gdb_rl_callback_handler (char *rl) noexcept
   struct gdb_exception gdb_rl_expt = exception_none;
   struct ui *ui = current_ui;
 
-  TRY
+  try
     {
       ui->input_handler (gdb::unique_xmalloc_ptr<char> (rl));
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       gdb_rl_expt = ex;
     }
-  END_CATCH
 
   /* If we caught a GDB exception, longjmp out of the readline
      callback.  There's no other way for the callback to signal to
@@ -1082,27 +1081,25 @@ static void
 async_disconnect (gdb_client_data arg)
 {
 
-  TRY
+  try
     {
       quit_cover ();
     }
 
-  CATCH (exception, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &exception)
     {
       fputs_filtered ("Could not kill the program being debugged",
                      gdb_stderr);
       exception_print (gdb_stderr, exception);
     }
-  END_CATCH
 
-  TRY
+  try
     {
       pop_all_targets ();
     }
-  CATCH (exception, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &exception)
     {
     }
-  END_CATCH
 
   signal (SIGHUP, SIG_DFL);    /*FIXME: ???????????  */
   raise (SIGHUP);
index 3f3092201fc443cdb0ca3f1618473effae502f71..6a9f9194d005eb74e955e2ebd69097c3be9f18eb 100644 (file)
@@ -161,33 +161,31 @@ try_open_exec_file (const char *exec_file_host, struct inferior *inf,
      Even without a symbol file, the remote-based debugging session should
      continue normally instead of ending abruptly.  Hence we catch thrown
      errors/exceptions in the following code.  */
-  TRY
+  try
     {
       /* We must do this step even if exec_file_host is NULL, so that
         exec_file_attach will clear state.  */
       exec_file_attach (exec_file_host, add_flags & SYMFILE_VERBOSE);
     }
-  CATCH (err, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &err)
     {
       if (err.message != NULL)
        warning ("%s", err.what ());
 
       prev_err = err;
     }
-  END_CATCH
 
   if (exec_file_host != NULL)
     {
-      TRY
+      try
        {
          symbol_file_add_main (exec_file_host, add_flags);
        }
-      CATCH (err, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &err)
        {
          if (!exception_print_same (prev_err, err))
            warning ("%s", err.what ());
        }
-      END_CATCH
     }
 }
 
index 8eb8062496250efaefc101d24fec19bbc386d6e6..8d9dd16f7553f925b7692acffd963108cc9cf7f0 100644 (file)
@@ -407,18 +407,17 @@ info_common_command_for_block (const struct block *block, const char *comname,
            printf_filtered ("%s = ",
                             SYMBOL_PRINT_NAME (common->contents[index]));
 
-           TRY
+           try
              {
                val = value_of_variable (common->contents[index], block);
                value_print (val, gdb_stdout, &opts);
              }
 
-           CATCH (except, RETURN_MASK_ERROR)
+           catch (const gdb_exception_RETURN_MASK_ERROR &except)
              {
                printf_filtered ("<error reading variable: %s>",
                                 except.what ());
              }
-           END_CATCH
 
            putchar_filtered ('\n');
          }
index cd207d88bc384f097fa42f72402537783d8b9248..4c5dacab9ce8fbfc99fab405885a8621a3034401 100644 (file)
@@ -746,15 +746,14 @@ fbsd_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
     }
 
   /* Thread register information.  */
-  TRY
+  try
     {
       update_thread_list ();
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       exception_print (gdb_stderr, e);
     }
-  END_CATCH
 
   /* Like the kernel, prefer dumping the signalled thread first.
      "First thread" is what tools use to infer the signalled thread.
@@ -1985,7 +1984,7 @@ fbsd_read_integer_by_name (struct gdbarch *gdbarch, const char *name)
 static void
 fbsd_fetch_rtld_offsets (struct gdbarch *gdbarch, struct fbsd_pspace_data *data)
 {
-  TRY
+  try
     {
       /* Fetch offsets from debug symbols in rtld.  */
       struct symbol *obj_entry_sym
@@ -2000,13 +1999,12 @@ fbsd_fetch_rtld_offsets (struct gdbarch *gdbarch, struct fbsd_pspace_data *data)
       data->rtld_offsets_valid = true;
       return;
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       data->off_linkmap = -1;
     }
-  END_CATCH
 
-  TRY
+  try
     {
       /* Fetch offsets from global variables in libthr.  Note that
         this does not work for single-threaded processes that are not
@@ -2018,11 +2016,10 @@ fbsd_fetch_rtld_offsets (struct gdbarch *gdbarch, struct fbsd_pspace_data *data)
       data->rtld_offsets_valid = true;
       return;
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       data->off_linkmap = -1;
     }
-  END_CATCH
 }
 
 /* Helper function to read the TLS index of an object file associated
index e5ddeba90773b545092f74c3def5f98ede20832a..18e157950a047535cc36578bf2020032ce67473e 100644 (file)
@@ -101,11 +101,11 @@ frame_unwind_try_unwinder (struct frame_info *this_frame, void **this_cache,
 
   frame_prepare_for_sniffer (this_frame, unwinder);
 
-  TRY
+  try
     {
       res = unwinder->sniffer (unwinder, this_frame, this_cache);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       /* Catch all exceptions, caused by either interrupt or error.
         Reset *THIS_CACHE.  */
@@ -122,7 +122,6 @@ frame_unwind_try_unwinder (struct frame_info *this_frame, void **this_cache,
        }
       throw_exception (ex);
     }
-  END_CATCH
 
   if (res)
     return 1;
index b71cd6faade87350bb02c5d4ff2a7355fbb495d1..1fe465a73752ffc5fdcbf1187e9a78b83c938cd4 100644 (file)
@@ -894,12 +894,12 @@ frame_unwind_pc (struct frame_info *this_frame)
         different ways that a PC could be unwound.  */
       prev_gdbarch = frame_unwind_arch (this_frame);
 
-      TRY
+      try
        {
          pc = gdbarch_unwind_pc (prev_gdbarch, this_frame);
          pc_p = 1;
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          if (ex.error == NOT_AVAILABLE_ERROR)
            {
@@ -924,7 +924,6 @@ frame_unwind_pc (struct frame_info *this_frame)
          else
            throw_exception (ex);
        }
-      END_CATCH
 
       if (pc_p)
        {
@@ -1894,7 +1893,7 @@ get_prev_frame_if_no_cycle (struct frame_info *this_frame)
   if (prev_frame->level == 0)
     return prev_frame;
 
-  TRY
+  try
     {
       compute_frame_id (prev_frame);
       if (!frame_stash_add (prev_frame))
@@ -1914,14 +1913,13 @@ get_prev_frame_if_no_cycle (struct frame_info *this_frame)
          prev_frame = NULL;
        }
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       prev_frame->next = NULL;
       this_frame->prev = NULL;
 
       throw_exception (ex);
     }
-  END_CATCH
 
   return prev_frame;
 }
@@ -2092,11 +2090,11 @@ get_prev_frame_always (struct frame_info *this_frame)
 {
   struct frame_info *prev_frame = NULL;
 
-  TRY
+  try
     {
       prev_frame = get_prev_frame_always_1 (this_frame);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error == MEMORY_ERROR)
        {
@@ -2120,7 +2118,6 @@ get_prev_frame_always (struct frame_info *this_frame)
       else
        throw_exception (ex);
     }
-  END_CATCH
 
   return prev_frame;
 }
@@ -2379,18 +2376,17 @@ get_frame_pc_if_available (struct frame_info *frame, CORE_ADDR *pc)
 
   gdb_assert (frame->next != NULL);
 
-  TRY
+  try
     {
       *pc = frame_unwind_pc (frame->next);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error == NOT_AVAILABLE_ERROR)
        return 0;
       else
        throw_exception (ex);
     }
-  END_CATCH
 
   return 1;
 }
@@ -2462,17 +2458,16 @@ get_frame_address_in_block_if_available (struct frame_info *this_frame,
                                         CORE_ADDR *pc)
 {
 
-  TRY
+  try
     {
       *pc = get_frame_address_in_block (this_frame);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error == NOT_AVAILABLE_ERROR)
        return 0;
       throw_exception (ex);
     }
-  END_CATCH
 
   return 1;
 }
@@ -2747,17 +2742,16 @@ get_frame_language (struct frame_info *frame)
        a PC that is guaranteed to be inside the frame's code
        block.  */
 
-  TRY
+  try
     {
       pc = get_frame_address_in_block (frame);
       pc_p = 1;
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
        throw_exception (ex);
     }
-  END_CATCH
 
   if (pc_p)
     {
index f0923a62e9791babdd4604a17c3288013c2a6585..00312e69cd8d61e0ac1d5b226f4a2bc5d3dc89dd 100644 (file)
@@ -1,3 +1,9 @@
+2019-04-08  Tom Tromey  <tom@tromey.com>
+
+       * server.c: Use C++ exception handling.
+       * linux-low.c: Use C++ exception handling.
+       * gdbreplay.c: Use C++ exception handling.
+
 2019-04-08  Tom Tromey  <tom@tromey.com>
 
        * server.c (handle_btrace_general_set, handle_qxfer_btrace)
index 1acd24bf1099e8229ba34d9a2afb1d5ab55d13b5..bf566ab79422800d71f33e0415d1086c43d3cbd2 100644 (file)
@@ -528,11 +528,11 @@ captured_main (int argc, char *argv[])
 int
 main (int argc, char *argv[])
 {
-  TRY
+  try
     {
       captured_main (argc, argv);
     }
-  CATCH (exception, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &exception)
     {
       if (exception.reason == RETURN_ERROR)
        {
@@ -542,7 +542,6 @@ main (int argc, char *argv[])
 
       exit (1);
     }
-  END_CATCH
 
   gdb_assert_not_reached ("captured_main should never return");
 }
index 65919c326256230a01082e3acf1a10c0b16cd2bf..6ca79d5f527135f10f665842226e54bb98fac73a 100644 (file)
@@ -1531,7 +1531,7 @@ linux_detach_one_lwp (struct lwp_info *lwp)
   /* Preparing to resume may try to write registers, and fail if the
      lwp is zombie.  If that happens, ignore the error.  We'll handle
      it below, when detach fails with ESRCH.  */
-  TRY
+  try
     {
       /* Flush any pending changes to the process's registers.  */
       regcache_invalidate_thread (thread);
@@ -1540,12 +1540,11 @@ linux_detach_one_lwp (struct lwp_info *lwp)
       if (the_low_target.prepare_to_resume != NULL)
        the_low_target.prepare_to_resume (lwp);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (!check_ptrace_stopped_lwp_gone (lwp))
        throw_exception (ex);
     }
-  END_CATCH
 
   lwpid = lwpid_of (thread);
   if (ptrace (PTRACE_DETACH, lwpid, (PTRACE_TYPE_ARG3) 0,
@@ -4508,16 +4507,15 @@ static void
 linux_resume_one_lwp (struct lwp_info *lwp,
                      int step, int signal, siginfo_t *info)
 {
-  TRY
+  try
     {
       linux_resume_one_lwp_throw (lwp, step, signal, info);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (!check_ptrace_stopped_lwp_gone (lwp))
        throw_exception (ex);
     }
-  END_CATCH
 }
 
 /* This function is called once per thread via for_each_thread.
index 0f4341c28be72676bc0a47a050695a462560c1e8..99ce21e2cc7a906b9c42ab8950b09b8b151fcba1 100644 (file)
@@ -459,7 +459,7 @@ handle_btrace_general_set (char *own_buf)
       return -1;
     }
 
-  TRY
+  try
     {
       if (strcmp (op, "bts") == 0)
        handle_btrace_enable_bts (thread);
@@ -472,11 +472,10 @@ handle_btrace_general_set (char *own_buf)
 
       write_ok (own_buf);
     }
-  CATCH (exception, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &exception)
     {
       sprintf (own_buf, "E.%s", exception.what ());
     }
-  END_CATCH
 
   return 1;
 }
@@ -1876,18 +1875,17 @@ handle_qxfer_btrace (const char *annex,
     {
       buffer_free (&cache);
 
-      TRY
+      try
        {
          result = target_read_btrace (thread->btrace, &cache, type);
          if (result != 0)
            memcpy (cs.own_buf, cache.buffer, cache.used_size);
        }
-      CATCH (exception, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &exception)
        {
          sprintf (cs.own_buf, "E.%s", exception.what ());
          result = -1;
        }
-      END_CATCH
 
       if (result != 0)
        return -3;
@@ -1948,18 +1946,17 @@ handle_qxfer_btrace_conf (const char *annex,
     {
       buffer_free (&cache);
 
-      TRY
+      try
        {
          result = target_read_btrace_conf (thread->btrace, &cache);
          if (result != 0)
            memcpy (cs.own_buf, cache.buffer, cache.used_size);
        }
-      CATCH (exception, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &exception)
        {
          sprintf (cs.own_buf, "E.%s", exception.what ());
          result = -1;
        }
-      END_CATCH
 
       if (result != 0)
        return -3;
@@ -3552,18 +3549,17 @@ static int exit_code;
 static void
 detach_or_kill_for_exit_cleanup ()
 {
-  TRY
+  try
     {
       detach_or_kill_for_exit ();
     }
-  CATCH (exception, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &exception)
     {
       fflush (stdout);
       fprintf (stderr, "Detach or kill failed: %s\n",
               exception.what ());
       exit_code = 1;
     }
-  END_CATCH
 }
 
 /* Main function.  This is called by the real "main" function,
@@ -3866,7 +3862,7 @@ captured_main (int argc, char *argv[])
 
       remote_open (port);
 
-      TRY
+      try
        {
          /* Wait for events.  This will return when all event sources
             are removed from the event loop.  */
@@ -3931,7 +3927,7 @@ captured_main (int argc, char *argv[])
                }
            }
        }
-      CATCH (exception, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &exception)
        {
          fflush (stdout);
          fprintf (stderr, "gdbserver: %s\n", exception.what ());
@@ -3945,7 +3941,6 @@ captured_main (int argc, char *argv[])
          if (run_once)
            throw_quit ("Quit");
        }
-      END_CATCH
     }
 }
 
@@ -3955,11 +3950,11 @@ int
 main (int argc, char *argv[])
 {
 
-  TRY
+  try
     {
       captured_main (argc, argv);
     }
-  CATCH (exception, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &exception)
     {
       if (exception.reason == RETURN_ERROR)
        {
@@ -3971,7 +3966,6 @@ main (int argc, char *argv[])
 
       exit (exit_code);
     }
-  END_CATCH
 
   gdb_assert_not_reached ("captured_main should never return");
 }
index b1a51374d967eb1f81d0dbb54f55909f290fa7a7..373b30a423d4cb7ca536e253e171fb517bc36d2f 100644 (file)
@@ -2571,15 +2571,14 @@ safe_parse_type (struct gdbarch *gdbarch, char *p, int length)
   gdb_stderr = &null_stream;
 
   /* Call parse_and_eval_type() without fear of longjmp()s.  */
-  TRY
+  try
     {
       type = parse_and_eval_type (p, length);
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       type = builtin_type (gdbarch)->builtin_void;
     }
-  END_CATCH
 
   /* Stop suppressing error messages.  */
   gdb_stderr = saved_gdb_stderr;
index 786f416153731f58b9cde7297f86a4408bcdbf62..01bb82bf6642680054d93a8f0020f8ab8f2468b0 100644 (file)
@@ -906,16 +906,15 @@ print_one_vtable (struct gdbarch *gdbarch, struct value *value,
       if (gdbarch_vtable_function_descriptors (gdbarch))
        vfn = value_addr (vfn);
 
-      TRY
+      try
        {
          addr = value_as_address (vfn);
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          printf_filtered (_("<error: %s>"), ex.what ());
          got_error = 1;
        }
-      END_CATCH
 
       if (!got_error)
        print_function_pointer_address (opts, gdbarch, addr, gdb_stdout);
index d05f4680adf041cfdeed4e9f99d73f1b20b06aa0..0a24325ac34b242df9fedc44ced0165c9b437c72 100644 (file)
@@ -677,15 +677,14 @@ gdbscm_wrap (Function &&func, Args &&... args)
 {
   SCM result = SCM_BOOL_F;
 
-  TRY
+  try
     {
       result = func (std::forward<Args> (args)...);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (gdbscm_is_exception (result))
     gdbscm_throw (result);
index df1dfe57526a71e0bcddc0e1d95aa0f223ef34b2..6f91f88d65b7323932f9d920f0a210c68364a6bb 100644 (file)
@@ -680,18 +680,17 @@ gdbscm_lookup_block (SCM pc_scm)
 
   gdbscm_parse_function_args (FUNC_NAME, SCM_ARG1, NULL, "U", pc_scm, &pc);
 
-  TRY
+  try
     {
       cust = find_pc_compunit_symtab (pc);
 
       if (cust != NULL && COMPUNIT_OBJFILE (cust) != NULL)
        block = block_for_pc (pc);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (cust == NULL || COMPUNIT_OBJFILE (cust) == NULL)
     {
index d052748dd40556b4f9008901d9c11b174aa3a13a..356abca9124631a7f77d59eaa91e5ed5373329e5 100644 (file)
@@ -429,7 +429,7 @@ gdbscm_register_breakpoint_x (SCM self)
                                      current_language,
                                      symbol_name_match_type::WILD);
 
-  TRY
+  try
     {
       int internal = bp_smob->spec.is_internal;
 
@@ -465,11 +465,10 @@ gdbscm_register_breakpoint_x (SCM self)
          gdb_assert_not_reached ("invalid breakpoint type");
        }
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       except = ex;
     }
-  END_CATCH
 
   /* Ensure this gets reset, even if there's an error.  */
   pending_breakpoint_scm = SCM_BOOL_F;
@@ -490,15 +489,14 @@ gdbscm_delete_breakpoint_x (SCM self)
   breakpoint_smob *bp_smob
     = bpscm_get_valid_breakpoint_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
 
-  TRY
+  try
     {
       delete_breakpoint (bp_smob->bp);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return SCM_UNSPECIFIED;
 }
@@ -588,18 +586,17 @@ gdbscm_set_breakpoint_enabled_x (SCM self, SCM newvalue)
   SCM_ASSERT_TYPE (gdbscm_is_bool (newvalue), newvalue, SCM_ARG2, FUNC_NAME,
                   _("boolean"));
 
-  TRY
+  try
     {
       if (gdbscm_is_true (newvalue))
        enable_breakpoint (bp_smob->bp);
       else
        disable_breakpoint (bp_smob->bp);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return SCM_UNSPECIFIED;
 }
@@ -626,15 +623,14 @@ gdbscm_set_breakpoint_silent_x (SCM self, SCM newvalue)
   SCM_ASSERT_TYPE (gdbscm_is_bool (newvalue), newvalue, SCM_ARG2, FUNC_NAME,
                   _("boolean"));
 
-  TRY
+  try
     {
       breakpoint_set_silent (bp_smob->bp, gdbscm_is_true (newvalue));
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return SCM_UNSPECIFIED;
 }
@@ -667,15 +663,14 @@ gdbscm_set_breakpoint_ignore_count_x (SCM self, SCM newvalue)
   if (value < 0)
     value = 0;
 
-  TRY
+  try
     {
       set_ignore_count (bp_smob->number, (int) value, 0);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return SCM_UNSPECIFIED;
 }
@@ -788,15 +783,14 @@ gdbscm_set_breakpoint_task_x (SCM self, SCM newvalue)
     {
       id = scm_to_long (newvalue);
 
-      TRY
+      try
        {
          valid_id = valid_task_id (id);
        }
-      CATCH (except, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &except)
        {
          GDBSCM_HANDLE_GDB_EXCEPTION (except);
        }
-      END_CATCH
 
       if (! valid_id)
        {
@@ -809,15 +803,14 @@ gdbscm_set_breakpoint_task_x (SCM self, SCM newvalue)
   else
     SCM_ASSERT_TYPE (0, newvalue, SCM_ARG2, FUNC_NAME, _("integer or #f"));
 
-  TRY
+  try
     {
       breakpoint_set_task (bp_smob->bp, id);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return SCM_UNSPECIFIED;
 }
@@ -975,16 +968,15 @@ gdbscm_breakpoint_commands (SCM self)
   string_file buf;
 
   current_uiout->redirect (&buf);
-  TRY
+  try
     {
       print_command_lines (current_uiout, breakpoint_commands (bp), 0);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       current_uiout->redirect (NULL);
       gdbscm_throw_gdb_exception (except);
     }
-  END_CATCH
 
   current_uiout->redirect (NULL);
   result = gdbscm_scm_from_c_string (buf.c_str ());
index 1266a7909470771cacbaf7bccf7c11c1ce3c7343..a89650b2627f7b7f7c5684e2129f77da71b0ecb9 100644 (file)
@@ -758,7 +758,7 @@ gdbscm_register_command_x (SCM self)
   c_smob->cmd_name = gdbscm_gc_xstrdup (cmd_name);
   xfree (cmd_name);
 
-  TRY
+  try
     {
       if (c_smob->is_prefix)
        {
@@ -776,11 +776,10 @@ gdbscm_register_command_x (SCM self)
                         c_smob->doc, cmd_list);
        }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   /* Note: At this point the command exists in gdb.
      So no more errors after this point.  */
index e4a9c92a56b54d00261019f178305f8024ec5d1a..584de378f531e30a7d8e0bc5bf63851b00579c2a 100644 (file)
@@ -247,7 +247,7 @@ gdbscm_arch_disassemble (SCM self, SCM start_scm, SCM rest)
       int insn_len = 0;
       string_file buf;
 
-      TRY
+      try
        {
          if (using_port)
            {
@@ -257,11 +257,10 @@ gdbscm_arch_disassemble (SCM self, SCM start_scm, SCM rest)
          else
            insn_len = gdb_print_insn (gdbarch, pc, &buf, NULL);
        }
-      CATCH (except, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &except)
        {
          GDBSCM_HANDLE_GDB_EXCEPTION (except);
        }
-      END_CATCH
 
       result = scm_cons (dascm_make_insn (pc, buf.c_str (), insn_len),
                         result);
index 22c78928adfe13cc51e140ca050db4d829a3d062..9360bb90cc53267f306819996001273d982089b7 100644 (file)
@@ -229,7 +229,7 @@ frscm_scm_from_frame (struct frame_info *frame, struct inferior *inferior)
   if (*slot != NULL)
     return (*slot)->containing_scm;
 
-  TRY
+  try
     {
       /* Try to get the previous frame, to determine if this is the last frame
         in a corrupt stack.  If so, we need to store the frame_id of the next
@@ -248,11 +248,10 @@ frscm_scm_from_frame (struct frame_info *frame, struct inferior *inferior)
        }
       gdbarch = get_frame_arch (frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       return gdbscm_scm_from_gdb_exception (except);
     }
-  END_CATCH
 
   f_scm = frscm_make_frame_smob ();
   f_smob = (frame_smob *) SCM_SMOB_DATA (f_scm);
@@ -397,15 +396,14 @@ gdbscm_frame_valid_p (SCM self)
 
   f_smob = frscm_get_frame_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
 
-  TRY
+  try
     {
       frame = frscm_frame_smob_to_frame (f_smob);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return scm_from_bool (frame != NULL);
 }
@@ -425,17 +423,16 @@ gdbscm_frame_name (SCM self)
 
   f_smob = frscm_get_frame_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
 
-  TRY
+  try
     {
       frame = frscm_frame_smob_to_frame (f_smob);
       if (frame != NULL)
        name = find_frame_funname (frame, &lang, NULL);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (frame == NULL)
     {
@@ -463,17 +460,16 @@ gdbscm_frame_type (SCM self)
 
   f_smob = frscm_get_frame_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
 
-  TRY
+  try
     {
       frame = frscm_frame_smob_to_frame (f_smob);
       if (frame != NULL)
        type = get_frame_type (frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (frame == NULL)
     {
@@ -495,15 +491,14 @@ gdbscm_frame_arch (SCM self)
 
   f_smob = frscm_get_frame_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
 
-  TRY
+  try
     {
       frame = frscm_frame_smob_to_frame (f_smob);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (frame == NULL)
     {
@@ -526,15 +521,14 @@ gdbscm_frame_unwind_stop_reason (SCM self)
 
   f_smob = frscm_get_frame_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
 
-  TRY
+  try
     {
       frame = frscm_frame_smob_to_frame (f_smob);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (frame == NULL)
     {
@@ -559,17 +553,16 @@ gdbscm_frame_pc (SCM self)
 
   f_smob = frscm_get_frame_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
 
-  TRY
+  try
     {
       frame = frscm_frame_smob_to_frame (f_smob);
       if (frame != NULL)
        pc = get_frame_pc (frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (frame == NULL)
     {
@@ -592,17 +585,16 @@ gdbscm_frame_block (SCM self)
 
   f_smob = frscm_get_frame_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
 
-  TRY
+  try
     {
       frame = frscm_frame_smob_to_frame (f_smob);
       if (frame != NULL)
        block = get_frame_block (frame, NULL);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (frame == NULL)
     {
@@ -643,17 +635,16 @@ gdbscm_frame_function (SCM self)
 
   f_smob = frscm_get_frame_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
 
-  TRY
+  try
     {
       frame = frscm_frame_smob_to_frame (f_smob);
       if (frame != NULL)
        sym = find_pc_function (get_frame_address_in_block (frame));
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (frame == NULL)
     {
@@ -680,17 +671,16 @@ gdbscm_frame_older (SCM self)
 
   f_smob = frscm_get_frame_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
 
-  TRY
+  try
     {
       frame = frscm_frame_smob_to_frame (f_smob);
       if (frame != NULL)
        prev = get_prev_frame (frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (frame == NULL)
     {
@@ -717,17 +707,16 @@ gdbscm_frame_newer (SCM self)
 
   f_smob = frscm_get_frame_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
 
-  TRY
+  try
     {
       frame = frscm_frame_smob_to_frame (f_smob);
       if (frame != NULL)
        next = get_next_frame (frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (frame == NULL)
     {
@@ -753,17 +742,16 @@ gdbscm_frame_sal (SCM self)
 
   f_smob = frscm_get_frame_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
 
-  TRY
+  try
     {
       frame = frscm_frame_smob_to_frame (f_smob);
       if (frame != NULL)
        sal = find_frame_sal (frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (frame == NULL)
     {
@@ -791,7 +779,7 @@ gdbscm_frame_read_register (SCM self, SCM register_scm)
 
   struct gdb_exception except = exception_none;
 
-  TRY
+  try
     {
       int regnum;
 
@@ -805,11 +793,10 @@ gdbscm_frame_read_register (SCM self, SCM register_scm)
            value = value_of_register (regnum, frame);
        }
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       except = ex;
     }
-  END_CATCH
 
   xfree (register_str);
   GDBSCM_HANDLE_GDB_EXCEPTION (except);
@@ -851,15 +838,14 @@ gdbscm_frame_read_var (SCM self, SCM symbol_scm, SCM rest)
 
   f_smob = frscm_get_frame_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
 
-  TRY
+  try
     {
       frame = frscm_frame_smob_to_frame (f_smob);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (frame == NULL)
     {
@@ -897,7 +883,7 @@ gdbscm_frame_read_var (SCM self, SCM symbol_scm, SCM rest)
        /* N.B. Between here and the end of the scope, don't do anything
           to cause a Scheme exception.  */
 
-       TRY
+       try
          {
            struct block_symbol lookup_sym;
 
@@ -908,11 +894,10 @@ gdbscm_frame_read_var (SCM self, SCM symbol_scm, SCM rest)
            var = lookup_sym.symbol;
            block = lookup_sym.block;
          }
-       CATCH (ex, RETURN_MASK_ALL)
+       catch (const gdb_exception_RETURN_MASK_ALL &ex)
          {
            except = ex;
          }
-       END_CATCH
       }
 
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
@@ -928,15 +913,14 @@ gdbscm_frame_read_var (SCM self, SCM symbol_scm, SCM rest)
                       _("gdb:symbol or string"));
     }
 
-  TRY
+  try
     {
       value = read_var_value (var, block, frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return vlscm_scm_from_value (value);
 }
@@ -952,17 +936,16 @@ gdbscm_frame_select (SCM self)
 
   f_smob = frscm_get_frame_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
 
-  TRY
+  try
     {
       frame = frscm_frame_smob_to_frame (f_smob);
       if (frame != NULL)
        select_frame (frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (frame == NULL)
     {
@@ -981,15 +964,14 @@ gdbscm_newest_frame (void)
 {
   struct frame_info *frame = NULL;
 
-  TRY
+  try
     {
       frame = get_current_frame ();
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return frscm_scm_from_frame_unsafe (frame, current_inferior ());
 }
@@ -1002,15 +984,14 @@ gdbscm_selected_frame (void)
 {
   struct frame_info *frame = NULL;
 
-  TRY
+  try
     {
       frame = get_selected_frame (_("No frame is currently selected"));
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return frscm_scm_from_frame_unsafe (frame, current_inferior ());
 }
index a874e685c0c2a2225640db220f7f53084971c03f..5dd386a8ab2d31f8249f63b3a5c45f38e828703b 100644 (file)
@@ -309,7 +309,7 @@ lsscm_safe_lazy_string_to_value (SCM string, int arg_pos,
       return NULL;
     }
 
-  TRY
+  try
     {
       struct type *type = tyscm_scm_to_type (ls_smob->type);
       struct type *realtype = check_typedef (type);
@@ -336,12 +336,11 @@ lsscm_safe_lazy_string_to_value (SCM string, int arg_pos,
          break;
        }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       *except_scmp = gdbscm_scm_from_gdb_exception (except);
       return NULL;
     }
-  END_CATCH
 
   return value;
 }
index d351ed0522c132e0a0cfb1c6e81747c0dba19849..3be9fb63158703262fd301406a3cd91bffbfd750 100644 (file)
@@ -723,7 +723,7 @@ vlscm_convert_typed_value_from_scheme (const char *func_name,
 
   *except_scmp = SCM_BOOL_F;
 
-  TRY
+  try
     {
       if (vlscm_is_value (obj))
        {
@@ -824,11 +824,10 @@ vlscm_convert_typed_value_from_scheme (const char *func_name,
          value = NULL;
        }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       except_scm = gdbscm_scm_from_gdb_exception (except);
     }
-  END_CATCH
 
   if (gdbscm_is_true (except_scm))
     {
index 69bc97eddc710b71eda3ed0b73aa2dce9c0753da..ee2971222980f95a52879fc6d1be3ed6c4333a4e 100644 (file)
@@ -1006,7 +1006,7 @@ gdbscm_register_parameter_x (SCM self)
                _("parameter exists, \"show\" command is already defined"));
     }
 
-  TRY
+  try
     {
       add_setshow_generic (p_smob->type, p_smob->cmd_class,
                           p_smob->cmd_name, p_smob,
@@ -1018,11 +1018,10 @@ gdbscm_register_parameter_x (SCM self)
                           set_list, show_list,
                           &p_smob->set_command, &p_smob->show_command);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   /* Note: At this point the parameter exists in gdb.
      So no more errors after this point.  */
@@ -1064,15 +1063,14 @@ gdbscm_parameter_value (SCM self)
       if (name == NULL)
        gdbscm_throw (except_scm);
       newarg = concat ("show ", name.get (), (char *) NULL);
-      TRY
+      try
        {
          found = lookup_cmd_composition (newarg, &alias, &prefix, &cmd);
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
          except = ex;
        }
-      END_CATCH
 
       xfree (newarg);
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
index 2950b1e39ec9e98157f01a54e9b99134dd17f72a..20557f8233ad993625db611aa5bbef02a8efeeb6 100644 (file)
@@ -272,18 +272,17 @@ ioscm_write (SCM port, const void *data, size_t size)
   if (scm_is_eq (port, input_port_scm))
     return;
 
-  TRY
+  try
     {
       if (scm_is_eq (port, error_port_scm))
        fputsn_filtered ((const char *) data, size, gdb_stderr);
       else
        fputsn_filtered ((const char *) data, size, gdb_stdout);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 }
 
 /* Flush gdb's stdout or stderr.  */
index e5096944b680f0ea43e6772c21d2ad26c25a29d3..6706f826852f12545f9dd5cdfebf55f871b2785f 100644 (file)
@@ -524,7 +524,7 @@ ppscm_pretty_print_one_value (SCM printer, struct value **out_value,
   SCM result = SCM_BOOL_F;
 
   *out_value = NULL;
-  TRY
+  try
     {
       pretty_printer_worker_smob *w_smob
        = (pretty_printer_worker_smob *) SCM_SMOB_DATA (printer);
@@ -558,10 +558,9 @@ ppscm_pretty_print_one_value (SCM printer, struct value **out_value,
            (_("invalid result from pretty-printer to-string"), result);
        }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
     }
-  END_CATCH
 
   return result;
 }
index de3a1589e4615ad9d2dbe8a4e7456088c5458dca..65eb1014758c8ee3696b4576dfe019468c7578db 100644 (file)
@@ -486,15 +486,14 @@ gdbscm_symbol_needs_frame_p (SCM self)
   struct symbol *symbol = s_smob->symbol;
   int result = 0;
 
-  TRY
+  try
     {
       result = symbol_read_needs_frame (symbol);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return scm_from_bool (result);
 }
@@ -539,7 +538,7 @@ gdbscm_symbol_value (SCM self, SCM rest)
                                 _("cannot get the value of a typedef"));
     }
 
-  TRY
+  try
     {
       if (f_smob != NULL)
        {
@@ -557,11 +556,10 @@ gdbscm_symbol_value (SCM self, SCM rest)
         can happen with nested functions).  */
       value = read_var_value (symbol, NULL, frame_info);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return vlscm_scm_from_value (value);
 }
@@ -604,30 +602,28 @@ gdbscm_lookup_symbol (SCM name_scm, SCM rest)
     {
       struct frame_info *selected_frame;
 
-      TRY
+      try
        {
          selected_frame = get_selected_frame (_("no frame selected"));
          block = get_frame_block (selected_frame, NULL);
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
          xfree (name);
          GDBSCM_HANDLE_GDB_EXCEPTION (ex);
        }
-      END_CATCH
     }
 
   struct gdb_exception except = exception_none;
-  TRY
+  try
     {
       symbol = lookup_symbol (name, block, (domain_enum) domain,
                              &is_a_field_of_this).symbol;
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       except = ex;
     }
-  END_CATCH
 
   xfree (name);
   GDBSCM_HANDLE_GDB_EXCEPTION (except);
@@ -656,15 +652,14 @@ gdbscm_lookup_global_symbol (SCM name_scm, SCM rest)
                              name_scm, &name, rest,
                              &domain_arg_pos, &domain);
 
-  TRY
+  try
     {
       symbol = lookup_global_symbol (name, NULL, (domain_enum) domain).symbol;
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       except = ex;
     }
-  END_CATCH
 
   xfree (name);
   GDBSCM_HANDLE_GDB_EXCEPTION (except);
index 5ba7755743977e14f2a65b1417e3ea2dc7df657d..8879c321423ecb25e66fb434117d5889b999e69b 100644 (file)
@@ -591,17 +591,16 @@ gdbscm_find_pc_line (SCM pc_scm)
 
   gdbscm_parse_function_args (FUNC_NAME, SCM_ARG1, NULL, "U", pc_scm, &pc_ull);
 
-  TRY
+  try
     {
       CORE_ADDR pc = (CORE_ADDR) pc_ull;
 
       sal = find_pc_line (pc, 0);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return stscm_scm_from_sal (sal);
 }
index 2d2e3ddb3e1475caca3cc2ef24528804661a3a1f..ee0bfa7e1a358bb32c02180d3120b99b8644e59d 100644 (file)
@@ -105,19 +105,18 @@ tyscm_type_smob_type (type_smob *t_smob)
 static std::string
 tyscm_type_name (struct type *type)
 {
-  TRY
+  try
     {
       string_file stb;
 
       LA_PRINT_TYPE (type, "", &stb, -1, 0, &type_print_raw_options);
       return std::move (stb.string ());
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       SCM excp = gdbscm_scm_from_gdb_exception (except);
       gdbscm_throw (excp);
     }
-  END_CATCH
 
   gdb_assert_not_reached ("no way to get here");
 }
@@ -235,15 +234,14 @@ tyscm_equal_p_type_smob (SCM type1_scm, SCM type2_scm)
   type1 = type1_smob->type;
   type2 = type2_smob->type;
 
-  TRY
+  try
     {
       result = types_deeply_equal (type1, type2);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return scm_from_bool (result);
 }
@@ -629,14 +627,13 @@ gdbscm_type_sizeof (SCM self)
     = tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   struct type *type = t_smob->type;
 
-  TRY
+  try
     {
       check_typedef (type);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
     }
-  END_CATCH
 
   /* Ignore exceptions.  */
 
@@ -653,15 +650,14 @@ gdbscm_type_strip_typedefs (SCM self)
     = tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   struct type *type = t_smob->type;
 
-  TRY
+  try
     {
       type = check_typedef (type);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return tyscm_scm_from_type (type);
 }
@@ -675,15 +671,14 @@ tyscm_get_composite (struct type *type)
 
   for (;;)
     {
-      TRY
+      try
        {
          type = check_typedef (type);
        }
-      CATCH (except, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &except)
        {
          GDBSCM_HANDLE_GDB_EXCEPTION (except);
        }
-      END_CATCH
 
       if (TYPE_CODE (type) != TYPE_CODE_PTR
          && TYPE_CODE (type) != TYPE_CODE_REF)
@@ -730,17 +725,16 @@ tyscm_array_1 (SCM self, SCM n1_scm, SCM n2_scm, int is_vector,
                                 _("Array length must not be negative"));
     }
 
-  TRY
+  try
     {
       array = lookup_array_range_type (type, n1, n2);
       if (is_vector)
        make_vector_type (array);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return tyscm_scm_from_type (array);
 }
@@ -787,15 +781,14 @@ gdbscm_type_pointer (SCM self)
     = tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   struct type *type = t_smob->type;
 
-  TRY
+  try
     {
       type = lookup_pointer_type (type);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return tyscm_scm_from_type (type);
 }
@@ -849,15 +842,14 @@ gdbscm_type_reference (SCM self)
     = tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   struct type *type = t_smob->type;
 
-  TRY
+  try
     {
       type = lookup_lvalue_reference_type (type);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return tyscm_scm_from_type (type);
 }
@@ -887,15 +879,14 @@ gdbscm_type_const (SCM self)
     = tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   struct type *type = t_smob->type;
 
-  TRY
+  try
     {
       type = make_cv_type (1, 0, type, NULL);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return tyscm_scm_from_type (type);
 }
@@ -910,15 +901,14 @@ gdbscm_type_volatile (SCM self)
     = tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   struct type *type = t_smob->type;
 
-  TRY
+  try
     {
       type = make_cv_type (0, 1, type, NULL);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return tyscm_scm_from_type (type);
 }
@@ -933,15 +923,14 @@ gdbscm_type_unqualified (SCM self)
     = tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   struct type *type = t_smob->type;
 
-  TRY
+  try
     {
       type = make_cv_type (0, 0, type, NULL);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return tyscm_scm_from_type (type);
 }
@@ -1230,7 +1219,7 @@ tyscm_lookup_typename (const char *type_name, const struct block *block)
 {
   struct type *type = NULL;
 
-  TRY
+  try
     {
       if (startswith (type_name, "struct "))
        type = lookup_struct (type_name + 7, NULL);
@@ -1242,11 +1231,10 @@ tyscm_lookup_typename (const char *type_name, const struct block *block)
        type = lookup_typename (current_language, get_current_arch (),
                                type_name, block, 0);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       return NULL;
     }
-  END_CATCH
 
   return type;
 }
index 658924b1197296311b627846aa3da916bef564b9..7f119a202ed8e84c11cf0f00c88eeafa6bc5397e 100644 (file)
@@ -156,18 +156,17 @@ vlscm_print_value_smob (SCM self, SCM port, scm_print_state *pstate)
      instead of writingp.  */
   opts.raw = !!pstate->writingp;
 
-  TRY
+  try
     {
       string_file stb;
 
       common_val_print (v_smob->value, &stb, 0, &opts, current_language);
       scm_puts (stb.c_str (), port);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (pstate->writingp)
     scm_puts (">", port);
@@ -187,15 +186,14 @@ vlscm_equal_p_value_smob (SCM v1, SCM v2)
   const value_smob *v2_smob = (value_smob *) SCM_SMOB_DATA (v2);
   int result = 0;
 
-  TRY
+  try
     {
       result = value_equal (v1_smob->value, v2_smob->value);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return scm_from_bool (result);
 }
@@ -392,14 +390,13 @@ gdbscm_value_address (SCM self)
 
          SCM address = SCM_BOOL_F;
 
-         TRY
+         try
            {
              address = vlscm_scm_from_value (value_addr (value));
            }
-         CATCH (except, RETURN_MASK_ALL)
+         catch (const gdb_exception_RETURN_MASK_ALL &except)
            {
            }
-         END_CATCH
 
          if (gdbscm_is_exception (address))
            return address;
@@ -496,7 +493,7 @@ gdbscm_value_dynamic_type (SCM self)
   if (! SCM_UNBNDP (v_smob->dynamic_type))
     return v_smob->dynamic_type;
 
-  TRY
+  try
     {
       scoped_value_mark free_values;
 
@@ -532,11 +529,10 @@ gdbscm_value_dynamic_type (SCM self)
          type = NULL;
        }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (type == NULL)
     v_smob->dynamic_type = gdbscm_value_type (self);
@@ -684,15 +680,14 @@ gdbscm_value_call (SCM self, SCM args)
   long args_count;
   struct value **vargs = NULL;
 
-  TRY
+  try
     {
       ftype = check_typedef (value_type (function));
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   SCM_ASSERT_TYPE (TYPE_CODE (ftype) == TYPE_CODE_FUNC, self,
                   SCM_ARG1, FUNC_NAME,
@@ -751,17 +746,16 @@ gdbscm_value_to_bytevector (SCM self)
 
   type = value_type (value);
 
-  TRY
+  try
     {
       type = check_typedef (type);
       length = TYPE_LENGTH (type);
       contents = value_contents (value);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   bv = scm_c_make_bytevector (length);
   memcpy (SCM_BYTEVECTOR_CONTENTS (bv), contents, length);
@@ -795,31 +789,29 @@ gdbscm_value_to_bool (SCM self)
 
   type = value_type (value);
 
-  TRY
+  try
     {
       type = check_typedef (type);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   SCM_ASSERT_TYPE (is_intlike (type, 1), self, SCM_ARG1, FUNC_NAME,
                   _("integer-like gdb value"));
 
-  TRY
+  try
     {
       if (TYPE_CODE (type) == TYPE_CODE_PTR)
        l = value_as_address (value);
       else
        l = value_as_long (value);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   return scm_from_bool (l != 0);
 }
@@ -838,31 +830,29 @@ gdbscm_value_to_integer (SCM self)
 
   type = value_type (value);
 
-  TRY
+  try
     {
       type = check_typedef (type);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   SCM_ASSERT_TYPE (is_intlike (type, 1), self, SCM_ARG1, FUNC_NAME,
                   _("integer-like gdb value"));
 
-  TRY
+  try
     {
       if (TYPE_CODE (type) == TYPE_CODE_PTR)
        l = value_as_address (value);
       else
        l = value_as_long (value);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   if (TYPE_UNSIGNED (type))
     return gdbscm_scm_from_ulongest (l);
@@ -885,20 +875,19 @@ gdbscm_value_to_real (SCM self)
 
   type = value_type (value);
 
-  TRY
+  try
     {
       type = check_typedef (type);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   SCM_ASSERT_TYPE (is_intlike (type, 0) || TYPE_CODE (type) == TYPE_CODE_FLT,
                   self, SCM_ARG1, FUNC_NAME, _("number"));
 
-  TRY
+  try
     {
       if (is_floating_value (value))
        {
@@ -916,11 +905,10 @@ gdbscm_value_to_real (SCM self)
          check = value_from_longest (type, (LONGEST) d);
        }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   /* TODO: Is there a better way to check if the value fits?  */
   if (!value_equal (value, check))
@@ -1004,18 +992,17 @@ gdbscm_value_to_string (SCM self, SCM rest)
   /* We don't assume anything about the result of scm_port_conversion_strategy.
      From this point on, if errors is not 'errors, use 'substitute.  */
 
-  TRY
+  try
     {
       gdb::unique_xmalloc_ptr<gdb_byte> buffer;
       LA_GET_STRING (value, &buffer, &length, &char_type, &la_encoding);
       buffer_contents = buffer.release ();
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       xfree (encoding);
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   /* If errors is "error", scm_from_stringn may throw a Scheme exception.
      Make sure we don't leak.  This is done via scm_dynwind_begin, et.al.  */
@@ -1077,7 +1064,7 @@ gdbscm_value_to_lazy_string (SCM self, SCM rest)
                                 _("invalid length"));
     }
 
-  TRY
+  try
     {
       scoped_value_mark free_values;
 
@@ -1132,11 +1119,10 @@ gdbscm_value_to_lazy_string (SCM self, SCM rest)
 
       result = lsscm_make_lazy_string (addr, length, encoding, type);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       except = ex;
     }
-  END_CATCH
 
   xfree (encoding);
   GDBSCM_HANDLE_GDB_EXCEPTION (except);
@@ -1191,15 +1177,14 @@ gdbscm_value_print (SCM self)
 
   string_file stb;
 
-  TRY
+  try
     {
       common_val_print (value, &stb, 0, &opts, current_language);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDBSCM_HANDLE_GDB_EXCEPTION (except);
     }
-  END_CATCH
 
   /* Use SCM_FAILED_CONVERSION_QUESTION_MARK to ensure this doesn't
      throw an error if the encoding fails.
index fa6b86f1c89baacddb49af0254e783ca21d1fc6c..01bfb2c4c20c8bb5aafeaca58566c18a91df36f4 100644 (file)
@@ -402,7 +402,7 @@ i386_linux_handle_segmentation_fault (struct gdbarch *gdbarch,
   if (!i386_mpx_enabled ())
     return;
 
-  TRY
+  try
     {
       /* Sigcode evaluates if the actual segfault is a boundary violation.  */
       sig_code = parse_and_eval_long ("$_siginfo.si_code\n");
@@ -414,11 +414,10 @@ i386_linux_handle_segmentation_fault (struct gdbarch *gdbarch,
       access
         = parse_and_eval_long ("$_siginfo._sifields._sigfault.si_addr");
     }
-  CATCH (exception, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &exception)
     {
       return;
     }
-  END_CATCH
 
   /* If this is not a boundary violation just return.  */
   if (sig_code != SIG_CODE_BONDARY_FAULT)
index 4e63832b0e6f6ec0017d234e5aa8f85691be3466..27f2edf97b552fc8211c6f3cf9cbba3c2d36d5d3 100644 (file)
@@ -2082,16 +2082,15 @@ i386_frame_cache (struct frame_info *this_frame, void **this_cache)
   cache = i386_alloc_frame_cache ();
   *this_cache = cache;
 
-  TRY
+  try
     {
       i386_frame_cache_1 (this_frame, cache);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
        throw_exception (ex);
     }
-  END_CATCH
 
   return cache;
 }
@@ -2252,7 +2251,7 @@ i386_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
   cache = i386_alloc_frame_cache ();
   *this_cache = cache;
 
-  TRY
+  try
     {
       cache->pc = get_frame_func (this_frame);
 
@@ -2266,12 +2265,11 @@ i386_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
 
       cache->base_p = 1;
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
        throw_exception (ex);
     }
-  END_CATCH
 
   return cache;
 }
@@ -2438,7 +2436,7 @@ i386_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
 
   cache = i386_alloc_frame_cache ();
 
-  TRY
+  try
     {
       get_frame_register (this_frame, I386_ESP_REGNUM, buf);
       cache->base = extract_unsigned_integer (buf, 4, byte_order) - 4;
@@ -2462,12 +2460,11 @@ i386_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
 
       cache->base_p = 1;
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
        throw_exception (ex);
     }
-  END_CATCH
 
   *this_cache = cache;
   return cache;
index d0e19d5f824305df62c62ba408b2dbd22aad3515..0aca863490a687c96136f028e26b909b8641d559 100644 (file)
@@ -67,11 +67,11 @@ inferior_event_handler (enum inferior_event_type event_type,
          /* Don't propagate breakpoint commands errors.  Either we're
             stopping or some command resumes the inferior.  The user will
             be informed.  */
-         TRY
+         try
            {
              bpstat_do_actions ();
            }
-         CATCH (e, RETURN_MASK_ALL)
+         catch (const gdb_exception_RETURN_MASK_ALL &e)
            {
              /* If the user was running a foreground execution
                 command, then propagate the error so that the prompt
@@ -83,7 +83,6 @@ inferior_event_handler (enum inferior_event_type event_type,
              else
                exception_print (gdb_stderr, e);
            }
-         END_CATCH
        }
       break;
 
index 50fae6d64f531a0c04ece078742530ffeb80c586..0e5b6aa13270c866fa1cce5a5bdb1a4311d66e70 100644 (file)
@@ -597,7 +597,7 @@ run_inferior_call (struct call_thread_fsm *sm,
   /* We want to print return value, please...  */
   call_thread->control.proceed_to_finish = 1;
 
-  TRY
+  try
     {
       proceed (real_pc, GDB_SIGNAL_0);
 
@@ -605,11 +605,10 @@ run_inferior_call (struct call_thread_fsm *sm,
         target supports asynchronous execution.  */
       wait_sync_command_done ();
     }
-  CATCH (e, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &e)
     {
       caught_error = e;
     }
-  END_CATCH
 
   /* If GDB has the prompt blocked before, then ensure that it remains
      so.  normal_stop calls async_enable_stdin, so reset the prompt
index c5977c48a90fd6bb2c0d7dd31037548a70d19e12..2b24fae86df39a4acdd18baef71a4297c0687c43 100644 (file)
@@ -447,16 +447,15 @@ post_create_inferior (struct target_ops *target, int from_tty)
   thread_info *thr = inferior_thread ();
 
   thr->suspend.stop_pc = 0;
-  TRY
+  try
     {
       thr->suspend.stop_pc = regcache_read_pc (get_current_regcache ());
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
        throw_exception (ex);
     }
-  END_CATCH
 
   if (exec_bfd)
     {
@@ -1646,18 +1645,17 @@ print_return_value (struct ui_out *uiout, struct return_value_info *rv)
       || TYPE_CODE (check_typedef (rv->type)) == TYPE_CODE_VOID)
     return;
 
-  TRY
+  try
     {
       /* print_return_value_1 can throw an exception in some
         circumstances.  We need to catch this so that we still
         delete the breakpoint.  */
       print_return_value_1 (uiout, rv);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       exception_print (gdb_stdout, ex);
     }
-  END_CATCH
 }
 
 /* Data for the FSM that manages the finish command.  */
index e441281ca8a9f27a6ed450d59b200e2290cf3e43..9bda7fca81d0b961a52d67fe22dc71bd122eccb3 100644 (file)
@@ -1776,11 +1776,11 @@ displaced_step_prepare (thread_info *thread)
 {
   int prepared = -1;
 
-  TRY
+  try
     {
       prepared = displaced_step_prepare_throw (thread);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       struct displaced_step_inferior_state *displaced_state;
 
@@ -1808,7 +1808,6 @@ displaced_step_prepare (thread_info *thread)
        = get_displaced_stepping_state (thread->inf);
       displaced_state->failed_before = 1;
     }
-  END_CATCH
 
   return prepared;
 }
@@ -2612,11 +2611,11 @@ resume_1 (enum gdb_signal sig)
 static void
 resume (gdb_signal sig)
 {
-  TRY
+  try
     {
       resume_1 (sig);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       /* If resuming is being aborted for any reason, delete any
         single-step breakpoint resume_1 may have created, to avoid
@@ -2627,7 +2626,6 @@ resume (gdb_signal sig)
        delete_single_step_breakpoints (inferior_thread ());
       throw_exception (ex);
     }
-  END_CATCH
 }
 
 \f
@@ -7270,7 +7268,7 @@ insert_exception_resume_breakpoint (struct thread_info *tp,
                                    struct frame_info *frame,
                                    struct symbol *sym)
 {
-  TRY
+  try
     {
       struct block_symbol vsym;
       struct value *value;
@@ -7301,11 +7299,10 @@ insert_exception_resume_breakpoint (struct thread_info *tp,
          inferior_thread ()->control.exception_resume_breakpoint = bp;
        }
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       /* We want to ignore errors here.  */
     }
-  END_CATCH
 }
 
 /* A helper for check_exception_resume that sets an
@@ -7364,7 +7361,7 @@ check_exception_resume (struct execution_control_state *ecs,
   if (!func)
     return;
 
-  TRY
+  try
     {
       const struct block *b;
       struct block_iterator iter;
@@ -7401,10 +7398,9 @@ check_exception_resume (struct execution_control_state *ecs,
            }
        }
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
     }
-  END_CATCH
 }
 
 static void
@@ -7531,18 +7527,17 @@ keep_going_pass_signal (struct execution_control_state *ecs)
        stop_all_threads ();
 
       /* Stop stepping if inserting breakpoints fails.  */
-      TRY
+      try
        {
          insert_breakpoints ();
        }
-      CATCH (e, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &e)
        {
          exception_print (gdb_stderr, e);
          stop_waiting (ecs);
          clear_step_over_info ();
          return;
        }
-      END_CATCH
 
       ecs->event_thread->control.trap_expected = (remove_bp || remove_wps);
 
@@ -8064,16 +8059,15 @@ normal_stop (void)
     {
       stop_context saved_context;
 
-      TRY
+      try
        {
          execute_cmd_pre_hook (stop_command);
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
          exception_fprintf (gdb_stderr, ex,
                             "Error while running hook_stop:\n");
        }
-      END_CATCH
 
       /* If the stop hook resumes the target, then there's no point in
         trying to notify about the previous stop; its context is
@@ -8770,11 +8764,11 @@ restore_infcall_control_state (struct infcall_control_state *inf_status)
       /* The point of the try/catch is that if the stack is clobbered,
          walking the stack might encounter a garbage pointer and
          error() trying to dereference it.  */
-      TRY
+      try
        {
          restore_selected_frame (inf_status->selected_frame_id);
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          exception_fprintf (gdb_stderr, ex,
                             "Unable to restore previously selected frame:\n");
@@ -8782,7 +8776,6 @@ restore_infcall_control_state (struct infcall_control_state *inf_status)
             innermost frame.  */
          select_frame (get_current_frame ());
        }
-      END_CATCH
     }
 
   delete inf_status;
index 1f87bf2538d010f160b0a5af4ef7b5e8ddf5a765..1b78a93653c734baca0f23a003146a5b9134d250 100644 (file)
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -849,17 +849,16 @@ jit_reader_try_read_symtab (struct jit_code_entry *code_entry,
   gdb_mem = (gdb_byte *) xmalloc (code_entry->symfile_size);
 
   status = 1;
-  TRY
+  try
     {
       if (target_read_memory (code_entry->symfile_addr, gdb_mem,
                              code_entry->symfile_size))
        status = 0;
     }
-  CATCH (e, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &e)
     {
       status = 0;
     }
-  END_CATCH
 
   if (status)
     {
index ea294e670b66df77157291adffd400184b39d7c9..0dc4cb301190e88ce74430ea37dd397eeac2fc56 100644 (file)
@@ -172,18 +172,17 @@ set_language_command (const char *ignore,
              /* Enter auto mode.  Set to the current frame's language, if
                  known, or fallback to the initial language.  */
              language_mode = language_mode_auto;
-             TRY
+             try
                {
                  struct frame_info *frame;
 
                  frame = get_selected_frame (NULL);
                  flang = get_frame_language (frame);
                }
-             CATCH (ex, RETURN_MASK_ERROR)
+             catch (const gdb_exception_RETURN_MASK_ERROR &ex)
                {
                  flang = language_unknown;
                }
-             END_CATCH
 
              if (flang != language_unknown)
                set_language (flang);
index 2f39d0908481540c8c8b5963784fc7b295cc7e44..04eb93857152b0dc1140d263a4985603fd016867 100644 (file)
@@ -2383,16 +2383,15 @@ convert_explicit_location_to_linespec (struct linespec_state *self,
 
   if (source_filename != NULL)
     {
-      TRY
+      try
        {
          *result->file_symtabs
            = symtabs_from_filename (source_filename, self->search_pspace);
        }
-      CATCH (except, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &except)
        {
          source_file_not_found_error (source_filename);
        }
-      END_CATCH
       result->explicit_loc.source_filename = xstrdup (source_filename);
     }
   else
@@ -2608,17 +2607,16 @@ parse_linespec (linespec_parser *parser, const char *arg,
       gdb::unique_xmalloc_ptr<char> user_filename = copy_token_string (token);
 
       /* Check if the input is a filename.  */
-      TRY
+      try
        {
          *PARSER_RESULT (parser)->file_symtabs
            = symtabs_from_filename (user_filename.get (),
                                     PARSER_STATE (parser)->search_pspace);
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          file_exception = ex;
        }
-      END_CATCH
 
       if (file_exception.reason >= 0)
        {
@@ -2923,7 +2921,7 @@ linespec_complete_label (completion_tracker &tracker,
 
   line_offset unknown_offset = { 0, LINE_OFFSET_UNKNOWN };
 
-  TRY
+  try
     {
       convert_explicit_location_to_linespec (PARSER_STATE (&parser),
                                             PARSER_RESULT (&parser),
@@ -2932,11 +2930,10 @@ linespec_complete_label (completion_tracker &tracker,
                                             func_name_match_type,
                                             NULL, unknown_offset);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       return;
     }
-  END_CATCH
 
   complete_label (tracker, &parser, label_name);
 }
@@ -2959,14 +2956,13 @@ linespec_complete (completion_tracker &tracker, const char *text,
 
   /* Parse as much as possible.  parser.completion_word will hold
      furthest completion point we managed to parse to.  */
-  TRY
+  try
     {
       parse_linespec (&parser, text, match_type);
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
     }
-  END_CATCH
 
   if (parser.completion_quote_char != '\0'
       && parser.completion_quote_end != NULL
@@ -3148,17 +3144,16 @@ event_location_to_sals (linespec_parser *parser,
     case LINESPEC_LOCATION:
       {
        PARSER_STATE (parser)->is_linespec = 1;
-       TRY
+       try
          {
            const linespec_location *ls = get_linespec_location (location);
            result = parse_linespec (parser,
                                     ls->spec_string, ls->match_type);
          }
-       CATCH (except, RETURN_MASK_ERROR)
+       catch (const gdb_exception_RETURN_MASK_ERROR &except)
          {
            throw_exception (except);
          }
-       END_CATCH
       }
       break;
 
@@ -3959,7 +3954,7 @@ find_linespec_symbols (struct linespec_state *state,
       if (!classes.empty ())
        {
          /* Now locate a list of suitable methods named METHOD.  */
-         TRY
+         try
            {
              find_method (state, file_symtabs,
                           klass.c_str (), method.c_str (),
@@ -3968,12 +3963,11 @@ 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 (except, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &except)
            {
              if (except.error != NOT_FOUND_ERROR)
                throw_exception (except);
            }
-         END_CATCH
        }
     }
 }
index fe401b2b3b2cac910cb1810a12733de253e88bdb..229f660eb919320440d68e9648019125f5bb348b 100644 (file)
@@ -427,19 +427,18 @@ public:
     if (m_oldfp != nullptr)
       {
        /* Switch back to inferior_ptid.  */
-       TRY
+       try
          {
            remove_breakpoints ();
            fork_load_infrun_state (m_oldfp);
            insert_breakpoints ();
          }
-       CATCH (ex, RETURN_MASK_ALL)
+       catch (const gdb_exception_RETURN_MASK_ALL &ex)
          {
            warning (_("Couldn't restore checkpoint state in %s: %s"),
                     target_pid_to_str (m_oldfp->ptid).c_str (),
                     ex.what ());
          }
-       END_CATCH
       }
   }
 
index 13b76f813e6a4dd15e6b4bcc18f995738bb4df80..c2eb55f7d86c535690c5f5acd5cbff94f63538be 100644 (file)
@@ -1188,11 +1188,11 @@ linux_nat_target::attach (const char *args, int from_tty)
   /* Make sure we report all signals during attach.  */
   pass_signals ({});
 
-  TRY
+  try
     {
       inf_ptrace_target::attach (args, from_tty);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       pid_t pid = parse_pid_to_attach (args);
       std::string reason = linux_ptrace_attach_fail_reason (pid);
@@ -1203,7 +1203,6 @@ linux_nat_target::attach (const char *args, int from_tty)
       else
        throw_error (ex.error, "%s", ex.what ());
     }
-  END_CATCH
 
   /* The ptrace base target adds the main thread with (pid,0,0)
      format.  Decorate it with lwp info.  */
@@ -1402,16 +1401,15 @@ detach_one_lwp (struct lwp_info *lp, int *signo_p)
   /* Preparing to resume may try to write registers, and fail if the
      lwp is zombie.  If that happens, ignore the error.  We'll handle
      it below, when detach fails with ESRCH.  */
-  TRY
+  try
     {
       linux_target->low_prepare_to_resume (lp);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (!check_ptrace_stopped_lwp_gone (lp))
        throw_exception (ex);
     }
-  END_CATCH
 
   if (ptrace (PTRACE_DETACH, lwpid, 0, signo) < 0)
     {
@@ -1585,16 +1583,15 @@ check_ptrace_stopped_lwp_gone (struct lwp_info *lp)
 static void
 linux_resume_one_lwp (struct lwp_info *lp, int step, enum gdb_signal signo)
 {
-  TRY
+  try
     {
       linux_resume_one_lwp_throw (lp, step, signo);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (!check_ptrace_stopped_lwp_gone (lp))
        throw_exception (ex);
     }
-  END_CATCH
 }
 
 /* Resume LP.  */
@@ -3526,7 +3523,7 @@ resume_stopped_resumed_lwps (struct lwp_info *lp, const ptid_t wait_ptid)
       struct regcache *regcache = get_thread_regcache (lp->ptid);
       struct gdbarch *gdbarch = regcache->arch ();
 
-      TRY
+      try
        {
          CORE_ADDR pc = regcache_read_pc (regcache);
          int leave_stopped = 0;
@@ -3552,12 +3549,11 @@ resume_stopped_resumed_lwps (struct lwp_info *lp, const ptid_t wait_ptid)
              linux_resume_one_lwp_throw (lp, lp->step, GDB_SIGNAL_0);
            }
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          if (!check_ptrace_stopped_lwp_gone (lp))
            throw_exception (ex);
        }
-      END_CATCH
     }
 
   return 0;
index f6c4f7b2081d727874d60d4f382121e600324cbe..ccc5d17015c6d5db31274a475f6d0659a1639d35 100644 (file)
@@ -1926,15 +1926,14 @@ linux_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
     }
 
   /* Thread register information.  */
-  TRY
+  try
     {
       update_thread_list ();
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
       exception_print (gdb_stderr, e);
     }
-  END_CATCH
 
   /* Like the kernel, prefer dumping the signalled thread first.
      "First thread" is what tools use to infer the signalled thread.
index a735807f58ccbd726df2813e10af98289d7825b2..e1b2ae6f4b811d03f4f6dbea3e27eb4523165c6c 100644 (file)
@@ -497,12 +497,12 @@ static int
 thread_db_find_new_threads_silently (thread_info *stopped)
 {
 
-  TRY
+  try
     {
       thread_db_find_new_threads_2 (stopped, true);
     }
 
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       if (libthread_db_debug)
        exception_fprintf (gdb_stdlog, except,
@@ -532,7 +532,6 @@ thread_db_find_new_threads_silently (thread_info *stopped)
          return 1;
        }
     }
-  END_CATCH
 
   return 0;
 }
@@ -757,7 +756,7 @@ check_thread_db (struct thread_db_info *info, bool log_progress)
      fail.  */
   linux_stop_and_wait_all_lwps ();
 
-  TRY
+  try
     {
       td_err_e err = td_ta_thr_iter_p (info->thread_agent,
                                       check_thread_db_callback,
@@ -773,7 +772,7 @@ check_thread_db (struct thread_db_info *info, bool log_progress)
       if (!tdb_testinfo->threads_seen)
        error (_("no threads seen"));
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       if (warning_pre_print)
        fputs_unfiltered (warning_pre_print, gdb_stderr);
@@ -783,7 +782,6 @@ check_thread_db (struct thread_db_info *info, bool log_progress)
 
       test_passed = false;
     }
-  END_CATCH
 
   if (test_passed && log_progress)
     debug_printf (_("libthread_db integrity checks passed.\n"));
@@ -1509,7 +1507,7 @@ find_new_threads_once (struct thread_db_info *info, int iteration,
   /* See comment in thread_db_update_thread_list.  */
   gdb_assert (info->td_ta_thr_iter_p != NULL);
 
-  TRY
+  try
     {
       /* Iterate over all user-space threads to discover new threads.  */
       err = info->td_ta_thr_iter_p (info->thread_agent,
@@ -1520,7 +1518,7 @@ find_new_threads_once (struct thread_db_info *info, int iteration,
                                    TD_SIGNO_MASK,
                                    TD_THR_ANY_USER_FLAGS);
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       if (libthread_db_debug)
        {
@@ -1528,7 +1526,6 @@ find_new_threads_once (struct thread_db_info *info, int iteration,
                             "Warning: find_new_threads_once: ");
        }
     }
-  END_CATCH
 
   if (libthread_db_debug)
     {
index 97ffc3fba482abdf8acca6d336b8fbe15eb3cbc7..8abd9defac58515e8187aecda85f72fe4aa074d3 100644 (file)
@@ -365,7 +365,7 @@ static int
 catch_command_errors (catch_command_errors_const_ftype command,
                      const char *arg, int from_tty)
 {
-  TRY
+  try
     {
       int was_sync = current_ui->prompt_state == PROMPT_BLOCKED;
 
@@ -373,11 +373,10 @@ catch_command_errors (catch_command_errors_const_ftype command,
 
       maybe_wait_sync_command_done (was_sync);
     }
-  CATCH (e, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &e)
     {
       return handle_command_errors (e);
     }
-  END_CATCH
 
   return 1;
 }
@@ -1169,15 +1168,14 @@ captured_main (void *data)
      change - SET_TOP_LEVEL() - has been eliminated.  */
   while (1)
     {
-      TRY
+      try
        {
          captured_command_loop ();
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
          exception_print (gdb_stderr, ex);
        }
-      END_CATCH
     }
   /* No exit -- exit is through quit_command.  */
 }
@@ -1185,15 +1183,14 @@ captured_main (void *data)
 int
 gdb_main (struct captured_main_args *args)
 {
-  TRY
+  try
     {
       captured_main (args);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       exception_print (gdb_stderr, ex);
     }
-  END_CATCH
 
   /* The only way to end up here is by an error (normal exit is
      handled by quit_force()), hence always return an error status.  */
index 4f25977311d88fa0610ef13eb54b6c53114a5c88..bf35891589431a1dab508036ca12599d6396fdf0 100644 (file)
@@ -54,15 +54,14 @@ breakpoint_notify (struct breakpoint *b)
 {
   if (mi_can_breakpoint_notify)
     {
-      TRY
+      try
        {
          print_breakpoint (b);
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
          exception_print (gdb_stderr, ex);
        }
-      END_CATCH
     }
 }
 
index 0cec856b8375852adb5fe2ca8e2a6c9df580205f..c689d49d230ecabfb6e0d910b98fd1595555e056 100644 (file)
@@ -531,7 +531,7 @@ list_arg_or_local (const struct frame_arg *arg, enum what_to_list what,
        stb.printf (_("<error reading variable: %s>"), arg->error);
       else
        {
-         TRY
+         try
            {
              struct value_print_options opts;
 
@@ -540,12 +540,11 @@ 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 (except, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &except)
            {
              stb.printf (_("<error reading variable: %s>"),
                          except.what ());
            }
-         END_CATCH
        }
       uiout->field_stream ("value", stb);
     }
index 9c20016a3bdf82b9b26ac17ef007f220211a9a6f..26dfc4a5385766ed6637401f29e8e1eaed05c8d4 100644 (file)
@@ -823,18 +823,17 @@ mi_print_breakpoint_for_event (struct mi_interp *mi, breakpoint *bp)
      ui_out_redirect.  */
   mi_uiout->redirect (mi->event_channel);
 
-  TRY
+  try
     {
       scoped_restore restore_uiout
        = make_scoped_restore (&current_uiout, mi_uiout);
 
       print_breakpoint (bp);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       exception_print (gdb_stderr, ex);
     }
-  END_CATCH
 
   mi_uiout->redirect (NULL);
 }
index 2fbcd6556d002b9ba1c87f547f7760e643bda2a5..33cd1f89c42dbe887b397b72477fc7d569d179d2 100644 (file)
@@ -1938,16 +1938,15 @@ mi_execute_command (const char *cmd, int from_tty)
 
   target_log_command (cmd);
 
-  TRY
+  try
     {
       command = mi_parse (cmd, &token);
     }
-  CATCH (exception, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &exception)
     {
       mi_print_exception (token, exception);
       xfree (token);
     }
-  END_CATCH
 
   if (command != NULL)
     {
@@ -1966,11 +1965,11 @@ mi_execute_command (const char *cmd, int from_tty)
          timestamp (command->cmd_start);
        }
 
-      TRY
+      try
        {
          captured_mi_execute_command (current_uiout, command.get ());
        }
-      CATCH (result, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &result)
        {
          /* Like in start_event_loop, enable input and force display
             of the prompt.  Otherwise, any command that calls
@@ -1984,7 +1983,6 @@ mi_execute_command (const char *cmd, int from_tty)
          mi_print_exception (command->token, result);
          mi_out_rewind (current_uiout);
        }
-      END_CATCH
 
       bpstat_do_actions ();
 
index 83d2c056d6a9d7c2e1db44062524d8995abc9b23..20e279020841b1a3d56c9f0efb09cd468ef5ade7 100644 (file)
@@ -1297,18 +1297,17 @@ find_objc_msgcall_submethod (int (*f) (CORE_ADDR, CORE_ADDR *),
                             CORE_ADDR pc, 
                             CORE_ADDR *new_pc)
 {
-  TRY
+  try
     {
       if (f (pc, new_pc) == 0)
        return 1;
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       exception_fprintf (gdb_stderr, ex,
                         "Unable to determine target of "
                         "Objective-C method call (ignoring):\n");
     }
-  END_CATCH
 
   return 0;
 }
index b11292a86bc66bce7be21b05f1a66ff76e8775e0..5b0b9dcf9aab473585a90e944454f519ac14bda5 100644 (file)
@@ -751,18 +751,17 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
 
       thisoffset = offset;
 
-      TRY
+      try
        {
          boffset = baseclass_offset (type, i, valaddr, offset, address, val);
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          if (ex.error == NOT_AVAILABLE_ERROR)
            skip = -1;
          else
            skip = 1;
        }
-      END_CATCH
 
       if (skip == 0)
        {
index 359f6f893214670735d7b30a768eb9d54d0dba92..5ae1cb96a97b392d8605bc06ca11a147400864ed 100644 (file)
@@ -1137,11 +1137,11 @@ parse_exp_in_context (const char **stringptr, CORE_ADDR pc,
   scoped_restore_current_language lang_saver;
   set_language (lang->la_language);
 
-  TRY
+  try
     {
       lang->la_parser (&ps);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       /* If parsing for completion, allow this to succeed; but if no
         expression elements have been written, then there's nothing
@@ -1149,7 +1149,6 @@ parse_exp_in_context (const char **stringptr, CORE_ADDR pc,
       if (! ps.parse_completion || ps.expout_ptr == 0)
        throw_exception (except);
     }
-  END_CATCH
 
   /* We have to operate on an "expression *", due to la_post_parser,
      which explains this funny-looking double release.  */
@@ -1224,16 +1223,15 @@ parse_expression_for_completion (const char *string,
   int subexp;
   expr_completion_state cstate;
 
-  TRY
+  try
     {
       exp = parse_exp_in_context (&string, 0, 0, 0, 0, &subexp,
                                  nullptr, &cstate);
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       /* Nothing, EXP remains NULL.  */
     }
-  END_CATCH
 
   if (exp == NULL)
     return NULL;
index 19435602b5a1fc8e9336d0cc1b2f86a6b176d92f..e2ead9d97b0a8f82fff29b89dbb0e23966f1a8c1 100644 (file)
@@ -1827,7 +1827,7 @@ ppc_linux_spe_context (int wordsize, enum bfd_endian byte_order,
     {
       struct target_ops *target = current_top_target ();
 
-      TRY
+      try
        {
          /* We do not call target_translate_tls_address here, because
             svr4_fetch_objfile_link_map may invalidate the frame chain,
@@ -1842,11 +1842,10 @@ ppc_linux_spe_context (int wordsize, enum bfd_endian byte_order,
          spe_context_cache_ptid = inferior_ptid;
        }
 
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          return 0;
        }
-      END_CATCH
     }
 
   /* Read variable value.  */
index 5a55a1c3f09a3f802715f958cb52e1c4676980f5..8b6f1ca0323ee3ace1840f7039d3f38fe6da6b13 100644 (file)
@@ -1881,13 +1881,13 @@ do_one_display (struct display *d)
   if (d->exp == NULL)
     {
 
-      TRY
+      try
        {
          innermost_block_tracker tracker;
          d->exp = parse_expression (d->exp_string, &tracker);
          d->block = tracker.block ();
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
          /* Can't re-parse the expression.  Disable this display item.  */
          d->enabled_p = 0;
@@ -1895,7 +1895,6 @@ do_one_display (struct display *d)
                   d->exp_string, ex.what ());
          return;
        }
-      END_CATCH
     }
 
   if (d->block)
@@ -1942,7 +1941,7 @@ do_one_display (struct display *d)
 
       annotate_display_value ();
 
-      TRY
+      try
         {
          struct value *val;
          CORE_ADDR addr;
@@ -1953,12 +1952,11 @@ do_one_display (struct display *d)
            addr = gdbarch_addr_bits_remove (d->exp->gdbarch, addr);
          do_examine (d->format, d->exp->gdbarch, addr);
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          fprintf_filtered (gdb_stdout, _("<error: %s>\n"),
                            ex.what ());
        }
-      END_CATCH
     }
   else
     {
@@ -1981,18 +1979,17 @@ do_one_display (struct display *d)
       get_formatted_print_options (&opts, d->format.format);
       opts.raw = d->format.raw;
 
-      TRY
+      try
         {
          struct value *val;
 
          val = evaluate_expression (d->exp.get ());
          print_formatted (val, d->format.size, &opts, gdb_stdout);
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          fprintf_filtered (gdb_stdout, _("<error: %s>"), ex.what ());
        }
-      END_CATCH
 
       printf_filtered ("\n");
     }
@@ -2174,7 +2171,7 @@ print_variable_and_value (const char *name, struct symbol *var,
   fputs_styled (name, variable_name_style.style (), stream);
   fputs_filtered (" = ", stream);
 
-  TRY
+  try
     {
       struct value *val;
       struct value_print_options opts;
@@ -2192,12 +2189,11 @@ print_variable_and_value (const char *name, struct symbol *var,
         function.  */
       frame = NULL;
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       fprintf_filtered (stream, "<error reading variable %s (%s)>", name,
                        except.what ());
     }
-  END_CATCH
 
   fprintf_filtered (stream, "\n");
 }
index 23cb2c58326d09175f6ba42609e8c774c26aae1b..c7c6faea5cd437570bd292f33ce218983f435dda 100644 (file)
@@ -199,16 +199,15 @@ archpy_disassemble (PyObject *self, PyObject *args, PyObject *kw)
 
       string_file stb;
 
-      TRY
+      try
         {
           insn_len = gdb_print_insn (gdbarch, pc, &stb, NULL);
         }
-      CATCH (except, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &except)
         {
          gdbpy_convert_exception (except);
          return NULL;
         }
-      END_CATCH
 
       if (PyDict_SetItemString (insn_dict.get (), "addr",
                                 gdb_py_long_from_ulongest (pc))
index ba3b4f0fc38f19973bc866526df21203d12ac57b..16c717c5bb4d2dd7508574b8ea30756476310a57 100644 (file)
@@ -138,18 +138,17 @@ bppy_set_enabled (PyObject *self, PyObject *newvalue, void *closure)
   if (cmp < 0)
     return -1;
 
-  TRY
+  try
     {
       if (cmp == 1)
        enable_breakpoint (self_bp->bp);
       else
        disable_breakpoint (self_bp->bp);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_SET_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return 0;
 }
@@ -247,15 +246,14 @@ bppy_set_task (PyObject *self, PyObject *newvalue, void *closure)
       if (! gdb_py_int_as_long (newvalue, &id))
        return -1;
 
-      TRY
+      try
        {
          valid_id = valid_task_id (id);
        }
-      CATCH (except, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &except)
        {
          GDB_PY_SET_HANDLE_EXCEPTION (except);
        }
-      END_CATCH
 
       if (! valid_id)
        {
@@ -290,15 +288,14 @@ bppy_delete_breakpoint (PyObject *self, PyObject *args)
 
   BPPY_REQUIRE_VALID (self_bp);
 
-  TRY
+  try
     {
       delete_breakpoint (self_bp->bp);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   Py_RETURN_NONE;
 }
@@ -332,15 +329,14 @@ bppy_set_ignore_count (PyObject *self, PyObject *newvalue, void *closure)
   if (value < 0)
     value = 0;
 
-  TRY
+  try
     {
       set_ignore_count (self_bp->number, (int) value, 0);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_SET_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return 0;
 }
@@ -469,15 +465,14 @@ bppy_set_condition (PyObject *self, PyObject *newvalue, void *closure)
       exp = exp_holder.get ();
     }
 
-  TRY
+  try
     {
       set_breakpoint_condition (self_bp->bp, exp, 0);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       except = ex;
     }
-  END_CATCH
 
   GDB_PY_SET_HANDLE_EXCEPTION (except);
 
@@ -499,17 +494,16 @@ bppy_get_commands (PyObject *self, void *closure)
   string_file stb;
 
   current_uiout->redirect (&stb);
-  TRY
+  try
     {
       print_command_lines (current_uiout, breakpoint_commands (bp), 0);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       current_uiout->redirect (NULL);
       gdbpy_convert_exception (except);
       return NULL;
     }
-  END_CATCH
 
   current_uiout->redirect (NULL);
   return host_string_to_python_string (stb.c_str ()).release ();
@@ -530,7 +524,7 @@ bppy_set_commands (PyObject *self, PyObject *newvalue, void *closure)
   if (commands == nullptr)
     return -1;
 
-  TRY
+  try
     {
       bool first = true;
       char *save_ptr = nullptr;
@@ -546,11 +540,10 @@ 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 (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       except = ex;
     }
-  END_CATCH
 
   GDB_PY_SET_HANDLE_EXCEPTION (except);
 
@@ -801,7 +794,7 @@ bppy_init (PyObject *self, PyObject *args, PyObject *kwargs)
   bppy_pending_object->number = -1;
   bppy_pending_object->bp = NULL;
 
-  TRY
+  try
     {
       switch (type)
        {
@@ -871,13 +864,12 @@ bppy_init (PyObject *self, PyObject *args, PyObject *kwargs)
          error(_("Do not understand breakpoint type to set."));
        }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       bppy_pending_object = NULL;
       gdbpy_convert_exception (except);
       return -1;
     }
-  END_CATCH
 
   BPPY_SET_REQUIRE_VALID ((gdbpy_breakpoint_object *) self);
   return 0;
index 1677c3dcec95662a44159a884182a8b27aeca992..24321278b79e8ad0368d4be36db39bffb86c4ab2 100644 (file)
@@ -541,7 +541,7 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
 
   gdbpy_ref<> self_ref = gdbpy_ref<>::new_reference (self);
 
-  TRY
+  try
     {
       struct cmd_list_element *cmd;
 
@@ -572,7 +572,7 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
        set_cmd_completer_handle_brkchars (cmd,
                                           cmdpy_completer_handle_brkchars);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       xfree (cmd_name);
       xfree (docstring);
@@ -580,7 +580,6 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
       gdbpy_convert_exception (except);
       return -1;
     }
-  END_CATCH
 
   return 0;
 }
index f3affbd0f432da48df74bead2ca4759d581a1514..6faffd2e86f36a4602d11da11b51812de53c8a49 100644 (file)
@@ -101,7 +101,7 @@ bpfinishpy_pre_stop_hook (struct gdbpy_breakpoint_object *bp_obj)
   if (!self_finishbp->return_type)
     return;
 
-  TRY
+  try
     {
       struct value *function =
         value_object_to_value (self_finishbp->function_value);
@@ -121,12 +121,11 @@ bpfinishpy_pre_stop_hook (struct gdbpy_breakpoint_object *bp_obj)
           self_finishbp->return_value = Py_None;
         }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       gdbpy_convert_exception (except);
       gdbpy_print_stack ();
     }
-  END_CATCH
 }
 
 /* Triggered when gdbpy_should_stop has triggered the `stop' callback
@@ -136,18 +135,17 @@ void
 bpfinishpy_post_stop_hook (struct gdbpy_breakpoint_object *bp_obj)
 {
 
-  TRY
+  try
     {
       /* Can't delete it here, but it will be removed at the next stop.  */
       disable_breakpoint (bp_obj->bp);
       gdb_assert (bp_obj->bp->disposition == disp_del);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       gdbpy_convert_exception (except);
       gdbpy_print_stack ();
     }
-  END_CATCH
 }
 
 /* Python function to create a new breakpoint.  */
@@ -172,7 +170,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
                                        &frame_obj, &internal))
     return -1;
 
-  TRY
+  try
     {
       /* Default frame to newest frame if necessary.  */
       if (frame_obj == NULL)
@@ -210,12 +208,11 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
            }
        }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       gdbpy_convert_exception (except);
       return -1;
     }
-  END_CATCH
 
   if (PyErr_Occurred ())
     return -1;
@@ -244,7 +241,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
   self_bpfinish->return_type = NULL;
   self_bpfinish->function_value = NULL;
 
-  TRY
+  try
     {
       if (get_frame_pc_if_available (frame, &pc))
         {
@@ -270,12 +267,11 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
             }
         }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       /* Just swallow.  Either the return type or the function value
         remain NULL.  */
     }
-  END_CATCH
 
   if (self_bpfinish->return_type == NULL || self_bpfinish->function_value == NULL)
     {
@@ -291,7 +287,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
   bppy_pending_object->number = -1;
   bppy_pending_object->bp = NULL;
 
-  TRY
+  try
     {
       /* Set a breakpoint on the return address.  */
       event_location_up location
@@ -306,11 +302,10 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
                          &bkpt_breakpoint_ops,
                          0, 1, internal_bp, 0);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_SET_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   self_bpfinish->py_bp.bp->frame_id = frame_id;
   self_bpfinish->py_bp.is_finish_bp = 1;
@@ -362,19 +357,18 @@ bpfinishpy_detect_out_scope_cb (struct breakpoint *b, void *args)
       /* Check scope if not currently stopped at the FinishBreakpoint.  */
       if (b != bp_stopped)
         {
-          TRY
+          try
             {
               if (b->pspace == current_inferior ()->pspace
                   && (!target_has_registers
                       || frame_find_by_id (b->frame_id) == NULL))
                 bpfinishpy_out_of_scope (finish_bp);
             }
-          CATCH (except, RETURN_MASK_ALL)
+          catch (const gdb_exception_RETURN_MASK_ALL &except)
             {
               gdbpy_convert_exception (except);
               gdbpy_print_stack ();
             }
-         END_CATCH
         }
     }
 
index 0eef6543f848c622e313b8319a173cc97036d226..9066f6096e6e1a63208bb548c5fe76489e326211 100644 (file)
@@ -95,15 +95,14 @@ frapy_is_valid (PyObject *self, PyObject *args)
 {
   struct frame_info *frame = NULL;
 
-  TRY
+  try
     {
       frame = frame_object_to_frame_info (self);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (frame == NULL)
     Py_RETURN_FALSE;
@@ -122,17 +121,16 @@ frapy_name (PyObject *self, PyObject *args)
   enum language lang;
   PyObject *result;
 
-  TRY
+  try
     {
       FRAPY_REQUIRE_VALID (self, frame);
 
       name = find_frame_funname (frame, &lang, NULL);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (name)
     {
@@ -157,17 +155,16 @@ frapy_type (PyObject *self, PyObject *args)
   struct frame_info *frame;
   enum frame_type type = NORMAL_FRAME;/* Initialize to appease gcc warning.  */
 
-  TRY
+  try
     {
       FRAPY_REQUIRE_VALID (self, frame);
 
       type = get_frame_type (frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return PyInt_FromLong (type);
 }
@@ -181,15 +178,14 @@ frapy_arch (PyObject *self, PyObject *args)
   struct frame_info *frame = NULL;    /* Initialize to appease gcc warning.  */
   frame_object *obj = (frame_object *) self;
 
-  TRY
+  try
     {
       FRAPY_REQUIRE_VALID (self, frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return gdbarch_to_arch_object (obj->gdbarch);
 }
@@ -203,15 +199,14 @@ frapy_unwind_stop_reason (PyObject *self, PyObject *args)
   struct frame_info *frame = NULL;    /* Initialize to appease gcc warning.  */
   enum unwind_stop_reason stop_reason;
 
-  TRY
+  try
     {
       FRAPY_REQUIRE_VALID (self, frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   stop_reason = get_frame_unwind_stop_reason (frame);
 
@@ -227,17 +222,16 @@ frapy_pc (PyObject *self, PyObject *args)
   CORE_ADDR pc = 0;          /* Initialize to appease gcc warning.  */
   struct frame_info *frame;
 
-  TRY
+  try
     {
       FRAPY_REQUIRE_VALID (self, frame);
 
       pc = get_frame_pc (frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return gdb_py_long_from_ulongest (pc);
 }
@@ -254,7 +248,7 @@ frapy_read_register (PyObject *self, PyObject *args)
   if (!PyArg_ParseTuple (args, "s", &regnum_str))
     return NULL;
 
-  TRY
+  try
     {
       struct frame_info *frame;
       int regnum;
@@ -270,11 +264,10 @@ frapy_read_register (PyObject *self, PyObject *args)
       if (val == NULL)
         PyErr_SetString (PyExc_ValueError, _("Unknown register."));
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return val == NULL ? NULL : value_to_value_object (val);
 }
@@ -288,16 +281,15 @@ frapy_block (PyObject *self, PyObject *args)
   struct frame_info *frame;
   const struct block *block = NULL, *fn_block;
 
-  TRY
+  try
     {
       FRAPY_REQUIRE_VALID (self, frame);
       block = get_frame_block (frame, NULL);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   for (fn_block = block;
        fn_block != NULL && BLOCK_FUNCTION (fn_block) == NULL;
@@ -330,7 +322,7 @@ frapy_function (PyObject *self, PyObject *args)
   struct symbol *sym = NULL;
   struct frame_info *frame;
 
-  TRY
+  try
     {
       enum language funlang;
 
@@ -339,11 +331,10 @@ frapy_function (PyObject *self, PyObject *args)
       gdb::unique_xmalloc_ptr<char> funname
        = find_frame_funname (frame, &funlang, &sym);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (sym)
     return symbol_to_symbol_object (sym);
@@ -362,7 +353,7 @@ frame_info_to_frame_object (struct frame_info *frame)
   if (frame_obj == NULL)
     return NULL;
 
-  TRY
+  try
     {
 
       /* Try to get the previous frame, to determine if this is the last frame
@@ -382,12 +373,11 @@ frame_info_to_frame_object (struct frame_info *frame)
        }
       frame_obj->gdbarch = get_frame_arch (frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       gdbpy_convert_exception (except);
       return NULL;
     }
-  END_CATCH
 
   return (PyObject *) frame_obj.release ();
 }
@@ -402,17 +392,16 @@ frapy_older (PyObject *self, PyObject *args)
   struct frame_info *frame, *prev = NULL;
   PyObject *prev_obj = NULL;   /* Initialize to appease gcc warning.  */
 
-  TRY
+  try
     {
       FRAPY_REQUIRE_VALID (self, frame);
 
       prev = get_prev_frame (frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (prev)
     prev_obj = frame_info_to_frame_object (prev);
@@ -435,17 +424,16 @@ frapy_newer (PyObject *self, PyObject *args)
   struct frame_info *frame, *next = NULL;
   PyObject *next_obj = NULL;   /* Initialize to appease gcc warning.  */
 
-  TRY
+  try
     {
       FRAPY_REQUIRE_VALID (self, frame);
 
       next = get_next_frame (frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (next)
     next_obj = frame_info_to_frame_object (next);
@@ -467,18 +455,17 @@ frapy_find_sal (PyObject *self, PyObject *args)
   struct frame_info *frame;
   PyObject *sal_obj = NULL;   /* Initialize to appease gcc warning.  */
 
-  TRY
+  try
     {
       FRAPY_REQUIRE_VALID (self, frame);
 
       symtab_and_line sal = find_frame_sal (frame);
       sal_obj = symtab_and_line_to_sal_object (sal);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return sal_obj;
 }
@@ -523,7 +510,7 @@ frapy_read_var (PyObject *self, PyObject *args)
            }
        }
 
-      TRY
+      try
        {
          struct block_symbol lookup_sym;
          FRAPY_REQUIRE_VALID (self, frame);
@@ -534,12 +521,11 @@ frapy_read_var (PyObject *self, PyObject *args)
          var = lookup_sym.symbol;
          block = lookup_sym.block;
        }
-      CATCH (except, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &except)
        {
          gdbpy_convert_exception (except);
          return NULL;
        }
-      END_CATCH
 
       if (!var)
        {
@@ -556,17 +542,16 @@ frapy_read_var (PyObject *self, PyObject *args)
       return NULL;
     }
 
-  TRY
+  try
     {
       FRAPY_REQUIRE_VALID (self, frame);
 
       val = read_var_value (var, block, frame);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return value_to_value_object (val);
 }
@@ -578,17 +563,16 @@ frapy_select (PyObject *self, PyObject *args)
 {
   struct frame_info *fi;
 
-  TRY
+  try
     {
       FRAPY_REQUIRE_VALID (self, fi);
 
       select_frame (fi);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   Py_RETURN_NONE;
 }
@@ -601,15 +585,14 @@ gdbpy_newest_frame (PyObject *self, PyObject *args)
 {
   struct frame_info *frame = NULL;
 
-  TRY
+  try
     {
       frame = get_current_frame ();
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return frame_info_to_frame_object (frame);
 }
@@ -622,15 +605,14 @@ gdbpy_selected_frame (PyObject *self, PyObject *args)
 {
   struct frame_info *frame = NULL;
 
-  TRY
+  try
     {
       frame = get_selected_frame ("No frame is currently selected.");
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return frame_info_to_frame_object (frame);
 }
index 7b241bbed897693a0718176507ae5eb591dedbf0..deb4a8f1c8b9352b53db526b539a1b1145a8ccd6 100644 (file)
@@ -1081,16 +1081,15 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
   if (!gdb_python_initialized)
     return EXT_LANG_BT_NO_FILTERS;
 
-  TRY
+  try
     {
       gdbarch = get_frame_arch (frame);
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       /* Let gdb try to print the stack trace.  */
       return EXT_LANG_BT_NO_FILTERS;
     }
-  END_CATCH
 
   gdbpy_enter enter_py (gdbarch, current_language);
 
@@ -1166,17 +1165,16 @@ gdbpy_apply_frame_filter (const struct extension_language_defn *extlang,
            }
        }
 
-      TRY
+      try
        {
          success = py_print_frame (item.get (), flags, args_type, out, 0,
                                    levels_printed.get ());
        }
-      CATCH (except, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &except)
        {
          gdbpy_convert_exception (except);
          success = EXT_LANG_BT_ERROR;
        }
-      END_CATCH
 
       /* Do not exit on error printing a single frame.  Print the
         error and continue with other frames.  */
index 1e6cd739d6a3e022ac1eb170abc52f46283d077b..51ec6d814ae1e00935599401d1837ce46c8aaed9 100644 (file)
@@ -39,12 +39,12 @@ gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout,
   int n;
   char *p = NULL, *q;
 
-  TRY
+  try
     {
       p = command_line_input (prompt, "python");
     }
   /* Handle errors by raising Python exceptions.  */
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       /* Detect user interrupt (Ctrl-C).  */
       if (except.reason == RETURN_QUIT)
@@ -59,7 +59,6 @@ gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout,
       PyEval_SaveThread ();
       return NULL;
     }
-  END_CATCH
 
   /* Detect EOF (Ctrl-D).  */
   if (p == NULL)
index 72fbf6d90b93f07ecff987e9d174d0cc15a10408..fee6b301c0a955ee1bdb7dd689d9448b25c2a0f3 100644 (file)
@@ -389,15 +389,14 @@ infpy_threads (PyObject *self, PyObject *args)
 
   INFPY_REQUIRE_VALID (inf_obj);
 
-  TRY
+  try
     {
       update_thread_list ();
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   tuple = PyTuple_New (inf_obj->nthreads);
   if (!tuple)
@@ -508,17 +507,16 @@ infpy_read_memory (PyObject *self, PyObject *args, PyObject *kw)
       || get_addr_from_python (length_obj, &length) < 0)
     return NULL;
 
-  TRY
+  try
     {
       buffer.reset ((gdb_byte *) xmalloc (length));
 
       read_memory (addr, buffer.get (), length);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   gdbpy_ref<membuf_object> membuf_obj (PyObject_New (membuf_object,
                                                     &membuf_object_type));
@@ -572,15 +570,14 @@ infpy_write_memory (PyObject *self, PyObject *args, PyObject *kw)
   else if (get_addr_from_python (length_obj, &length) < 0)
     return nullptr;
 
-  TRY
+  try
     {
       write_memory_with_notification (addr, buffer, length);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       except = ex;
     }
-  END_CATCH
 
   GDB_PY_HANDLE_EXCEPTION (except);
 
@@ -725,17 +722,16 @@ infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw)
       return nullptr;
     }
 
-  TRY
+  try
     {
       found = target_search_memory (start_addr, length,
                                    buffer, pattern_size,
                                    &found_addr);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       except = ex;
     }
-  END_CATCH
 
   GDB_PY_HANDLE_EXCEPTION (except);
 
@@ -782,7 +778,7 @@ infpy_thread_from_thread_handle (PyObject *self, PyObject *args, PyObject *kw)
       return NULL;
     }
 
-  TRY
+  try
     {
       struct thread_info *thread_info;
       struct value *val = value_object_to_value (handle_obj);
@@ -791,11 +787,10 @@ infpy_thread_from_thread_handle (PyObject *self, PyObject *args, PyObject *kw)
       if (thread_info != NULL)
        return thread_to_thread_object (thread_info).release ();
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   Py_RETURN_NONE;
 }
index bf90d08ae6e9241a085d8817ef00c91a1414de1b..3c6d147f48a2c2a575c0b35b79f904ded88796fe 100644 (file)
@@ -181,15 +181,14 @@ thpy_switch (PyObject *self, PyObject *args)
 
   THPY_REQUIRE_VALID (thread_obj);
 
-  TRY
+  try
     {
       switch_to_thread (thread_obj->thread);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   Py_RETURN_NONE;
 }
index 443aeb7f45b08405470728d3477f70c688d40589..61722d929d1c3823e87289add6b4dd4666cedf46 100644 (file)
@@ -113,7 +113,7 @@ stpy_convert_to_value (PyObject *self, PyObject *args)
       return NULL;
     }
 
-  TRY
+  try
     {
       struct type *type = type_object_to_type (self_string->type);
       struct type *realtype;
@@ -142,11 +142,10 @@ stpy_convert_to_value (PyObject *self, PyObject *args)
          break;
        }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return value_to_value_object (val);
 }
index b9d74b8aa3d9f1a89116af5670c8c781485455c9..813b2d92eaad51b672436c38b35da84d8c1a5c94 100644 (file)
@@ -164,15 +164,14 @@ ltpy_get_pcs_for_line (PyObject *self, PyObject *args)
   if (! PyArg_ParseTuple (args, GDB_PY_LL_ARG, &py_line))
     return NULL;
 
-  TRY
+  try
     {
       pcs = find_pcs_for_symtab_line (symtab, py_line, &best_entry);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return build_line_table_tuple_from_pcs (py_line, pcs);
 }
index 67f63b314e35001ef746b16028bdc71368347606..75ccc18406b6dbdf0eff8e53e3521581442b1fe7 100644 (file)
@@ -130,15 +130,14 @@ objfpy_get_build_id (PyObject *self, void *closure)
 
   OBJFPY_REQUIRE_VALID (obj);
 
-  TRY
+  try
     {
       build_id = build_id_bfd_get (objfile->obfd);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (build_id != NULL)
     {
@@ -421,17 +420,16 @@ objfpy_add_separate_debug_file (PyObject *self, PyObject *args, PyObject *kw)
   if (!gdb_PyArg_ParseTupleAndKeywords (args, kw, "s", keywords, &file_name))
     return NULL;
 
-  TRY
+  try
     {
       gdb_bfd_ref_ptr abfd (symfile_bfd_open (file_name));
 
       symbol_file_add_separate (abfd.get (), file_name, 0, obj->objfile);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   Py_RETURN_NONE;
 }
index 3b79a5c4fd77823ae98011d7596e3f156f88643e..c211d477ea42f9290936f2efe840ddbcf2da8750 100644 (file)
@@ -726,21 +726,20 @@ parmpy_init (PyObject *self, PyObject *args, PyObject *kwds)
 
   Py_INCREF (self);
 
-  TRY
+  try
     {
       add_setshow_generic (parmclass, (enum command_class) cmdtype,
                           cmd_name, obj,
                           set_doc.get (), show_doc.get (),
                           doc.get (), set_list, show_list);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       xfree (cmd_name);
       Py_DECREF (self);
       gdbpy_convert_exception (except);
       return -1;
     }
-  END_CATCH
 
   return 0;
 }
index e64d1f88af892c38b7a2b97a572f62a25cada696..a02965da400e88164f04b49353d482c718fb3169 100644 (file)
@@ -190,7 +190,7 @@ pretty_print_one_value (PyObject *printer, struct value **out_value)
   gdbpy_ref<> result;
 
   *out_value = NULL;
-  TRY
+  try
     {
       if (!PyObject_HasAttr (printer, gdbpy_to_string_cst))
        result = gdbpy_ref<>::new_reference (Py_None);
@@ -212,10 +212,9 @@ pretty_print_one_value (PyObject *printer, struct value **out_value)
            }
        }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
     }
-  END_CATCH
 
   return result;
 }
@@ -637,15 +636,14 @@ apply_varobj_pretty_printer (PyObject *printer_obj,
 gdbpy_ref<>
 gdbpy_get_varobj_pretty_printer (struct value *value)
 {
-  TRY
+  try
     {
       value = value_copy (value);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   gdbpy_ref<> val_obj (value_to_value_object (value));
   if (val_obj == NULL)
index b82a91b44d598be5add3c705516f2e17f85eead6..eb6acb29dd41ce227a5ba6f5db90ab806695f4fd 100644 (file)
@@ -381,7 +381,7 @@ pspy_block_for_pc (PyObject *o, PyObject *args)
   if (!PyArg_ParseTuple (args, GDB_PY_LLU_ARG, &pc))
     return NULL;
 
-  TRY
+  try
     {
       scoped_restore_current_program_space saver;
 
@@ -391,11 +391,10 @@ pspy_block_for_pc (PyObject *o, PyObject *args)
       if (cust != NULL && COMPUNIT_OBJFILE (cust) != NULL)
        block = block_for_pc (pc);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (cust == NULL || COMPUNIT_OBJFILE (cust) == NULL)
     {
@@ -425,7 +424,7 @@ pspy_find_pc_line (PyObject *o, PyObject *args)
   if (!PyArg_ParseTuple (args, GDB_PY_LLU_ARG, &pc_llu))
     return NULL;
 
-  TRY
+  try
     {
       struct symtab_and_line sal;
       CORE_ADDR pc;
@@ -437,11 +436,10 @@ pspy_find_pc_line (PyObject *o, PyObject *args)
       sal = find_pc_line (pc, 0);
       result = symtab_and_line_to_sal_object (sal);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return result;
 }
index 229a3b8756bb7e8922beecb56cf0a78896d6dc2c..64b25fa51244f81f1dd4e7b8b8546fafe8992967 100644 (file)
@@ -208,15 +208,14 @@ recpy_bt_insn_sal (PyObject *self, void *closure)
   if (insn == NULL)
     return NULL;
 
-  TRY
+  try
     {
       result = symtab_and_line_to_sal_object (find_pc_line (insn->pc, 0));
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return result;
 }
@@ -279,16 +278,15 @@ recpy_bt_insn_data (PyObject *self, void *closure)
   if (insn == NULL)
     return NULL;
 
-  TRY
+  try
     {
       buffer.resize (insn->size);
       read_memory (insn->pc, buffer.data (), insn->size);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   object = PyBytes_FromStringAndSize ((const char *) buffer.data (),
                                      insn->size);
@@ -316,16 +314,15 @@ recpy_bt_insn_decoded (PyObject *self, void *closure)
   if (insn == NULL)
     return NULL;
 
-  TRY
+  try
     {
       gdb_print_insn (target_gdbarch (), insn->pc, &strfile, NULL);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       gdbpy_convert_exception (except);
       return NULL;
     }
-  END_CATCH
 
 
   return PyBytes_FromString (strfile.string ().c_str ());
@@ -787,7 +784,7 @@ recpy_bt_goto (PyObject *self, PyObject *args)
     return PyErr_Format (PyExc_TypeError, _("Argument must be instruction."));
   obj = (const recpy_element_object *) parse_obj;
 
-  TRY
+  try
     {
       struct btrace_insn_iterator iter;
 
@@ -798,11 +795,10 @@ recpy_bt_goto (PyObject *self, PyObject *args)
       else
        target_goto_record (obj->number);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   Py_RETURN_NONE;
 }
index e818560174e9a672213dbde2d444cd1f725a5fd7..66fa8bf3f5ee26863f463cd28239a2c9d8c03a48 100644 (file)
@@ -602,16 +602,15 @@ gdbpy_start_recording (PyObject *self, PyObject *args)
   if (!PyArg_ParseTuple (args, "|ss", &method, &format))
     return NULL;
 
-  TRY
+  try
     {
       record_start (method, format, 0);
       ret = gdbpy_current_recording (self, args);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       gdbpy_convert_exception (except);
     }
-  END_CATCH
 
   return ret;
 }
@@ -638,15 +637,14 @@ gdbpy_current_recording (PyObject *self, PyObject *args)
 PyObject *
 gdbpy_stop_recording (PyObject *self, PyObject *args)
 {
-  TRY
+  try
     {
       record_stop (0);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   Py_RETURN_NONE;
 }
index afff995068921843b78b4b485d860a15d1859fc6..63d8ab16aa1681681b1d1e68f9e09523608624a5 100644 (file)
@@ -196,15 +196,14 @@ sympy_needs_frame (PyObject *self, void *closure)
 
   SYMPY_REQUIRE_VALID (self, symbol);
 
-  TRY
+  try
     {
       result = symbol_read_needs_frame (symbol);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (result)
     Py_RETURN_TRUE;
@@ -266,7 +265,7 @@ sympy_value (PyObject *self, PyObject *args)
       return NULL;
     }
 
-  TRY
+  try
     {
       if (frame_obj != NULL)
        {
@@ -284,11 +283,10 @@ sympy_value (PyObject *self, PyObject *args)
         can happen with nested functions).  */
       value = read_var_value (symbol, NULL, frame_info);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return value_to_value_object (value);
 }
@@ -388,28 +386,26 @@ gdbpy_lookup_symbol (PyObject *self, PyObject *args, PyObject *kw)
     {
       struct frame_info *selected_frame;
 
-      TRY
+      try
        {
          selected_frame = get_selected_frame (_("No frame selected."));
          block = get_frame_block (selected_frame, NULL);
        }
-      CATCH (except, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &except)
        {
          GDB_PY_HANDLE_EXCEPTION (except);
        }
-      END_CATCH
     }
 
-  TRY
+  try
     {
       symbol = lookup_symbol (name, block, (domain_enum) domain,
                              &is_a_field_of_this).symbol;
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   gdbpy_ref<> ret_tuple (PyTuple_New (2));
   if (ret_tuple == NULL)
@@ -451,15 +447,14 @@ gdbpy_lookup_global_symbol (PyObject *self, PyObject *args, PyObject *kw)
                                        &domain))
     return NULL;
 
-  TRY
+  try
     {
       symbol = lookup_global_symbol (name, NULL, (domain_enum) domain).symbol;
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (symbol)
     {
index c908ec62de60e7fa14ceed22d0467f820fe9384f..d918fc0d68ecc8b9d8716ef69866724229b6e39b 100644 (file)
@@ -312,15 +312,14 @@ typy_fields_items (PyObject *self, enum gdbpy_iter_kind kind)
   struct type *type = ((type_object *) py_type)->type;
   struct type *checked_type = type;
 
-  TRY
+  try
     {
       checked_type = check_typedef (checked_type);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   gdbpy_ref<> type_holder;
   if (checked_type != type)
@@ -420,15 +419,14 @@ typy_strip_typedefs (PyObject *self, PyObject *args)
 {
   struct type *type = ((type_object *) self)->type;
 
-  TRY
+  try
     {
       type = check_typedef (type);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return type_to_type_object (type);
 }
@@ -442,15 +440,14 @@ typy_get_composite (struct type *type)
 
   for (;;)
     {
-      TRY
+      try
        {
          type = check_typedef (type);
        }
-      CATCH (except, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &except)
        {
          GDB_PY_HANDLE_EXCEPTION (except);
        }
-      END_CATCH
 
       if (TYPE_CODE (type) != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type))
        break;
@@ -510,17 +507,16 @@ typy_array_1 (PyObject *self, PyObject *args, int is_vector)
       return NULL;
     }
 
-  TRY
+  try
     {
       array = lookup_array_range_type (type, n1, n2);
       if (is_vector)
        make_vector_type (array);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return type_to_type_object (array);
 }
@@ -547,15 +543,14 @@ typy_pointer (PyObject *self, PyObject *args)
 {
   struct type *type = ((type_object *) self)->type;
 
-  TRY
+  try
     {
       type = lookup_pointer_type (type);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return type_to_type_object (type);
 }
@@ -616,15 +611,14 @@ typy_reference (PyObject *self, PyObject *args)
 {
   struct type *type = ((type_object *) self)->type;
 
-  TRY
+  try
     {
       type = lookup_lvalue_reference_type (type);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return type_to_type_object (type);
 }
@@ -651,15 +645,14 @@ typy_const (PyObject *self, PyObject *args)
 {
   struct type *type = ((type_object *) self)->type;
 
-  TRY
+  try
     {
       type = make_cv_type (1, 0, type, NULL);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return type_to_type_object (type);
 }
@@ -670,15 +663,14 @@ typy_volatile (PyObject *self, PyObject *args)
 {
   struct type *type = ((type_object *) self)->type;
 
-  TRY
+  try
     {
       type = make_cv_type (0, 1, type, NULL);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return type_to_type_object (type);
 }
@@ -689,15 +681,14 @@ typy_unqualified (PyObject *self, PyObject *args)
 {
   struct type *type = ((type_object *) self)->type;
 
-  TRY
+  try
     {
       type = make_cv_type (0, 0, type, NULL);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return type_to_type_object (type);
 }
@@ -708,14 +699,13 @@ typy_get_sizeof (PyObject *self, void *closure)
 {
   struct type *type = ((type_object *) self)->type;
 
-  TRY
+  try
     {
       check_typedef (type);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
     }
-  END_CATCH
 
   /* Ignore exceptions.  */
 
@@ -729,15 +719,14 @@ typy_get_alignof (PyObject *self, void *closure)
   struct type *type = ((type_object *) self)->type;
 
   ULONGEST align = 0;
-  TRY
+  try
     {
       align = type_align (type);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       align = 0;
     }
-  END_CATCH
 
   /* Ignore exceptions.  */
 
@@ -749,7 +738,7 @@ typy_lookup_typename (const char *type_name, const struct block *block)
 {
   struct type *type = NULL;
 
-  TRY
+  try
     {
       if (startswith (type_name, "struct "))
        type = lookup_struct (type_name + 7, NULL);
@@ -761,11 +750,10 @@ typy_lookup_typename (const char *type_name, const struct block *block)
        type = lookup_typename (python_language, python_gdbarch,
                                type_name, block, 0);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return type;
 }
@@ -791,7 +779,7 @@ typy_lookup_type (struct demangle_component *demangled,
       if (! type)
        return NULL;
 
-      TRY
+      try
        {
          /* If the demangled_type matches with one of the types
             below, run the corresponding function and save the type
@@ -816,11 +804,10 @@ typy_lookup_type (struct demangle_component *demangled,
              break;
            }
        }
-      CATCH (except, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &except)
        {
          GDB_PY_HANDLE_EXCEPTION (except);
        }
-      END_CATCH
     }
 
   /* If we have a type from the switch statement above, just return
@@ -854,16 +841,15 @@ typy_legacy_template_argument (struct type *type, const struct block *block,
       return NULL;
     }
 
-  TRY
+  try
     {
       /* Note -- this is not thread-safe.  */
       info = cp_demangled_name_to_comp (TYPE_NAME (type), &err);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (! info)
     {
@@ -934,17 +920,16 @@ typy_template_argument (PyObject *self, PyObject *args)
        }
     }
 
-  TRY
+  try
     {
       type = check_typedef (type);
       if (TYPE_IS_REFERENCE (type))
        type = check_typedef (TYPE_TARGET_TYPE (type));
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   /* We might not have DW_TAG_template_*, so try to parse the type's
      name.  This is inefficient if we do not have a template type --
@@ -969,15 +954,14 @@ typy_template_argument (PyObject *self, PyObject *args)
       return NULL;
     }
 
-  TRY
+  try
     {
       val = value_of_variable (sym, block);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return value_to_value_object (val);
 }
@@ -987,16 +971,15 @@ typy_str (PyObject *self)
 {
   string_file thetype;
 
-  TRY
+  try
     {
       LA_PRINT_TYPE (type_object_to_type (self), "", &thetype, -1, 0,
                     &type_print_raw_options);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return PyUnicode_Decode (thetype.c_str (), thetype.size (),
                           host_charset (), NULL);
@@ -1023,17 +1006,16 @@ typy_richcompare (PyObject *self, PyObject *other, int op)
     result = true;
   else
     {
-      TRY
+      try
        {
          result = types_deeply_equal (type1, type2);
        }
-      CATCH (except, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &except)
        {
          /* If there is a GDB exception, a comparison is not capable
             (or trusted), so exit.  */
          GDB_PY_HANDLE_EXCEPTION (except);
        }
-      END_CATCH
     }
 
   if (op == (result ? Py_EQ : Py_NE))
index f07a8d8fa20e5643e3b8bc310d35ab04d6076818..e506ec01396767fa592bfe9a85b540650ebf91c3 100644 (file)
@@ -141,7 +141,7 @@ pyuw_value_obj_to_pointer (PyObject *pyo_value, CORE_ADDR *addr)
   int rc = 0;
   struct value *value;
 
-  TRY
+  try
     {
       if ((value = value_object_to_value (pyo_value)) != NULL)
         {
@@ -150,11 +150,10 @@ pyuw_value_obj_to_pointer (PyObject *pyo_value, CORE_ADDR *addr)
           rc = 1;
         }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       gdbpy_convert_exception (except);
     }
-  END_CATCH
   return rc;
 }
 
@@ -211,16 +210,15 @@ unwind_infopy_str (PyObject *self)
         stb.printf ("%s(%d, ", sep, reg.number);
         if (value != NULL)
           {
-            TRY
+            try
               {
                 value_print (value, &stb, &opts);
                 stb.puts (")");
               }
-            CATCH (except, RETURN_MASK_ALL)
+            catch (const gdb_exception_RETURN_MASK_ALL &except)
               {
                 GDB_PY_HANDLE_EXCEPTION (except);
               }
-            END_CATCH
           }
         else
           stb.puts ("<BAD>)");
@@ -346,16 +344,15 @@ pending_framepy_str (PyObject *self)
 
   if (frame == NULL)
     return PyString_FromString ("Stale PendingFrame instance");
-  TRY
+  try
     {
       sp_str = core_addr_to_string_nz (get_frame_sp (frame));
       pc_str = core_addr_to_string_nz (get_frame_pc (frame));
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return PyString_FromFormat ("SP=%s,PC=%s", sp_str, pc_str);
 }
@@ -385,7 +382,7 @@ pending_framepy_read_register (PyObject *self, PyObject *args)
       return NULL;
     }
 
-  TRY
+  try
     {
       /* Fetch the value associated with a register, whether it's
         a real register or a so called "user" register, like "pc",
@@ -398,11 +395,10 @@ pending_framepy_read_register (PyObject *self, PyObject *args)
                       "Cannot read register %d from frame.",
                       regnum);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return val == NULL ? NULL : value_to_value_object (val);
 }
index 87715eed557e9375d6039ca7e1e0a6b0fcbb8d7a..76b5ac04e9cdeb08f6d4f719d4154f754300fe97 100644 (file)
@@ -254,15 +254,14 @@ get_addr_from_python (PyObject *obj, CORE_ADDR *addr)
   if (gdbpy_is_value_object (obj))
     {
 
-      TRY
+      try
        {
          *addr = value_as_address (value_object_to_value (obj));
        }
-      CATCH (except, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &except)
        {
          GDB_PY_SET_HANDLE_EXCEPTION (except);
        }
-      END_CATCH
     }
   else
     {
index 1dcb60d72a967e5bc4972531566592593b8123ca..a761b1e53032d29cb667558081afb355952da173 100644 (file)
@@ -216,7 +216,7 @@ valpy_dereference (PyObject *self, PyObject *args)
 {
   PyObject *result = NULL;
 
-  TRY
+  try
     {
       struct value *res_val;
       scoped_value_mark free_values;
@@ -224,11 +224,10 @@ valpy_dereference (PyObject *self, PyObject *args)
       res_val = value_ind (((value_object *) self)->value);
       result = value_to_value_object (res_val);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return result;
 }
@@ -246,7 +245,7 @@ valpy_referenced_value (PyObject *self, PyObject *args)
 {
   PyObject *result = NULL;
 
-  TRY
+  try
     {
       struct value *self_val, *res_val;
       scoped_value_mark free_values;
@@ -268,11 +267,10 @@ valpy_referenced_value (PyObject *self, PyObject *args)
 
       result = value_to_value_object (res_val);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return result;
 }
@@ -284,7 +282,7 @@ valpy_reference_value (PyObject *self, PyObject *args, enum type_code refcode)
 {
   PyObject *result = NULL;
 
-  TRY
+  try
     {
       struct value *self_val;
       scoped_value_mark free_values;
@@ -292,11 +290,10 @@ 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 (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return result;
 }
@@ -320,7 +317,7 @@ valpy_const_value (PyObject *self, PyObject *args)
 {
   PyObject *result = NULL;
 
-  TRY
+  try
     {
       struct value *self_val, *res_val;
       scoped_value_mark free_values;
@@ -329,11 +326,10 @@ valpy_const_value (PyObject *self, PyObject *args)
       res_val = make_cv_value (1, 0, self_val);
       result = value_to_value_object (res_val);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return result;
 }
@@ -346,7 +342,7 @@ valpy_get_address (PyObject *self, void *closure)
 
   if (!val_obj->address)
     {
-      TRY
+      try
        {
          struct value *res_val;
          scoped_value_mark free_values;
@@ -354,12 +350,11 @@ valpy_get_address (PyObject *self, void *closure)
          res_val = value_addr (val_obj->value);
          val_obj->address = value_to_value_object (res_val);
        }
-      CATCH (except, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &except)
        {
          val_obj->address = Py_None;
          Py_INCREF (Py_None);
        }
-      END_CATCH
     }
 
   Py_XINCREF (val_obj->address);
@@ -397,7 +392,7 @@ valpy_get_dynamic_type (PyObject *self, void *closure)
       return obj->dynamic_type;
     }
 
-  TRY
+  try
     {
       struct value *val = obj->value;
       scoped_value_mark free_values;
@@ -433,11 +428,10 @@ valpy_get_dynamic_type (PyObject *self, void *closure)
          type = NULL;
        }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (type == NULL)
     obj->dynamic_type = valpy_get_type (self, NULL);
@@ -485,7 +479,7 @@ valpy_lazy_string (PyObject *self, PyObject *args, PyObject *kw)
       return NULL;
     }
 
-  TRY
+  try
     {
       scoped_value_mark free_values;
       struct type *type, *realtype;
@@ -540,11 +534,10 @@ valpy_lazy_string (PyObject *self, PyObject *args, PyObject *kw)
       str_obj = gdbpy_create_lazy_string_object (addr, length, user_encoding,
                                                 type);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return str_obj;
 }
@@ -572,15 +565,14 @@ valpy_string (PyObject *self, PyObject *args, PyObject *kw)
                                        &user_encoding, &errors, &length))
     return NULL;
 
-  TRY
+  try
     {
       LA_GET_STRING (value, &buffer, &length, &char_type, &la_encoding);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   encoding = (user_encoding && *user_encoding) ? user_encoding : la_encoding;
   return PyUnicode_Decode ((const char *) buffer.get (),
@@ -733,16 +725,15 @@ valpy_format_string (PyObject *self, PyObject *args, PyObject *kw)
 
   string_file stb;
 
-  TRY
+  try
     {
       common_val_print (((value_object *) self)->value, &stb, 0,
                        &opts, python_language);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return PyUnicode_Decode (stb.c_str (), stb.size (), host_charset (), NULL);
 }
@@ -766,7 +757,7 @@ valpy_do_cast (PyObject *self, PyObject *args, enum exp_opcode op)
       return NULL;
     }
 
-  TRY
+  try
     {
       struct value *val = ((value_object *) self)->value;
       struct value *res_val;
@@ -784,11 +775,10 @@ valpy_do_cast (PyObject *self, PyObject *args, enum exp_opcode op)
 
       result = value_to_value_object (res_val);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return result;
 }
@@ -849,7 +839,7 @@ value_has_field (struct value *v, PyObject *field)
       return -1;
     }
 
-  TRY
+  try
     {
       val_type = value_type (v);
       val_type = check_typedef (val_type);
@@ -863,11 +853,10 @@ value_has_field (struct value *v, PyObject *field)
       else
        has_field = 0;
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_SET_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return has_field;
 }
@@ -988,7 +977,7 @@ valpy_getitem (PyObject *self, PyObject *key)
        }
     }
 
-  TRY
+  try
     {
       struct value *tmp = self_value->value;
       struct value *res_val = NULL;
@@ -1042,11 +1031,10 @@ valpy_getitem (PyObject *self, PyObject *key)
       if (res_val)
        result = value_to_value_object (res_val);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       except = ex;
     }
-  END_CATCH
 
   GDB_PY_HANDLE_EXCEPTION (except);
 
@@ -1072,15 +1060,14 @@ valpy_call (PyObject *self, PyObject *args, PyObject *keywords)
   struct type *ftype = NULL;
   PyObject *result = NULL;
 
-  TRY
+  try
     {
       ftype = check_typedef (value_type (function));
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (TYPE_CODE (ftype) != TYPE_CODE_FUNC)
     {
@@ -1115,7 +1102,7 @@ valpy_call (PyObject *self, PyObject *args, PyObject *keywords)
        }
     }
 
-  TRY
+  try
     {
       scoped_value_mark free_values;
 
@@ -1124,11 +1111,10 @@ valpy_call (PyObject *self, PyObject *args, PyObject *keywords)
                                 gdb::make_array_view (vargs, args_count));
       result = value_to_value_object (return_value);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return result;
 }
@@ -1145,16 +1131,15 @@ valpy_str (PyObject *self)
 
   string_file stb;
 
-  TRY
+  try
     {
       common_val_print (((value_object *) self)->value, &stb, 0,
                        &opts, python_language);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return PyUnicode_Decode (stb.c_str (), stb.size (), host_charset (), NULL);
 }
@@ -1166,15 +1151,14 @@ valpy_get_is_optimized_out (PyObject *self, void *closure)
   struct value *value = ((value_object *) self)->value;
   int opt = 0;
 
-  TRY
+  try
     {
       opt = value_optimized_out (value);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (opt)
     Py_RETURN_TRUE;
@@ -1189,15 +1173,14 @@ valpy_get_is_lazy (PyObject *self, void *closure)
   struct value *value = ((value_object *) self)->value;
   int opt = 0;
 
-  TRY
+  try
     {
       opt = value_lazy (value);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (opt)
     Py_RETURN_TRUE;
@@ -1211,16 +1194,15 @@ valpy_fetch_lazy (PyObject *self, PyObject *args)
 {
   struct value *value = ((value_object *) self)->value;
 
-  TRY
+  try
     {
       if (value_lazy (value))
        value_fetch_lazy (value);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   Py_RETURN_NONE;
 }
@@ -1384,15 +1366,14 @@ valpy_binop (enum valpy_opcode opcode, PyObject *self, PyObject *other)
 {
   PyObject *result = NULL;
 
-  TRY
+  try
     {
       result = valpy_binop_throw (opcode, self, other);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return result;
 }
@@ -1448,7 +1429,7 @@ valpy_negative (PyObject *self)
 {
   PyObject *result = NULL;
 
-  TRY
+  try
     {
       /* Perhaps overkill, but consistency has some virtue.  */
       scoped_value_mark free_values;
@@ -1457,11 +1438,10 @@ valpy_negative (PyObject *self)
       val = value_neg (((value_object *) self)->value);
       result = value_to_value_object (val);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return result;
 }
@@ -1478,18 +1458,17 @@ valpy_absolute (PyObject *self)
   struct value *value = ((value_object *) self)->value;
   int isabs = 1;
 
-  TRY
+  try
     {
       scoped_value_mark free_values;
 
       if (value_less (value, value_zero (value_type (value), not_lval)))
        isabs = 0;
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (isabs)
     return valpy_positive (self);
@@ -1506,7 +1485,7 @@ valpy_nonzero (PyObject *self)
   struct type *type;
   int nonzero = 0; /* Appease GCC warning.  */
 
-  TRY
+  try
     {
       type = check_typedef (value_type (self_value->value));
 
@@ -1519,11 +1498,10 @@ valpy_nonzero (PyObject *self)
        /* All other values are True.  */
        nonzero = 1;
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       except = ex;
     }
-  END_CATCH
 
   /* This is not documented in the Python documentation, but if this
      function fails, return -1 as slot_nb_nonzero does (the default
@@ -1539,15 +1517,14 @@ valpy_invert (PyObject *self)
 {
   struct value *val = NULL;
 
-  TRY
+  try
     {
       val = value_complement (((value_object *) self)->value);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return value_to_value_object (val);
 }
@@ -1667,15 +1644,14 @@ valpy_richcompare (PyObject *self, PyObject *other, int op)
        return NULL;
     }
 
-  TRY
+  try
     {
       result = valpy_richcompare_throw (self, other, op);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   /* In this case, the Python exception has already been set.  */
   if (result < 0)
@@ -1696,7 +1672,7 @@ valpy_int (PyObject *self)
   struct type *type = value_type (value);
   LONGEST l = 0;
 
-  TRY
+  try
     {
       if (is_floating_value (value))
        {
@@ -1710,11 +1686,10 @@ valpy_int (PyObject *self)
 
       l = value_as_long (value);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (TYPE_UNSIGNED (type))
     return gdb_py_object_from_ulongest (l).release ();
@@ -1731,7 +1706,7 @@ valpy_long (PyObject *self)
   struct type *type = value_type (value);
   LONGEST l = 0;
 
-  TRY
+  try
     {
       if (is_floating_value (value))
        {
@@ -1747,11 +1722,10 @@ valpy_long (PyObject *self)
 
       l = value_as_long (value);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (TYPE_UNSIGNED (type))
     return gdb_py_long_from_ulongest (l);
@@ -1767,7 +1741,7 @@ valpy_float (PyObject *self)
   struct type *type = value_type (value);
   double d = 0;
 
-  TRY
+  try
     {
       type = check_typedef (type);
 
@@ -1783,11 +1757,10 @@ valpy_float (PyObject *self)
       else
        error (_("Cannot convert value to float."));
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return PyFloat_FromDouble (d);
 }
@@ -1837,7 +1810,7 @@ convert_value_from_python (PyObject *obj)
 
   gdb_assert (obj != NULL);
 
-  TRY
+  try
     {
       if (PyBool_Check (obj))
        {
@@ -1927,12 +1900,11 @@ convert_value_from_python (PyObject *obj)
                      PyString_AsString (PyObject_Str (obj)));
 #endif
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       gdbpy_convert_exception (except);
       return NULL;
     }
-  END_CATCH
 
   return value;
 }
@@ -1947,15 +1919,14 @@ gdbpy_history (PyObject *self, PyObject *args)
   if (!PyArg_ParseTuple (args, "i", &i))
     return NULL;
 
-  TRY
+  try
     {
       res_val = access_value_history (i);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return value_to_value_object (res_val);
 }
@@ -1970,7 +1941,7 @@ gdbpy_convenience_variable (PyObject *self, PyObject *args)
   if (!PyArg_ParseTuple (args, "s", &varname))
     return NULL;
 
-  TRY
+  try
     {
       struct internalvar *var = lookup_only_internalvar (varname);
 
@@ -1981,11 +1952,10 @@ gdbpy_convenience_variable (PyObject *self, PyObject *args)
            res_val = NULL;
        }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (res_val == NULL)
     Py_RETURN_NONE;
@@ -2012,7 +1982,7 @@ gdbpy_set_convenience_variable (PyObject *self, PyObject *args)
        return NULL;
     }
 
-  TRY
+  try
     {
       if (value == NULL)
        {
@@ -2028,11 +1998,10 @@ gdbpy_set_convenience_variable (PyObject *self, PyObject *args)
          set_internalvar (var, value);
        }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   Py_RETURN_NONE;
 }
index 0d9415ce8078bde7869ff6eb3d51209849405739..503639ed764ada6e161f525a98d9b6c35aab9a69 100644 (file)
@@ -497,15 +497,14 @@ gdbpy_parameter (PyObject *self, PyObject *args)
 
   std::string newarg = std::string ("show ") + arg;
 
-  TRY
+  try
     {
       found = lookup_cmd_composition (newarg.c_str (), &alias, &prefix, &cmd);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       GDB_PY_HANDLE_EXCEPTION (ex);
     }
-  END_CATCH
 
   if (!found)
     return PyErr_Format (PyExc_RuntimeError,
@@ -574,7 +573,7 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
 
   scoped_restore preventer = prevent_dont_repeat ();
 
-  TRY
+  try
     {
       gdbpy_allow_threads allow_threads;
 
@@ -615,11 +614,10 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
       /* Do any commands attached to breakpoint we stopped at.  */
       bpstat_do_actions ();
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   if (to_string)
     return PyString_FromString (to_string_res.c_str ());
@@ -830,7 +828,7 @@ gdbpy_decode_line (PyObject *self, PyObject *args)
   std::vector<symtab_and_line> decoded_sals;
   symtab_and_line def_sal;
   gdb::array_view<symtab_and_line> sals;
-  TRY
+  try
     {
       if (location != NULL)
        {
@@ -844,13 +842,12 @@ gdbpy_decode_line (PyObject *self, PyObject *args)
          sals = def_sal;
        }
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       /* We know this will always throw.  */
       gdbpy_convert_exception (ex);
       return NULL;
     }
-  END_CATCH
 
   if (!sals.empty ())
     {
@@ -898,16 +895,15 @@ gdbpy_parse_and_eval (PyObject *self, PyObject *args)
   if (!PyArg_ParseTuple (args, "s", &expr_str))
     return NULL;
 
-  TRY
+  try
     {
       gdbpy_allow_threads allow_threads;
       result = parse_and_eval (expr_str);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   return value_to_value_object (result);
 }
@@ -1136,7 +1132,7 @@ gdbpy_write (PyObject *self, PyObject *args, PyObject *kw)
                                        &stream_type))
     return NULL;
 
-  TRY
+  try
     {
       switch (stream_type)
         {
@@ -1154,11 +1150,10 @@ gdbpy_write (PyObject *self, PyObject *args, PyObject *kw)
           fprintf_filtered (gdb_stdout, "%s", arg);
         }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       GDB_PY_HANDLE_EXCEPTION (except);
     }
-  END_CATCH
 
   Py_RETURN_NONE;
 }
@@ -1224,14 +1219,13 @@ gdbpy_print_stack (void)
       /* PyErr_Print doesn't necessarily end output with a newline.
         This works because Python's stdout/stderr is fed through
         printf_filtered.  */
-      TRY
+      try
        {
          begin_line ();
        }
-      CATCH (except, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &except)
        {
        }
-      END_CATCH
     }
   /* Print "message", just error print message.  */
   else
@@ -1245,7 +1239,7 @@ gdbpy_print_stack (void)
       if (msg != NULL)
        type = fetched_error.type_to_string ();
 
-      TRY
+      try
        {
          if (msg == NULL || type == NULL)
            {
@@ -1260,10 +1254,9 @@ gdbpy_print_stack (void)
            fprintf_filtered (gdb_stderr, "Python Exception %s %s: \n",
                              type.get (), msg.get ());
        }
-      CATCH (except, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &except)
        {
        }
-      END_CATCH
     }
 }
 
index 2a2140bd553246490094f1f9b8a1a998d56e54cf..add89698c050d17e782b01b374f5f104075272d0 100644 (file)
@@ -282,15 +282,14 @@ require_btrace (void)
 static void
 record_btrace_enable_warn (struct thread_info *tp)
 {
-  TRY
+  try
     {
       btrace_enable (tp, &record_btrace_conf);
     }
-  CATCH (error, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &error)
     {
       warning ("%s", error.what ());
     }
-  END_CATCH
 }
 
 /* Enable automatic tracing of new threads.  */
@@ -1479,16 +1478,15 @@ record_btrace_target::insert_breakpoint (struct gdbarch *gdbarch,
   replay_memory_access = replay_memory_access_read_write;
 
   ret = 0;
-  TRY
+  try
     {
       ret = this->beneath ()->insert_breakpoint (gdbarch, bp_tgt);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       replay_memory_access = old;
       throw_exception (except);
     }
-  END_CATCH
   replay_memory_access = old;
 
   return ret;
@@ -1510,16 +1508,15 @@ record_btrace_target::remove_breakpoint (struct gdbarch *gdbarch,
   replay_memory_access = replay_memory_access_read_write;
 
   ret = 0;
-  TRY
+  try
     {
       ret = this->beneath ()->remove_breakpoint (gdbarch, bp_tgt, reason);
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       replay_memory_access = old;
       throw_exception (except);
     }
-  END_CATCH
   replay_memory_access = old;
 
   return ret;
@@ -1988,18 +1985,17 @@ get_thread_current_frame_id (struct thread_info *tp)
   set_executing (inferior_ptid, false);
 
   id = null_frame_id;
-  TRY
+  try
     {
       id = get_frame_id (get_current_frame ());
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       /* Restore the previous execution state.  */
       set_executing (inferior_ptid, executing);
 
       throw_exception (except);
     }
-  END_CATCH
 
   /* Restore the previous execution state.  */
   set_executing (inferior_ptid, executing);
@@ -2027,7 +2023,7 @@ record_btrace_start_replaying (struct thread_info *tp)
      Since frames are computed differently when we're replaying, we need to
      recompute those stored frames and fix them up so we can still detect
      subroutines after we started replaying.  */
-  TRY
+  try
     {
       struct frame_id frame_id;
       int upd_step_frame_id, upd_step_stack_frame_id;
@@ -2072,7 +2068,7 @@ record_btrace_start_replaying (struct thread_info *tp)
       if (upd_step_stack_frame_id)
        tp->control.step_stack_frame_id = frame_id;
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
       xfree (btinfo->replay);
       btinfo->replay = NULL;
@@ -2081,7 +2077,6 @@ record_btrace_start_replaying (struct thread_info *tp)
 
       throw_exception (except);
     }
-  END_CATCH
 
   return replay;
 }
@@ -2894,16 +2889,15 @@ cmd_record_btrace_bts_start (const char *args, int from_tty)
 
   record_btrace_conf.format = BTRACE_FORMAT_BTS;
 
-  TRY
+  try
     {
       execute_command ("target record-btrace", from_tty);
     }
-  CATCH (exception, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &exception)
     {
       record_btrace_conf.format = BTRACE_FORMAT_NONE;
       throw_exception (exception);
     }
-  END_CATCH
 }
 
 /* Start recording in Intel Processor Trace format.  */
@@ -2916,16 +2910,15 @@ cmd_record_btrace_pt_start (const char *args, int from_tty)
 
   record_btrace_conf.format = BTRACE_FORMAT_PT;
 
-  TRY
+  try
     {
       execute_command ("target record-btrace", from_tty);
     }
-  CATCH (exception, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &exception)
     {
       record_btrace_conf.format = BTRACE_FORMAT_NONE;
       throw_exception (exception);
     }
-  END_CATCH
 }
 
 /* Alias for "target record".  */
@@ -2938,26 +2931,24 @@ cmd_record_btrace_start (const char *args, int from_tty)
 
   record_btrace_conf.format = BTRACE_FORMAT_PT;
 
-  TRY
+  try
     {
       execute_command ("target record-btrace", from_tty);
     }
-  CATCH (exception, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &exception)
     {
       record_btrace_conf.format = BTRACE_FORMAT_BTS;
 
-      TRY
+      try
        {
          execute_command ("target record-btrace", from_tty);
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
          record_btrace_conf.format = BTRACE_FORMAT_NONE;
          throw_exception (ex);
        }
-      END_CATCH
     }
-  END_CATCH
 }
 
 /* The "set record btrace" command.  */
index ea0eddb536dc7632c6b6263f604e01e9c8d1e7d9..ce3f67fc74b3632b884d890c54c2a5923a50174c 100644 (file)
@@ -708,7 +708,7 @@ record_full_message (struct regcache *regcache, enum gdb_signal signal)
   int ret;
   struct gdbarch *gdbarch = regcache->arch ();
 
-  TRY
+  try
     {
       record_full_arch_list_head = NULL;
       record_full_arch_list_tail = NULL;
@@ -761,12 +761,11 @@ record_full_message (struct regcache *regcache, enum gdb_signal signal)
       if (ret < 0)
        error (_("Process record: failed to record execution log."));
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       record_full_list_release (record_full_arch_list_tail);
       throw_exception (ex);
     }
-  END_CATCH
 
   record_full_list->next = record_full_arch_list_head;
   record_full_arch_list_head->prev = record_full_list;
@@ -782,16 +781,15 @@ static bool
 record_full_message_wrapper_safe (struct regcache *regcache,
                                  enum gdb_signal signal)
 {
-  TRY
+  try
     {
       record_full_message (regcache, signal);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       exception_print (gdb_stderr, ex);
       return false;
     }
-  END_CATCH
 
   return true;
 }
@@ -1293,7 +1291,7 @@ record_full_wait_1 (struct target_ops *ops,
       int continue_flag = 1;
       int first_record_full_end = 1;
 
-      TRY
+      try
        {
          CORE_ADDR tmp_pc;
 
@@ -1436,7 +1434,7 @@ record_full_wait_1 (struct target_ops *ops,
          else
            status->value.sig = GDB_SIGNAL_TRAP;
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
          if (execution_direction == EXEC_REVERSE)
            {
@@ -1448,7 +1446,6 @@ record_full_wait_1 (struct target_ops *ops,
 
          throw_exception (ex);
        }
-      END_CATCH
     }
 
   signal (SIGINT, handle_sigint);
@@ -2374,7 +2371,7 @@ record_full_restore (void)
   record_full_arch_list_tail = NULL;
   record_full_insn_num = 0;
 
-  TRY
+  try
     {
       regcache = get_current_regcache ();
 
@@ -2476,12 +2473,11 @@ record_full_restore (void)
          record_full_arch_list_add (rec);
        }
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       record_full_list_release (record_full_arch_list_tail);
       throw_exception (ex);
     }
-  END_CATCH
 
   /* Add record_full_arch_list_head to the end of record list.  */
   record_full_first.next = record_full_arch_list_head;
index 91caa2b0726a1022e3673eb8c761d5d66ef07946..6887a6aac18be128cf5bf91c830dd9f7c5048d76 100644 (file)
@@ -1185,18 +1185,17 @@ remote_fileio_request (remote_target *remote, char *buf, int ctrlc_pending_p)
     }
   else
     {
-      TRY
+      try
        {
          do_remote_fileio_request (remote, buf);
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
          if (ex.reason == RETURN_QUIT)
            remote_fileio_reply (remote, -1, FILEIO_EINTR);
          else
            remote_fileio_reply (remote, -1, FILEIO_EIO);
        }
-      END_CATCH
     }
 
   quit_handler = remote_fileio_o_quit_handler;
index 2b21aeacdc29638827b8a0e0635c7508ee55b41f..0424ea4ef1ee7b38e3ff677779dc007131bd1280 100644 (file)
@@ -1146,12 +1146,12 @@ remote_target::remote_get_noisy_reply ()
 
          org_to = to;
 
-         TRY
+         try
            {
              gdbarch_relocate_instruction (target_gdbarch (), &to, from);
              relocated = 1;
            }
-         CATCH (ex, RETURN_MASK_ALL)
+         catch (const gdb_exception_RETURN_MASK_ALL &ex)
            {
              if (ex.error == MEMORY_ERROR)
                {
@@ -1170,7 +1170,6 @@ remote_target::remote_get_noisy_reply ()
                }
              putpkt ("E01");
            }
-         END_CATCH
 
          if (relocated)
            {
@@ -5602,11 +5601,11 @@ remote_target::open_1 (const char *name, int from_tty, int extended_p)
      function.  See cli-dump.c.  */
   {
 
-    TRY
+    try
       {
        remote->start_remote (from_tty, extended_p);
       }
-    CATCH (ex, RETURN_MASK_ALL)
+    catch (const gdb_exception_RETURN_MASK_ALL &ex)
       {
        /* Pop the partially set up target - unless something else did
           already before throwing the exception.  */
@@ -5614,7 +5613,6 @@ remote_target::open_1 (const char *name, int from_tty, int extended_p)
          remote_unpush_target ();
        throw_exception (ex);
       }
-    END_CATCH
   }
 
   remote_btrace_reset (rs);
@@ -9766,11 +9764,11 @@ remote_target::remote_kill_k ()
 {
   /* Catch errors so the user can quit from gdb even when we
      aren't on speaking terms with the remote system.  */
-  TRY
+  try
     {
       putpkt ("k");
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error == TARGET_CLOSE_ERROR)
        {
@@ -9788,7 +9786,6 @@ remote_target::remote_kill_k ()
         user or higher layers decide what to do.  */
       throw_exception (ex);
     }
-  END_CATCH
 }
 
 void
@@ -13135,11 +13132,11 @@ remote_target::get_trace_status (struct trace_status *ts)
 
   putpkt ("qTStatus");
 
-  TRY
+  try
     {
       p = remote_get_noisy_reply ();
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error != TARGET_CLOSE_ERROR)
        {
@@ -13148,7 +13145,6 @@ remote_target::get_trace_status (struct trace_status *ts)
        }
       throw_exception (ex);
     }
-  END_CATCH
 
   result = packet_ok (p, &remote_protocol_packets[PACKET_qTStatus]);
 
@@ -13790,16 +13786,15 @@ remote_target::enable_btrace (ptid_t ptid, const struct btrace_config *conf)
 
   /* If we fail to read the configuration, we lose some information, but the
      tracing itself is not impacted.  */
-  TRY
+  try
     {
       btrace_read_config (&tinfo->conf);
     }
-  CATCH (err, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &err)
     {
       if (err.message != NULL)
        warning ("%s", err.what ());
     }
-  END_CATCH
 
   return tinfo;
 }
index 1f88683d1dc67b55fbfbad780f6ddb5696c70e44..3cd9ba44d3df17b5493f8e198ef88cd0d57333ff 100644 (file)
@@ -651,19 +651,18 @@ riscv_print_one_register_info (struct gdbarch *gdbarch,
   fputs_filtered (name, file);
   print_spaces_filtered (value_column_1 - strlen (name), file);
 
-  TRY
+  try
     {
       val = value_of_register (regnum, frame);
       regtype = value_type (val);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       /* Handle failure to read a register without interrupting the entire
          'info registers' flow.  */
       fprintf_filtered (file, "%s\n", ex.what ());
       return;
     }
-  END_CATCH
 
   print_raw_format = (value_entirely_available (val)
                      && !value_optimized_out (val));
@@ -2802,17 +2801,16 @@ riscv_frame_this_id (struct frame_info *this_frame,
 {
   struct riscv_unwind_cache *cache;
 
-  TRY
+  try
     {
       cache = riscv_frame_cache (this_frame, prologue_cache);
       *this_id = cache->this_id;
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       /* Ignore errors, this leaves the frame id as the predefined outer
          frame id which terminates the backtrace at this point.  */
     }
-  END_CATCH
 }
 
 /* Implement the prev_register callback for RiscV frame unwinder.  */
index 2a5271cd530bc8025d641776b7e6cd7074f8e573..0c0f026be4f2ea8a40bab522cd73e2239e1ecced 100644 (file)
@@ -670,18 +670,17 @@ rs6000_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
       CORE_ADDR pc = 0;
       struct obj_section *pc_section;
 
-      TRY
+      try
         {
           pc = read_memory_unsigned_integer (addr, tdep->wordsize, byte_order);
         }
-      CATCH (e, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &e)
         {
           /* An error occured during reading.  Probably a memory error
              due to the section not being loaded yet.  This address
              cannot be a function descriptor.  */
           return addr;
         }
-      END_CATCH
 
       pc_section = find_pc_section (pc);
 
index e875ad953663c2a8c2c05e0637740140d16c3b0d..2f08e0f54c025f860ab9c49d5aee1a24b4bd08f4 100644 (file)
@@ -3451,7 +3451,7 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache)
   cache->pc = 0;
   cache->saved_regs = trad_frame_alloc_saved_regs (this_frame);
 
-  TRY
+  try
     {
       func = get_frame_func (this_frame);
       cache->pc = func;
@@ -3468,13 +3468,12 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache)
       cache->base = get_frame_register_unsigned
        (this_frame, gdbarch_sp_regnum (gdbarch));
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
        throw_exception (ex);
       return (struct rs6000_frame_cache *) (*this_cache);
     }
-  END_CATCH
 
   /* If the function appears to be frameless, check a couple of likely
      indicators that we have simply failed to find the frame setup.
@@ -3683,7 +3682,7 @@ rs6000_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
   (*this_cache) = cache;
   cache->saved_regs = trad_frame_alloc_saved_regs (this_frame);
 
-  TRY
+  try
     {
       /* At this point the stack looks as if we just entered the
         function, and the return address is stored in LR.  */
@@ -3698,12 +3697,11 @@ 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 (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
        throw_exception (ex);
     }
-  END_CATCH
 
   return cache;
 }
index ba145b168364c908074035f0414c34e9175dfd94..4aed05c0a954824b9ca4ece3d7fd3a433c0e969c 100644 (file)
@@ -2615,17 +2615,16 @@ static void
 rust_lex_exception_test (rust_parser *parser, const char *input,
                         const char *err)
 {
-  TRY
+  try
     {
       /* The "kind" doesn't matter.  */
       rust_lex_test_one (parser, input, DECIMAL_INTEGER);
       SELF_CHECK (0);
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       SELF_CHECK (strcmp (except.what (), err) == 0);
     }
-  END_CATCH
 }
 
 /* Test that INPUT lexes as the identifier, string, or byte-string
index 0c6c13d738e64588798ade84cfa81769142b4a5c..c14b45b0a2848a308934687f3d68435ae74b8d68 100644 (file)
@@ -1743,18 +1743,17 @@ tuple structs, and tuple-like enum variants"));
                       field_name, TYPE_NAME (outer_type),
                       rust_last_path_segment (TYPE_NAME (type)));
 
-           TRY
+           try
              {
                result = value_struct_elt (&lhs, NULL, field_name,
                                           NULL, "structure");
              }
-           CATCH (except, RETURN_MASK_ERROR)
+           catch (const gdb_exception_RETURN_MASK_ERROR &except)
              {
                error (_("Could not find field %s of struct variant %s::%s"),
                       field_name, TYPE_NAME (outer_type),
                       rust_last_path_segment (TYPE_NAME (type)));
              }
-           END_CATCH
          }
        else
          result = value_struct_elt (&lhs, NULL, field_name, NULL, "structure");
index 90aba99503657dc2207caa29e669d947ecad72ba..d44c10869bd7880639a9117a8909ac58d9a06dbf 100644 (file)
@@ -2547,19 +2547,18 @@ s390_frame_unwind_cache (struct frame_info *this_frame,
   info->frame_base = -1;
   info->local_base = -1;
 
-  TRY
+  try
     {
       /* Try to use prologue analysis to fill the unwind cache.
         If this fails, fall back to reading the stack backchain.  */
       if (!s390_prologue_frame_unwind_cache (this_frame, info))
        s390_backchain_frame_unwind_cache (this_frame, info);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (ex.error != NOT_AVAILABLE_ERROR)
        throw_exception (ex);
     }
-  END_CATCH
 
   return info;
 }
index 7a64295efa8e762addd167abe5c825771079ea97..340056e73e000c966764b3971c5f01285f987f92 100644 (file)
@@ -60,7 +60,7 @@ struct gdbarch_selftest : public selftest
 
        QUIT;
 
-       TRY
+       try
          {
            struct gdbarch_info info;
 
@@ -72,13 +72,12 @@ struct gdbarch_selftest : public selftest
 
            function (gdbarch);
          }
-       CATCH (ex, RETURN_MASK_ERROR)
+       catch (const gdb_exception_RETURN_MASK_ERROR &ex)
          {
            pass = false;
            exception_fprintf (gdb_stderr, ex,
                               _("Self test failed: arch %s: "), arches[i]);
          }
-       END_CATCH
 
        reset ();
       }
index 20310144f32b2e93d6864e89ff0dc5e1f294ca5d..4cd8a6997937fbbed419b78cc5df9f419a8d6fdd 100644 (file)
@@ -830,14 +830,13 @@ enable_break (void)
         in the dynamic linker itself.  */
 
       gdb_bfd_ref_ptr tmp_bfd;
-      TRY
+      try
        {
          tmp_bfd = solib_bfd_open (buf);
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
        }
-      END_CATCH
 
       if (tmp_bfd == NULL)
        {
index 1b330b8f97f534c80daede2058cf734fcb91235c..63edd41cddcf6b994e36cbb17d72088b01aec4d2 100644 (file)
@@ -561,14 +561,13 @@ enable_break2 (void)
          mechanism to find the dynamic linker's base address.  */
 
       gdb_bfd_ref_ptr tmp_bfd;
-      TRY
+      try
         {
           tmp_bfd = solib_bfd_open (buf);
         }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
        }
-      END_CATCH
 
       if (tmp_bfd == NULL)
        {
index 0cce0c953a10eb6843278eeca39aa09c43ee2a18..832da23b266c603060ca73c14bfdc4badb3bcf34 100644 (file)
@@ -110,7 +110,7 @@ append_ocl_sos (struct so_list **link_ptr)
         {
          enum bfd_endian byte_order = bfd_big_endian (objfile->obfd)?
                                         BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
-         TRY
+         try
            {
              CORE_ADDR data =
                read_memory_unsigned_integer (*ocl_program_addr_base,
@@ -133,7 +133,7 @@ append_ocl_sos (struct so_list **link_ptr)
                  link_ptr = &newobj->next;
                }
            }
-         CATCH (ex, RETURN_MASK_ALL)
+         catch (const gdb_exception_RETURN_MASK_ALL &ex)
            {
              /* Ignore memory errors.  */
              switch (ex.error)
@@ -145,7 +145,6 @@ append_ocl_sos (struct so_list **link_ptr)
                  break;
                }
            }
-         END_CATCH
        }
     }
 }
index 0b8cadb2dc7879303fb54866707ae88ab5616327..53d5db864e0c0dbb54a131f3cd9364588944954f 100644 (file)
@@ -869,16 +869,15 @@ solib_svr4_r_map (struct svr4_info *info)
   struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr;
   CORE_ADDR addr = 0;
 
-  TRY
+  try
     {
       addr = read_memory_typed_address (info->debug_base + lmo->r_map_offset,
                                         ptr_type);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       exception_print (gdb_stderr, ex);
     }
-  END_CATCH
 
   return addr;
 }
@@ -906,7 +905,7 @@ solib_svr4_r_ldsomap (struct svr4_info *info)
   enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
   ULONGEST version = 0;
 
-  TRY
+  try
     {
       /* Check version, and return zero if `struct r_debug' doesn't have
         the r_ldsomap member.  */
@@ -914,11 +913,10 @@ 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 (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       exception_print (gdb_stderr, ex);
     }
-  END_CATCH
 
   if (version < 2 || lmo->r_ldsomap_offset == -1)
     return 0;
@@ -1732,16 +1730,15 @@ solib_event_probe_action (struct probe_and_action *pa)
        arg0: Lmid_t lmid (mandatory)
        arg1: struct r_debug *debug_base (mandatory)
        arg2: struct link_map *new (optional, for incremental updates)  */
-  TRY
+  try
     {
       probe_argc = pa->prob->get_argument_count (frame);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       exception_print (gdb_stderr, ex);
       probe_argc = 0;
     }
-  END_CATCH
 
   /* If get_argument_count throws an exception, probe_argc will be set
      to zero.  However, if pa->prob does not have arguments, then
@@ -1896,16 +1893,15 @@ svr4_handle_solib_event (void)
     scoped_restore inhibit_updates
       = inhibit_section_map_updates (current_program_space);
 
-    TRY
+    try
       {
        val = pa->prob->evaluate_argument (1, frame);
       }
-    CATCH (ex, RETURN_MASK_ERROR)
+    catch (const gdb_exception_RETURN_MASK_ERROR &ex)
       {
        exception_print (gdb_stderr, ex);
        val = NULL;
       }
-    END_CATCH
 
     if (val == NULL)
       return;
@@ -1928,16 +1924,15 @@ svr4_handle_solib_event (void)
 
     if (action == UPDATE_OR_RELOAD)
       {
-       TRY
+       try
          {
            val = pa->prob->evaluate_argument (2, frame);
          }
-       CATCH (ex, RETURN_MASK_ERROR)
+       catch (const gdb_exception_RETURN_MASK_ERROR &ex)
          {
            exception_print (gdb_stderr, ex);
            return;
          }
-       END_CATCH
 
        if (val != NULL)
          lm = value_as_address (val);
@@ -2279,14 +2274,13 @@ enable_break (struct svr4_info *info, int from_tty)
          mechanism to find the dynamic linker's base address.  */
 
       gdb_bfd_ref_ptr tmp_bfd;
-      TRY
+      try
         {
          tmp_bfd = solib_bfd_open (interp_name);
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
        }
-      END_CATCH
 
       if (tmp_bfd == NULL)
        goto bkpt_at_symbol;
index 8cef5a042b40554dad2b6fcff0f9c5b18ba95349..75897ac55ad1850bfcc9c36c4e9ff937a7dda66f 100644 (file)
@@ -674,7 +674,7 @@ solib_read_symbols (struct so_list *so, symfile_add_flags flags)
 
       flags |= current_inferior ()->symfile_flags;
 
-      TRY
+      try
        {
          /* Have we already loaded this shared object?  */
          so->objfile = nullptr;
@@ -700,13 +700,12 @@ solib_read_symbols (struct so_list *so, symfile_add_flags flags)
 
          so->symbols_loaded = 1;
        }
-      CATCH (e, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &e)
        {
          exception_fprintf (gdb_stderr, e, _("Error while reading shared"
                                              " library symbols for %s:\n"),
                             so->so_name);
        }
-      END_CATCH
 
       return 1;
     }
@@ -748,17 +747,16 @@ update_solib_list (int from_tty)
         symbols now!  */
       if (inf->attach_flag && symfile_objfile == NULL)
        {
-         TRY
+         try
            {
              ops->open_symbol_file_object (from_tty);
            }
-         CATCH (ex, RETURN_MASK_ALL)
+         catch (const gdb_exception_RETURN_MASK_ALL &ex)
            {
              exception_fprintf (gdb_stderr, ex,
                                 "Error reading attached "
                                 "process's symbol file.\n");
            }
-         END_CATCH
        }
     }
 
@@ -868,7 +866,7 @@ update_solib_list (int from_tty)
          i->pspace = current_program_space;
          current_program_space->added_solibs.push_back (i);
 
-         TRY
+         try
            {
              /* Fill in the rest of the `struct so_list' node.  */
              if (!solib_map_sections (i))
@@ -879,13 +877,12 @@ update_solib_list (int from_tty)
                }
            }
 
-         CATCH (e, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &e)
            {
              exception_fprintf (gdb_stderr, e,
                                 _("Error while mapping shared "
                                   "library sections:\n"));
            }
-         END_CATCH
 
          /* Notify any observer that the shared object has been
             loaded now that we've added it to GDB's tables.  */
@@ -1333,19 +1330,18 @@ reload_shared_libraries_1 (int from_tty)
        {
          int got_error = 0;
 
-         TRY
+         try
            {
              solib_map_sections (so);
            }
 
-         CATCH (e, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &e)
            {
              exception_fprintf (gdb_stderr, e,
                                 _("Error while mapping "
                                   "shared library sections:\n"));
              got_error = 1;
            }
-         END_CATCH
 
            if (!got_error
                && (auto_solib_add || was_loaded || libpthread_solib_p (so)))
index 33170f236758cce9a78861bdcf4c1cc2c4e76e80..6f2b10f058fb8e4b0e2c832c88390e1fb570e7d6 100644 (file)
@@ -130,7 +130,7 @@ sparc64_linux_handle_segmentation_fault (struct gdbarch *gdbarch,
   CORE_ADDR addr = 0;
   long si_code = 0;
 
-  TRY
+  try
     {
       /* Evaluate si_code to see if the segfault is ADI related.  */
       si_code = parse_and_eval_long ("$_siginfo.si_code\n");
@@ -138,11 +138,10 @@ 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 (exception, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &exception)
     {
       return;
     }
-  END_CATCH
 
   /* Print out ADI event based on sig_code value */
   switch (si_code)
index 7773ef9fe2a42ec914f57d36e48af63adbcb7260..87588e10fcfed5c76b6809ddd43254d99e1e5e7e 100644 (file)
@@ -175,17 +175,16 @@ print_stack_frame (struct frame_info *frame, int print_level,
   if (current_uiout->is_mi_like_p ())
     print_what = LOC_AND_ADDRESS;
 
-  TRY
+  try
     {
       print_frame_info (frame, print_level, print_what, 1 /* print_args */,
                        set_current_sal);
       if (set_current_sal)
        set_current_sal_from_frame (frame);
     }
-  CATCH (e, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &e)
     {
     }
-  END_CATCH
 }
 
 /* Print nameless arguments of frame FRAME on STREAM, where START is
@@ -267,7 +266,7 @@ print_frame_arg (const struct frame_arg *arg)
        stb.printf (_("<error reading variable: %s>"), arg->error);
       else
        {
-         TRY
+         try
            {
              const struct language_defn *language;
              struct value_print_options opts;
@@ -296,12 +295,11 @@ print_frame_arg (const struct frame_arg *arg)
 
              common_val_print (arg->val, &stb, 2, &opts, language);
            }
-         CATCH (except, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &except)
            {
              stb.printf (_("<error reading variable: %s>"),
                          except.what ());
            }
-         END_CATCH
        }
     }
 
@@ -320,15 +318,14 @@ read_frame_local (struct symbol *sym, struct frame_info *frame,
   argp->val = NULL;
   argp->error = NULL;
 
-  TRY
+  try
     {
       argp->val = read_var_value (sym, NULL, frame);
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       argp->error = xstrdup (except.what ());
     }
-  END_CATCH
 }
 
 /* Read in inferior function parameter SYM at FRAME into ARGP.  Caller is
@@ -346,16 +343,15 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame,
   if (print_entry_values != print_entry_values_only
       && print_entry_values != print_entry_values_preferred)
     {
-      TRY
+      try
        {
          val = read_var_value (sym, NULL, frame);
        }
-      CATCH (except, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &except)
        {
          val_error = (char *) alloca (except.message->size () + 1);
          strcpy (val_error, except.what ());
        }
-      END_CATCH
     }
 
   if (SYMBOL_COMPUTED_OPS (sym) != NULL
@@ -364,14 +360,14 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame,
       && (print_entry_values != print_entry_values_if_needed
          || !val || value_optimized_out (val)))
     {
-      TRY
+      try
        {
          const struct symbol_computed_ops *ops;
 
          ops = SYMBOL_COMPUTED_OPS (sym);
          entryval = ops->read_variable_at_entry (sym, frame);
        }
-      CATCH (except, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &except)
        {
          if (except.error != NO_ENTRY_VALUE_ERROR)
            {
@@ -379,7 +375,6 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame,
              strcpy (entryval_error, except.what ());
            }
        }
-      END_CATCH
 
       if (entryval != NULL && value_optimized_out (entryval))
        entryval = NULL;
@@ -407,7 +402,7 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame,
                     value.  If it is a reference still try to verify if
                     dereferenced DW_AT_call_data_value does not differ.  */
 
-                 TRY
+                 try
                    {
                      struct type *type_deref;
 
@@ -428,7 +423,7 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame,
                                                TYPE_LENGTH (type_deref)))
                        val_equal = 1;
                    }
-                 CATCH (except, RETURN_MASK_ERROR)
+                 catch (const gdb_exception_RETURN_MASK_ERROR &except)
                    {
                      /* If the dereferenced content could not be
                         fetched do not display anything.  */
@@ -441,7 +436,6 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame,
                          strcpy (entryval_error, except.what ());
                        }
                    }
-                 END_CATCH
 
                  /* Value was not a reference; and its content matches.  */
                  if (val == val_deref)
@@ -473,16 +467,15 @@ read_frame_arg (struct symbol *sym, struct frame_info *frame,
        {
          gdb_assert (val == NULL);
 
-         TRY
+         try
            {
              val = read_var_value (sym, NULL, frame);
            }
-         CATCH (except, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &except)
            {
              val_error = (char *) alloca (except.message->size () + 1);
              strcpy (val_error, except.what ());
            }
-         END_CATCH
        }
       if (print_entry_values == print_entry_values_only
          || print_entry_values == print_entry_values_both
@@ -759,19 +752,18 @@ do_gdb_disassembly (struct gdbarch *gdbarch,
                    int how_many, CORE_ADDR low, CORE_ADDR high)
 {
 
-  TRY
+  try
     {
       gdb_disassembly (gdbarch, current_uiout,
                       DISASSEMBLY_RAW_INSN, how_many,
                       low, high);
     }
-  CATCH (exception, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &exception)
     {
       /* If an exception was thrown while doing the disassembly, print
         the error message, to give the user a clue of what happened.  */
       exception_print (gdb_stderr, exception);
     }
-  END_CATCH
 }
 
 /* Print information about frame FRAME.  The output is format according
@@ -1204,14 +1196,13 @@ print_frame (struct frame_info *frame, int print_level,
     
        {
          ui_out_emit_list list_emitter (uiout, "args");
-         TRY
+         try
            {
              print_frame_args (func, frame, numargs, gdb_stdout);
            }
-         CATCH (e, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_ERROR &e)
            {
            }
-         END_CATCH
 
            /* FIXME: ARGS must be a list.  If one argument is a string it
               will have " that will not be properly escaped.  */
@@ -1393,12 +1384,12 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
     val_print_not_saved (gdb_stdout);
   else
     {
-      TRY
+      try
        {
          caller_pc = frame_unwind_caller_pc (fi);
          caller_pc_p = 1;
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          switch (ex.error)
            {
@@ -1414,7 +1405,6 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
              break;
            }
        }
-      END_CATCH
     }
 
   if (caller_pc_p)
@@ -2694,7 +2684,7 @@ frame_apply_command_count (const char *which_command,
       QUIT;
 
       select_frame (fi);
-      TRY
+      try
        {
          std::string cmd_result;
          {
@@ -2714,7 +2704,7 @@ frame_apply_command_count (const char *which_command,
              printf_filtered ("%s", cmd_result.c_str ());
            }
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          fi = get_selected_frame (_("frame apply "
                                     "unable to get selected frame."));
@@ -2728,7 +2718,6 @@ frame_apply_command_count (const char *which_command,
                throw_exception (ex);
            }
        }
-      END_CATCH;
     }
 }
 
index 1029c012438199c285aa01b7788e6612ec6a6ad3..118f28987a311ffabcc067c7da8e927bde220706 100644 (file)
@@ -187,7 +187,7 @@ add_vsyscall_page (struct target_ops *target, int from_tty)
 
       char *name = xstrprintf ("system-supplied DSO at %s",
                               paddress (target_gdbarch (), vsyscall_range.start));
-      TRY
+      try
        {
          /* Pass zero for FROM_TTY, because the action of loading the
             vsyscall DSO was not triggered by the user, even if the
@@ -198,11 +198,10 @@ add_vsyscall_page (struct target_ops *target, int from_tty)
                                       name,
                                       0 /* from_tty */);
        }
-      CATCH (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
          exception_print (gdb_stderr, ex);
        }
-      END_CATCH
     }
 }
 
index 0220b42749e9df98bfddd35f9da28d8d9a4903f1..8867ba75d0fce3995b06536807cdc335f74d2773 100644 (file)
@@ -349,16 +349,15 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
             block, not any blocks from included symtabs.  */
          ALL_DICT_SYMBOLS (BLOCK_MULTIDICT (b), miter, sym)
            {
-             TRY
+             try
                {
                  print_symbol (gdbarch, sym, depth + 1, outfile);
                }
-             CATCH (ex, RETURN_MASK_ERROR)
+             catch (const gdb_exception_RETURN_MASK_ERROR &ex)
                {
                  exception_fprintf (gdb_stderr, ex,
                                     "Error printing symbol:\n");
                }
-             END_CATCH
            }
        }
       fprintf_filtered (outfile, "\n");
index 646f913e0a9b5766dad1f918bc01c55e7c179ffb..9b777ea8a07e0b65480270435889667620545cb2 100644 (file)
@@ -704,7 +704,7 @@ target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
     {
       ptid_t ptid = inferior_ptid;
 
-      TRY
+      try
        {
          CORE_ADDR lm_addr;
          
@@ -720,7 +720,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 (ex, RETURN_MASK_ALL)
+      catch (const gdb_exception_RETURN_MASK_ALL &ex)
        {
          int objfile_is_library = (objfile->flags & OBJF_SHARED);
 
@@ -771,7 +771,6 @@ target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
              break;
            }
        }
-      END_CATCH
     }
   else
     error (_("Cannot find thread-local variables on this target"));
index a86f26947c766bb4a7e277869e04499c1d3d656b..cde7c34df692741127da848b306be02edd43b142 100644 (file)
@@ -1459,7 +1459,7 @@ thr_try_catch_cmd (thread_info *thr, const char *cmd, int from_tty,
                   const qcs_flags &flags)
 {
   switch_to_thread (thr);
-  TRY
+  try
     {
       std::string cmd_result = execute_command_to_string (cmd, from_tty);
       if (!flags.silent || cmd_result.length () > 0)
@@ -1471,7 +1471,7 @@ thr_try_catch_cmd (thread_info *thr, const char *cmd, int from_tty,
          printf_filtered ("%s", cmd_result.c_str ());
        }
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       if (!flags.silent)
        {
@@ -1485,7 +1485,6 @@ thr_try_catch_cmd (thread_info *thr, const char *cmd, int from_tty,
            throw_exception (ex);
        }
     }
-  END_CATCH;
 }
 
 /* Apply a GDB command to a list of threads.  List syntax is a whitespace
index 1fc259fe0f487a208bc4fcbba782f34847e94b64..829b5340f37514406f6e1c66a302ddc2a34f4c21 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1621,31 +1621,29 @@ quit_force (int *exit_arg, int from_tty)
   /* We want to handle any quit errors and exit regardless.  */
 
   /* Get out of tfind mode, and kill or detach all inferiors.  */
-  TRY
+  try
     {
       disconnect_tracing ();
       iterate_over_inferiors (kill_or_detach, &qt);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       exception_print (gdb_stderr, ex);
     }
-  END_CATCH
 
   /* Give all pushed targets a chance to do minimal cleanup, and pop
      them all out.  */
-  TRY
+  try
     {
       pop_all_targets ();
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       exception_print (gdb_stderr, ex);
     }
-  END_CATCH
 
   /* Save the history information if it is appropriate to do so.  */
-  TRY
+  try
     {
       if (write_history_p && history_filename)
        {
@@ -1667,11 +1665,10 @@ quit_force (int *exit_arg, int from_tty)
            gdb_safe_append_history ();
        }
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       exception_print (gdb_stderr, ex);
     }
-  END_CATCH
 
   /* Destroy any values currently allocated now instead of leaving it
      to global destructors, because that may be too late.  For
@@ -1680,15 +1677,14 @@ quit_force (int *exit_arg, int from_tty)
   finalize_values ();
 
   /* Do any final cleanups before exiting.  */
-  TRY
+  try
     {
       do_final_cleanups ();
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       exception_print (gdb_stderr, ex);
     }
-  END_CATCH
 
   exit (exit_code);
 }
index 020a6be69b5f2fbe5348a30ff32f1a4e3364b76d..6581cb133dcc1375e9cfd36bd2b02d2b3994033b 100644 (file)
@@ -511,7 +511,7 @@ tfile_target_open (const char *arg, int from_tty)
   ts->disconnected_tracing = 0;
   ts->circular_buffer = 0;
 
-  TRY
+  try
     {
       /* Read through a section of newline-terminated lines that
         define things like tracepoints.  */
@@ -547,13 +547,12 @@ tfile_target_open (const char *arg, int from_tty)
       if (trace_regblock_size == 0)
        error (_("No register block size recorded in trace file"));
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       /* Remove the partially set up target.  */
       unpush_target (&tfile_ops);
       throw_exception (ex);
     }
-  END_CATCH
 
   inferior_appeared (current_inferior (), TFILE_PID);
   inferior_ptid = ptid_t (TFILE_PID);
index 4c9963291dc5f303bcb498f7b0ff28d2cb1819c7..533b7bc8ab8adb8f3079bff18a69d34874c88db1 100644 (file)
@@ -96,7 +96,7 @@ tui_rl_switch_mode (int notused1, int notused2)
 
   /* Don't let exceptions escape.  We're in the middle of a readline
      callback that isn't prepared for that.  */
-  TRY
+  try
     {
       if (tui_active)
        {
@@ -110,14 +110,13 @@ tui_rl_switch_mode (int notused1, int notused2)
          tui_enable ();
        }
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       exception_print (gdb_stderr, ex);
 
       if (!tui_active)
        rl_prep_terminal (0);
     }
-  END_CATCH
 
   /* Clear the readline in case switching occurred in middle of
      something.  */
index 0a93a831b86130a0a57c80df636c45ee558311fa..91ce29b1b28dc6cc2eb57fb5afb900c48a44efc2 100644 (file)
@@ -413,17 +413,16 @@ type_print (struct type *type, const char *varstring, struct ui_file *stream,
 std::string
 type_to_string (struct type *type)
 {
-  TRY
+  try
     {
       string_file stb;
 
       type_print (type, "", &stb, -1);
       return std::move (stb.string ());
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &except)
     {
     }
-  END_CATCH
 
   return {};
 }
index e357b06555f6e058824ec4b036af3cf9f44ab9d0..6b0efe53decd2709bff4d8f48c64031f945385e1 100644 (file)
@@ -78,19 +78,18 @@ test_number_or_range_parser ()
     number_or_range_parser minus_one ("-1");
 
     SELF_CHECK (!minus_one.finished ());
-    TRY
+    try
       {
        minus_one.get_number ();
        SELF_CHECK (false);
       }
-    CATCH (ex, RETURN_MASK_ERROR)
+    catch (const gdb_exception_RETURN_MASK_ERROR &ex)
       {
        SELF_CHECK (ex.reason == RETURN_ERROR);
        SELF_CHECK (ex.error == GENERIC_ERROR);
        SELF_CHECK (strcmp (ex.what (), "negative value") == 0);
        SELF_CHECK (strcmp (minus_one.cur_tok (), "-1") == 0);
       }
-    END_CATCH;
   }
 
   /* Test that a - followed by not a number does not give an error.  */
@@ -209,7 +208,7 @@ test_parse_flags_qcs ()
     const char *t4 = "-c -s non flags args";
     qcs_flags flags;
 
-    TRY
+    try
       {
        SELF_CHECK (parse_flags_qcs ("test_parse_flags_qcs.t4.cs",
                                     &t4,
@@ -220,7 +219,7 @@ test_parse_flags_qcs ()
                                &flags);
        SELF_CHECK (false);
       }
-    CATCH (ex, RETURN_MASK_ERROR)
+    catch (const gdb_exception_RETURN_MASK_ERROR &ex)
       {
        SELF_CHECK (ex.reason == RETURN_ERROR);
        SELF_CHECK (ex.error == GENERIC_ERROR);
@@ -229,7 +228,6 @@ test_parse_flags_qcs ()
                   "test_parse_flags_qcs.t4.cs: "
                   "-c and -s are mutually exclusive") == 0);
       }
-    END_CATCH;
   }
 
 }
index 969c51e4e88da5abbe593cfbaca891c72b9ef91b..a33b3d8de6de2e52a4c2cbeb7d8e82bb2efaee33 100644 (file)
@@ -212,18 +212,17 @@ test_conn (const parse_conn_test &c)
 
   memset (&hint, 0, sizeof (hint));
 
-  TRY
+  try
     {
       ret = parse_connection_spec (c.connspec, &hint);
     }
-  CATCH (ex, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &ex)
     {
       /* If we caught an error, we should check if this connection
         spec was supposed to fail.  */
       SELF_CHECK (c.should_fail);
       return;
     }
-  END_CATCH
 
   SELF_CHECK (!c.should_fail);
   SELF_CHECK (ret.host_str == c.expected_result.host_str);
index 3d1f39f8c954d08b9ad041fe375e21ea637a8353..69da319ea7d70ea9d9c4dddea133fa4878599795 100644 (file)
@@ -3621,11 +3621,11 @@ value_rtti_indirect_type (struct value *v, int *full,
   else if (TYPE_CODE (type) == TYPE_CODE_PTR)
     {
 
-      TRY
+      try
         {
          target = value_ind (v);
         }
-      CATCH (except, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &except)
        {
          if (except.error == MEMORY_ERROR)
            {
@@ -3636,7 +3636,6 @@ value_rtti_indirect_type (struct value *v, int *full,
            }
          throw_exception (except);
        }
-      END_CATCH
     }
   else
     return NULL;
@@ -3774,14 +3773,13 @@ value_of_this_silent (const struct language_defn *lang)
 {
   struct value *ret = NULL;
 
-  TRY
+  try
     {
       ret = value_of_this (lang);
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
     }
-  END_CATCH
 
   return ret;
 }
index 10020901c2df781033c31d6ee27dbaedae6514d1..755473038f80210f43fe97377ee47f533d88da95 100644 (file)
@@ -1054,17 +1054,16 @@ val_print (struct type *type, LONGEST embedded_offset,
       return;
     }
 
-  TRY
+  try
     {
       language->la_val_print (type, embedded_offset, address,
                              stream, recurse, val,
                              &local_opts);
     }
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       fprintf_filtered (stream, _("<error reading variable>"));
     }
-  END_CATCH
 }
 
 /* Check whether the value VAL is printable.  Return 1 if it is;
index 02307c1a836941f8bd19d5ec599b63af3a7aafe3..99a27b5e7b346f1fab0bda196fc01e1d5299091d 100644 (file)
@@ -1405,15 +1405,14 @@ value_optimized_out (struct value *value)
      fetch it.  */
   if (value->optimized_out.empty () && value->lazy)
     {
-      TRY
+      try
        {
          value_fetch_lazy (value);
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          /* Fall back to checking value->optimized_out.  */
        }
-      END_CATCH
     }
 
   return !value->optimized_out.empty ();
@@ -2535,18 +2534,17 @@ show_convenience (const char *ignore, int from_tty)
        }
       printf_filtered (("$%s = "), var->name);
 
-      TRY
+      try
        {
          struct value *val;
 
          val = value_of_internalvar (gdbarch, var);
          value_print (val, gdb_stdout, &opts);
        }
-      CATCH (ex, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &ex)
        {
          fprintf_filtered (gdb_stdout, _("<error: %s>"), ex.what ());
        }
-      END_CATCH
 
       printf_filtered (("\n"));
     }
index abace990494e71e3954c2b53795fbba174544528..54b0943d2ea7c440e10cbdb09ec2c2cfc72d0275 100644 (file)
@@ -314,16 +314,15 @@ varobj_create (const char *objname,
                                       | INNERMOST_BLOCK_FOR_REGISTERS);
       /* Wrap the call to parse expression, so we can 
          return a sensible error.  */
-      TRY
+      try
        {
          var->root->exp = parse_exp_1 (&p, pc, block, 0, &tracker);
        }
 
-      CATCH (except, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &except)
        {
          return NULL;
        }
-      END_CATCH
 
       /* Don't allow variables to be created for types.  */
       if (var->root->exp->elts[0].opcode == OP_TYPE
@@ -364,11 +363,11 @@ varobj_create (const char *objname,
       /* We definitely need to catch errors here.
          If evaluate_expression succeeds we got the value we wanted.
          But if it fails, we still go on with a call to evaluate_type().  */
-      TRY
+      try
        {
          value = evaluate_expression (var->root->exp.get ());
        }
-      CATCH (except, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &except)
        {
          /* Error getting the value.  Try to at least get the
             right type.  */
@@ -376,7 +375,6 @@ varobj_create (const char *objname,
 
          var->type = value_type (type_only_value);
        }
-      END_CATCH
 
       if (value != NULL)
        {
@@ -1034,17 +1032,16 @@ varobj_set_value (struct varobj *var, const char *expression)
 
   input_radix = 10;            /* ALWAYS reset to decimal temporarily.  */
   expression_up exp = parse_exp_1 (&s, 0, 0, 0);
-  TRY
+  try
     {
       value = evaluate_expression (exp.get ());
     }
 
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       /* We cannot proceed without a valid expression.  */
       return false;
     }
-  END_CATCH
 
   /* All types that are editable must also be changeable.  */
   gdb_assert (varobj_value_is_changeable_p (var));
@@ -1063,16 +1060,15 @@ varobj_set_value (struct varobj *var, const char *expression)
 
   /* The new value may be lazy.  value_assign, or
      rather value_contents, will take care of this.  */
-  TRY
+  try
     {
       val = value_assign (var->value.get (), value);
     }
 
-  CATCH (except, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &except)
     {
       return false;
     }
-  END_CATCH
 
   /* If the value has changed, record it, so that next -var-update can
      report this change.  If a variable had a value of '1', we've set it
@@ -1311,19 +1307,18 @@ install_new_value (struct varobj *var, struct value *value, bool initial)
       else
        {
 
-         TRY
+         try
            {
              value_fetch_lazy (value);
            }
 
-         CATCH (except, RETURN_MASK_ERROR)
+         catch (const gdb_exception_RETURN_MASK_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,
                 that we couldn't even read.  */
              value = NULL;
            }
-         END_CATCH
        }
     }
 
@@ -2139,14 +2134,13 @@ value_of_root_1 (struct varobj **var_handle)
 
       /* We need to catch errors here, because if evaluate
          expression fails we want to just return NULL.  */
-      TRY
+      try
        {
          new_val = evaluate_expression (var->root->exp.get ());
        }
-      CATCH (except, RETURN_MASK_ERROR)
+      catch (const gdb_exception_RETURN_MASK_ERROR &except)
        {
        }
-      END_CATCH
     }
 
   return new_val;
index 47f6cbb541265c62f59931fb562412ee92325012..0df9e312d33c866b0b3942354895f427a33dcc7f 100644 (file)
@@ -943,15 +943,14 @@ handle_unload_dll ()
 static void
 catch_errors (void (*func) ())
 {
-  TRY
+  try
     {
       func ();
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       exception_print (gdb_stderr, ex);
     }
-  END_CATCH
 }
 
 /* Clear list of loaded DLLs.  */
index f60ed8a9bdedc0f276200b02fb77f4cc278f0b86..1aa491ac3732ad0270e85d868edfccd7e547ce0e 100644 (file)
@@ -217,16 +217,15 @@ x86_linux_nat_target::enable_btrace (ptid_t ptid,
                                     const struct btrace_config *conf)
 {
   struct btrace_target_info *tinfo = nullptr;
-  TRY
+  try
     {
       tinfo = linux_enable_btrace (ptid, conf);
     }
-  CATCH (exception, RETURN_MASK_ERROR)
+  catch (const gdb_exception_RETURN_MASK_ERROR &exception)
     {
       error (_("Could not enable branch tracing for %s: %s"),
             target_pid_to_str (ptid).c_str (), exception.what ());
     }
-  END_CATCH
 
   return tinfo;
 }
index 587a3af74cb3013c18c3f1710263a470c07464d8..1a89213ab8ff45af988105c547b18dd9b3cbf433 100644 (file)
@@ -383,15 +383,14 @@ gdb_xml_start_element_wrapper (void *data, const XML_Char *name,
 {
   struct gdb_xml_parser *parser = (struct gdb_xml_parser *) data;
 
-  TRY
+  try
     {
       parser->start_element (name, attrs);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       parser->set_error (ex);
     }
-  END_CATCH
 }
 
 /* Handle the end of an element.  NAME is the current element.  */
@@ -456,15 +455,14 @@ gdb_xml_end_element_wrapper (void *data, const XML_Char *name)
 {
   struct gdb_xml_parser *parser = (struct gdb_xml_parser *) data;
 
-  TRY
+  try
     {
       parser->end_element (name);
     }
-  CATCH (ex, RETURN_MASK_ALL)
+  catch (const gdb_exception_RETURN_MASK_ALL &ex)
     {
       parser->set_error (ex);
     }
-  END_CATCH
 }
 
 /* Free a parser and all its associated state.  */
This page took 0.227478 seconds and 4 git commands to generate.