aboutsummaryrefslogtreecommitdiff
path: root/gdb/guile
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-04-03 16:02:42 -0600
committerTom Tromey <tom@tromey.com>2019-04-08 09:05:39 -0600
commita70b814420059e1f2de2130d532ddd7b2b2500fc (patch)
treece50952af2443675e67a60508a10c8fd5ab0715c /gdb/guile
parent3d6e9d2336c9ffcedb10f89631981a23dd518e8e (diff)
downloadgdb-a70b814420059e1f2de2130d532ddd7b2b2500fc.zip
gdb-a70b814420059e1f2de2130d532ddd7b2b2500fc.tar.gz
gdb-a70b814420059e1f2de2130d532ddd7b2b2500fc.tar.bz2
Rewrite TRY/CATCH
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.
Diffstat (limited to 'gdb/guile')
-rw-r--r--gdb/guile/guile-internal.h5
-rw-r--r--gdb/guile/scm-block.c5
-rw-r--r--gdb/guile/scm-breakpoint.c40
-rw-r--r--gdb/guile/scm-cmd.c5
-rw-r--r--gdb/guile/scm-disasm.c5
-rw-r--r--gdb/guile/scm-frame.c95
-rw-r--r--gdb/guile/scm-lazy-string.c5
-rw-r--r--gdb/guile/scm-math.c5
-rw-r--r--gdb/guile/scm-param.c10
-rw-r--r--gdb/guile/scm-ports.c5
-rw-r--r--gdb/guile/scm-pretty-print.c5
-rw-r--r--gdb/guile/scm-symbol.c25
-rw-r--r--gdb/guile/scm-symtab.c5
-rw-r--r--gdb/guile/scm-type.c60
-rw-r--r--gdb/guile/scm-value.c75
15 files changed, 140 insertions, 210 deletions
diff --git a/gdb/guile/guile-internal.h b/gdb/guile/guile-internal.h
index d05f468..0a24325 100644
--- a/gdb/guile/guile-internal.h
+++ b/gdb/guile/guile-internal.h
@@ -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);
diff --git a/gdb/guile/scm-block.c b/gdb/guile/scm-block.c
index df1dfe5..6f91f88 100644
--- a/gdb/guile/scm-block.c
+++ b/gdb/guile/scm-block.c
@@ -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)
{
diff --git a/gdb/guile/scm-breakpoint.c b/gdb/guile/scm-breakpoint.c
index d052748..356abca 100644
--- a/gdb/guile/scm-breakpoint.c
+++ b/gdb/guile/scm-breakpoint.c
@@ -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 ());
diff --git a/gdb/guile/scm-cmd.c b/gdb/guile/scm-cmd.c
index 1266a79..a89650b 100644
--- a/gdb/guile/scm-cmd.c
+++ b/gdb/guile/scm-cmd.c
@@ -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. */
diff --git a/gdb/guile/scm-disasm.c b/gdb/guile/scm-disasm.c
index e4a9c92..584de37 100644
--- a/gdb/guile/scm-disasm.c
+++ b/gdb/guile/scm-disasm.c
@@ -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);
diff --git a/gdb/guile/scm-frame.c b/gdb/guile/scm-frame.c
index 22c7892..9360bb9 100644
--- a/gdb/guile/scm-frame.c
+++ b/gdb/guile/scm-frame.c
@@ -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 ());
}
diff --git a/gdb/guile/scm-lazy-string.c b/gdb/guile/scm-lazy-string.c
index a874e68..5dd386a 100644
--- a/gdb/guile/scm-lazy-string.c
+++ b/gdb/guile/scm-lazy-string.c
@@ -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;
}
diff --git a/gdb/guile/scm-math.c b/gdb/guile/scm-math.c
index d351ed0..3be9fb6 100644
--- a/gdb/guile/scm-math.c
+++ b/gdb/guile/scm-math.c
@@ -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))
{
diff --git a/gdb/guile/scm-param.c b/gdb/guile/scm-param.c
index 69bc97e..ee29712 100644
--- a/gdb/guile/scm-param.c
+++ b/gdb/guile/scm-param.c
@@ -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);
diff --git a/gdb/guile/scm-ports.c b/gdb/guile/scm-ports.c
index 2950b1e..20557f8 100644
--- a/gdb/guile/scm-ports.c
+++ b/gdb/guile/scm-ports.c
@@ -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. */
diff --git a/gdb/guile/scm-pretty-print.c b/gdb/guile/scm-pretty-print.c
index e509694..6706f82 100644
--- a/gdb/guile/scm-pretty-print.c
+++ b/gdb/guile/scm-pretty-print.c
@@ -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;
}
diff --git a/gdb/guile/scm-symbol.c b/gdb/guile/scm-symbol.c
index de3a158..65eb101 100644
--- a/gdb/guile/scm-symbol.c
+++ b/gdb/guile/scm-symbol.c
@@ -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);
diff --git a/gdb/guile/scm-symtab.c b/gdb/guile/scm-symtab.c
index 5ba7755..8879c32 100644
--- a/gdb/guile/scm-symtab.c
+++ b/gdb/guile/scm-symtab.c
@@ -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);
}
diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c
index 2d2e3dd..ee0bfa7 100644
--- a/gdb/guile/scm-type.c
+++ b/gdb/guile/scm-type.c
@@ -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;
}
diff --git a/gdb/guile/scm-value.c b/gdb/guile/scm-value.c
index 658924b..7f119a2 100644
--- a/gdb/guile/scm-value.c
+++ b/gdb/guile/scm-value.c
@@ -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.