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.
* x86-linux-nat.c (x86_linux_nat_target::enable_btrace): Update.
* value.c (show_convenience): Update.
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;
}
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;
}
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. */
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;
}
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
_("unable to read value of %s (%s)"),
xvz_name, except.what ());
}
- END_CATCH
if (xvz_found && TYPE_LENGTH (fixed_record_type) != size)
{
{
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;
}
{
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;
}
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);
}
stop = 1;
- TRY
+ try
{
struct value *mark;
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;
}
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
fprintf_filtered (stream, "<>");
got_error = 1;
}
- END_CATCH
if (!got_error)
{
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
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;
}
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;
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;
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);
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;
}
{
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;
}
if (self->pattern == NULL)
return;
- TRY
+ try
{
struct value *typeinfo_arg;
std::string canon;
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 ())
{
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;
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, {});
}
/* 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;
/* 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;
|| !(section_is_overlay (bl->section)))
{
/* No overlay handling: just set the breakpoint. */
- TRY
+ try
{
int val;
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
{
bl->overlay_target_info.reqstd_address = addr;
/* No overlay handling: just set the breakpoint. */
- TRY
+ try
{
int 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
if (bp_excpt.reason != 0)
fprintf_unfiltered (tmp_error_stream,
if (section_is_mapped (bl->section))
{
/* Yes. This overlay section is mapped into memory. */
- TRY
+ try
{
int val;
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
{
{
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 "
watchpoint_del_at_next_stop (b);
e = WP_DELETED;
}
- END_CATCH
switch (e)
{
}
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
{
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. */
else
throw_exception (e);
}
- END_CATCH
if (!pending && canonical.lsals.empty ())
return 0;
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. */
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 ())
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;
throw_exception (e);
}
}
- END_CATCH
if (exception.reason == 0 || exception.error != NOT_FOUND_ERROR)
{
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 ();
/* 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;
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;
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");
enum btrace_insn_class iclass;
iclass = BTRACE_INSN_OTHER;
- TRY
+ try
{
if (gdbarch_insn_is_call (gdbarch, pc))
iclass = BTRACE_INSN_CALL;
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;
}
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;
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;
}
if (decoder == NULL)
error (_("Failed to allocate the Intel Processor Trace decoder."));
- TRY
+ try
{
struct pt_image *image;
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 ())
throw_exception (error);
}
- END_CATCH
btrace_finalize_ftrace_pt (decoder, tp, level);
}
{
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);
}
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.
&& 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. */
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);
}
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)
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;
}
{
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)
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
int quote_char = '\0';
const char *word;
- TRY
+ try
{
word = completion_find_completion_word (tracker_handle_brkchars,
arg, "e_char);
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);
scoped_restore saved_uiout = make_scoped_restore (¤t_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. */
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. */
scoped_restore save_async = make_scoped_restore (¤t_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. */
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
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;
}
&& 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 ();
}
/* 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;
}
}
- 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,
/* We can't allow exceptions to escape out of this callback. Safest
is to simply emit a gcc error. */
- TRY
+ try
{
struct symbol *sym;
}
}
- 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,
struct symbol *sym)
{
- TRY
+ try
{
if (is_dynamic_type (SYMBOL_TYPE (sym)))
{
}
}
- 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. */
bool found = false;
compile_cplus_instance *instance = (compile_cplus_instance *) datum;
- TRY
+ try
{
/* Symbol searching is a three part process unfortunately. */
}
}
}
- 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,
/* 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;
}
}
- 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,
{
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
}
}
xfree (module);
module = NULL;
- TRY
+ try
{
struct type *func_type = SYMBOL_TYPE (func_sym);
htab_t copied_types;
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. */
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);
/* 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)
{
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. */
/* 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;
}
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;
}
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)
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
}
}
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);
_("Cannot determine virtual baseclass offset "
"of incomplete object"));
}
- END_CATCH
return res;
}
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;
}
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)
{
}
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);
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)
{
{
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,
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)
{
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)
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))
/* 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\
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\
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);
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;
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 ()))
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
/* 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",
((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 {};
}
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
}
}
this_pc = get_frame_address_in_block (this_frame);
/* Catch any unwinding errors. */
- TRY
+ try
{
int sp_regnum;
}
}
}
- 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)
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)
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)
{
throw_exception (ex);
}
- END_CATCH
/* Initialize the register state. */
{
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)
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 ());
}
/* The cie_table is discarded by the next if. */
}
- END_CATCH
if (cie_table.num_entries != 0)
{
{
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)
&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 ());
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. */
{
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)
{
else
throw_exception (e);
}
- END_CATCH
return retval;
}
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)
{
else
throw_exception (ex);
}
- END_CATCH
if (ctx.pieces.size () > 0)
{
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)
{
else
throw_exception (ex);
}
- END_CATCH
switch (ctx.location)
{
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,
/* (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. */
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
break;
}
}
- END_CATCH
new_mark = value_mark ();
if (mark == new_mark)
else
{
- TRY
+ try
{
value_fetch_lazy (result);
*valp = result;
}
- CATCH (except, RETURN_MASK_ERROR)
+ catch (const gdb_exception_RETURN_MASK_ERROR &except)
{
}
- END_CATCH
}
}
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;
}
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;
}
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;
}
{
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);
/* Maybe better to set a flag to be checked somewhere as to
whether display the prompt or not. */
}
- END_CATCH
if (result < 0)
break;
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
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);
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
}
}
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');
}
}
/* 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.
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
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
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
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. */
}
throw_exception (ex);
}
- END_CATCH
if (res)
return 1;
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)
{
else
throw_exception (ex);
}
- END_CATCH
if (pc_p)
{
if (prev_frame->level == 0)
return prev_frame;
- TRY
+ try
{
compute_frame_id (prev_frame);
if (!frame_stash_add (prev_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;
}
{
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)
{
else
throw_exception (ex);
}
- END_CATCH
return prev_frame;
}
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;
}
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;
}
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)
{
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)
(handle_qxfer_btrace_conf, detach_or_kill_for_exit_cleanup)
(captured_main, main): Update.
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)
{
exit (1);
}
- END_CATCH
gdb_assert_not_reached ("captured_main should never return");
}
/* 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);
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,
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.
return -1;
}
- TRY
+ try
{
if (strcmp (op, "bts") == 0)
handle_btrace_enable_bts (thread);
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;
}
{
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;
{
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;
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,
remote_open (port);
- TRY
+ try
{
/* Wait for events. This will return when all event sources
are removed from the event loop. */
}
}
}
- CATCH (exception, RETURN_MASK_ERROR)
+ catch (const gdb_exception_RETURN_MASK_ERROR &exception)
{
fflush (stdout);
fprintf (stderr, "gdbserver: %s\n", exception.what ());
if (run_once)
throw_quit ("Quit");
}
- END_CATCH
}
}
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)
{
exit (exit_code);
}
- END_CATCH
gdb_assert_not_reached ("captured_main should never return");
}
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;
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);
{
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);
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)
{
current_language,
symbol_name_match_type::WILD);
- TRY
+ try
{
int internal = bp_smob->spec.is_internal;
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;
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;
}
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;
}
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;
}
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;
}
{
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)
{
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;
}
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 ());
c_smob->cmd_name = gdbscm_gc_xstrdup (cmd_name);
xfree (cmd_name);
- TRY
+ try
{
if (c_smob->is_prefix)
{
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. */
int insn_len = 0;
string_file buf;
- TRY
+ try
{
if (using_port)
{
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);
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
}
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);
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);
}
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
struct gdb_exception except = exception_none;
- TRY
+ try
{
int regnum;
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);
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)
{
/* 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;
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);
_("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);
}
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)
{
{
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 ());
}
{
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 ());
}
return NULL;
}
- TRY
+ try
{
struct type *type = tyscm_scm_to_type (ls_smob->type);
struct type *realtype = check_typedef (type);
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;
}
*except_scmp = SCM_BOOL_F;
- TRY
+ try
{
if (vlscm_is_value (obj))
{
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))
{
_("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,
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. */
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);
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. */
SCM result = SCM_BOOL_F;
*out_value = NULL;
- TRY
+ try
{
pretty_printer_worker_smob *w_smob
= (pretty_printer_worker_smob *) SCM_SMOB_DATA (printer);
(_("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;
}
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);
}
_("cannot get the value of a typedef"));
}
- TRY
+ try
{
if (f_smob != NULL)
{
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);
}
{
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);
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);
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);
}
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");
}
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);
}
= 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. */
= 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);
}
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)
_("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);
}
= 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);
}
= 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);
}
= 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);
}
= 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);
}
= 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);
}
{
struct type *type = NULL;
- TRY
+ try
{
if (startswith (type_name, "struct "))
type = lookup_struct (type_name + 7, NULL);
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;
}
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);
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);
}
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;
if (! SCM_UNBNDP (v_smob->dynamic_type))
return v_smob->dynamic_type;
- TRY
+ try
{
scoped_value_mark free_values;
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);
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,
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);
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);
}
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);
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))
{
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))
/* 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. */
_("invalid length"));
}
- TRY
+ try
{
scoped_value_mark free_values;
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);
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.
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");
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)
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;
}
cache = i386_alloc_frame_cache ();
*this_cache = cache;
- TRY
+ try
{
cache->pc = get_frame_func (this_frame);
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;
}
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;
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;
/* 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
else
exception_print (gdb_stderr, e);
}
- END_CATCH
}
break;
/* We want to print return value, please... */
call_thread->control.proceed_to_finish = 1;
- TRY
+ try
{
proceed (real_pc, GDB_SIGNAL_0);
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
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)
{
|| 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. */
{
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;
= get_displaced_stepping_state (thread->inf);
displaced_state->failed_before = 1;
}
- END_CATCH
return prepared;
}
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
delete_single_step_breakpoints (inferior_thread ());
throw_exception (ex);
}
- END_CATCH
}
\f
struct frame_info *frame,
struct symbol *sym)
{
- TRY
+ try
{
struct block_symbol vsym;
struct value *value;
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
if (!func)
return;
- TRY
+ try
{
const struct block *b;
struct block_iterator iter;
}
}
}
- CATCH (e, RETURN_MASK_ERROR)
+ catch (const gdb_exception_RETURN_MASK_ERROR &e)
{
}
- END_CATCH
}
static void
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);
{
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
/* 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");
innermost frame. */
select_frame (get_current_frame ());
}
- END_CATCH
}
delete inf_status;
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)
{
/* 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);
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
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)
{
line_offset unknown_offset = { 0, LINE_OFFSET_UNKNOWN };
- TRY
+ try
{
convert_explicit_location_to_linespec (PARSER_STATE (&parser),
PARSER_RESULT (&parser),
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);
}
/* 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
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;
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 (),
/* 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
}
}
}
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
}
}
/* 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);
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. */
/* 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)
{
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. */
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;
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;
}
/* 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.
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,
return 1;
}
}
- END_CATCH
return 0;
}
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,
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);
test_passed = false;
}
- END_CATCH
if (test_passed && log_progress)
debug_printf (_("libthread_db integrity checks passed.\n"));
/* 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,
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)
{
"Warning: find_new_threads_once: ");
}
}
- END_CATCH
if (libthread_db_debug)
{
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;
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;
}
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. */
}
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. */
{
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
}
}
stb.printf (_("<error reading variable: %s>"), arg->error);
else
{
- TRY
+ try
{
struct value_print_options opts;
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);
}
ui_out_redirect. */
mi_uiout->redirect (mi->event_channel);
- TRY
+ try
{
scoped_restore restore_uiout
= make_scoped_restore (¤t_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);
}
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)
{
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
mi_print_exception (command->token, result);
mi_out_rewind (current_uiout);
}
- END_CATCH
bpstat_do_actions ();
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;
}
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)
{
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
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. */
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;
{
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,
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. */
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;
d->exp_string, ex.what ());
return;
}
- END_CATCH
}
if (d->block)
annotate_display_value ();
- TRY
+ try
{
struct value *val;
CORE_ADDR addr;
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
{
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");
}
fputs_styled (name, variable_name_style.style (), stream);
fputs_filtered (" = ", stream);
- TRY
+ try
{
struct value *val;
struct value_print_options opts;
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");
}
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))
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;
}
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)
{
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;
}
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;
}
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);
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 ();
if (commands == nullptr)
return -1;
- TRY
+ try
{
bool first = true;
char *save_ptr = nullptr;
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);
bppy_pending_object->number = -1;
bppy_pending_object->bp = NULL;
- TRY
+ try
{
switch (type)
{
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;
gdbpy_ref<> self_ref = gdbpy_ref<>::new_reference (self);
- TRY
+ try
{
struct cmd_list_element *cmd;
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);
gdbpy_convert_exception (except);
return -1;
}
- END_CATCH
return 0;
}
if (!self_finishbp->return_type)
return;
- TRY
+ try
{
struct value *function =
value_object_to_value (self_finishbp->function_value);
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
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. */
&frame_obj, &internal))
return -1;
- TRY
+ try
{
/* Default frame to newest frame if necessary. */
if (frame_obj == NULL)
}
}
}
- 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;
self_bpfinish->return_type = NULL;
self_bpfinish->function_value = NULL;
- TRY
+ try
{
if (get_frame_pc_if_available (frame, &pc))
{
}
}
}
- 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)
{
bppy_pending_object->number = -1;
bppy_pending_object->bp = NULL;
- TRY
+ try
{
/* Set a breakpoint on the return address. */
event_location_up location
&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;
/* 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
}
}
{
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;
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)
{
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);
}
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);
}
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);
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);
}
if (!PyArg_ParseTuple (args, "s", ®num_str))
return NULL;
- TRY
+ try
{
struct frame_info *frame;
int regnum;
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);
}
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;
struct symbol *sym = NULL;
struct frame_info *frame;
- TRY
+ try
{
enum language funlang;
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);
if (frame_obj == NULL)
return NULL;
- TRY
+ try
{
/* Try to get the previous frame, to determine if this is the last 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 ();
}
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);
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);
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;
}
}
}
- TRY
+ try
{
struct block_symbol lookup_sym;
FRAPY_REQUIRE_VALID (self, frame);
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)
{
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);
}
{
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;
}
{
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);
}
{
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);
}
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);
}
}
- 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. */
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)
PyEval_SaveThread ();
return NULL;
}
- END_CATCH
/* Detect EOF (Ctrl-D). */
if (p == NULL)
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)
|| 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));
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);
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);
return NULL;
}
- TRY
+ try
{
struct thread_info *thread_info;
struct value *val = value_object_to_value (handle_obj);
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;
}
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;
}
return NULL;
}
- TRY
+ try
{
struct type *type = type_object_to_type (self_string->type);
struct type *realtype;
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);
}
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);
}
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)
{
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;
}
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;
}
gdbpy_ref<> result;
*out_value = NULL;
- TRY
+ try
{
if (!PyObject_HasAttr (printer, gdbpy_to_string_cst))
result = gdbpy_ref<>::new_reference (Py_None);
}
}
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception_RETURN_MASK_ALL &except)
{
}
- END_CATCH
return result;
}
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)
if (!PyArg_ParseTuple (args, GDB_PY_LLU_ARG, &pc))
return NULL;
- TRY
+ try
{
scoped_restore_current_program_space saver;
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)
{
if (!PyArg_ParseTuple (args, GDB_PY_LLU_ARG, &pc_llu))
return NULL;
- TRY
+ try
{
struct symtab_and_line sal;
CORE_ADDR pc;
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;
}
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;
}
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);
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 ());
return PyErr_Format (PyExc_TypeError, _("Argument must be instruction."));
obj = (const recpy_element_object *) parse_obj;
- TRY
+ try
{
struct btrace_insn_iterator iter;
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;
}
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;
}
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;
}
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;
return NULL;
}
- TRY
+ try
{
if (frame_obj != NULL)
{
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);
}
{
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)
&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)
{
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)
{
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);
}
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;
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);
}
{
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);
}
{
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);
}
{
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);
}
{
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);
}
{
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);
}
{
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. */
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. */
{
struct type *type = NULL;
- TRY
+ try
{
if (startswith (type_name, "struct "))
type = lookup_struct (type_name + 7, NULL);
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;
}
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
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
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)
{
}
}
- 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 --
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);
}
{
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);
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))
int rc = 0;
struct value *value;
- TRY
+ try
{
if ((value = value_object_to_value (pyo_value)) != NULL)
{
rc = 1;
}
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception_RETURN_MASK_ALL &except)
{
gdbpy_convert_exception (except);
}
- END_CATCH
return rc;
}
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>)");
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);
}
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",
"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);
}
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
{
{
PyObject *result = NULL;
- TRY
+ try
{
struct value *res_val;
scoped_value_mark free_values;
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;
}
{
PyObject *result = NULL;
- TRY
+ try
{
struct value *self_val, *res_val;
scoped_value_mark free_values;
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;
}
{
PyObject *result = NULL;
- TRY
+ try
{
struct value *self_val;
scoped_value_mark free_values;
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;
}
{
PyObject *result = NULL;
- TRY
+ try
{
struct value *self_val, *res_val;
scoped_value_mark free_values;
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;
}
if (!val_obj->address)
{
- TRY
+ try
{
struct value *res_val;
scoped_value_mark free_values;
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);
return obj->dynamic_type;
}
- TRY
+ try
{
struct value *val = obj->value;
scoped_value_mark free_values;
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);
return NULL;
}
- TRY
+ try
{
scoped_value_mark free_values;
struct type *type, *realtype;
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;
}
&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 (),
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);
}
return NULL;
}
- TRY
+ try
{
struct value *val = ((value_object *) self)->value;
struct value *res_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;
}
return -1;
}
- TRY
+ try
{
val_type = value_type (v);
val_type = check_typedef (val_type);
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;
}
}
}
- TRY
+ try
{
struct value *tmp = self_value->value;
struct value *res_val = NULL;
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);
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)
{
}
}
- TRY
+ try
{
scoped_value_mark free_values;
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;
}
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);
}
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;
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;
{
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;
}
{
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;
}
{
PyObject *result = NULL;
- TRY
+ try
{
/* Perhaps overkill, but consistency has some virtue. */
scoped_value_mark free_values;
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;
}
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);
struct type *type;
int nonzero = 0; /* Appease GCC warning. */
- TRY
+ try
{
type = check_typedef (value_type (self_value->value));
/* 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
{
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);
}
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)
struct type *type = value_type (value);
LONGEST l = 0;
- TRY
+ try
{
if (is_floating_value (value))
{
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 ();
struct type *type = value_type (value);
LONGEST l = 0;
- TRY
+ try
{
if (is_floating_value (value))
{
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);
struct type *type = value_type (value);
double d = 0;
- TRY
+ try
{
type = check_typedef (type);
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);
}
gdb_assert (obj != NULL);
- TRY
+ try
{
if (PyBool_Check (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;
}
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);
}
if (!PyArg_ParseTuple (args, "s", &varname))
return NULL;
- TRY
+ try
{
struct internalvar *var = lookup_only_internalvar (varname);
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;
return NULL;
}
- TRY
+ try
{
if (value == NULL)
{
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;
}
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,
scoped_restore preventer = prevent_dont_repeat ();
- TRY
+ try
{
gdbpy_allow_threads allow_threads;
/* 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 ());
std::vector<symtab_and_line> decoded_sals;
symtab_and_line def_sal;
gdb::array_view<symtab_and_line> sals;
- TRY
+ try
{
if (location != NULL)
{
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 ())
{
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);
}
&stream_type))
return NULL;
- TRY
+ try
{
switch (stream_type)
{
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;
}
/* 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
if (msg != NULL)
type = fetched_error.type_to_string ();
- TRY
+ try
{
if (msg == NULL || type == NULL)
{
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
}
}
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. */
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;
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;
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);
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;
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;
throw_exception (except);
}
- END_CATCH
return replay;
}
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. */
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". */
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. */
int ret;
struct gdbarch *gdbarch = regcache->arch ();
- TRY
+ try
{
record_full_arch_list_head = NULL;
record_full_arch_list_tail = NULL;
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;
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;
}
int continue_flag = 1;
int first_record_full_end = 1;
- TRY
+ try
{
CORE_ADDR tmp_pc;
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)
{
throw_exception (ex);
}
- END_CATCH
}
signal (SIGINT, handle_sigint);
record_full_arch_list_tail = NULL;
record_full_insn_num = 0;
- TRY
+ try
{
regcache = get_current_regcache ();
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;
}
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;
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)
{
}
putpkt ("E01");
}
- END_CATCH
if (relocated)
{
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. */
remote_unpush_target ();
throw_exception (ex);
}
- END_CATCH
}
remote_btrace_reset (rs);
{
/* 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)
{
user or higher layers decide what to do. */
throw_exception (ex);
}
- END_CATCH
}
void
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)
{
}
throw_exception (ex);
}
- END_CATCH
result = packet_ok (p, &remote_protocol_packets[PACKET_qTStatus]);
/* 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;
}
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));
{
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. */
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);
cache->pc = 0;
cache->saved_regs = trad_frame_alloc_saved_regs (this_frame);
- TRY
+ try
{
func = get_frame_func (this_frame);
cache->pc = func;
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.
(*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. */
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;
}
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
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");
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;
}
QUIT;
- TRY
+ try
{
struct gdbarch_info info;
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 ();
}
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)
{
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)
{
{
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,
link_ptr = &newobj->next;
}
}
- CATCH (ex, RETURN_MASK_ALL)
+ catch (const gdb_exception_RETURN_MASK_ALL &ex)
{
/* Ignore memory errors. */
switch (ex.error)
break;
}
}
- END_CATCH
}
}
}
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;
}
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. */
= 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;
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
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;
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);
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;
flags |= current_inferior ()->symfile_flags;
- TRY
+ try
{
/* Have we already loaded this shared object? */
so->objfile = nullptr;
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;
}
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
}
}
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))
}
}
- 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. */
{
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)))
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");
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)
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
stb.printf (_("<error reading variable: %s>"), arg->error);
else
{
- TRY
+ try
{
const struct language_defn *language;
struct value_print_options opts;
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
}
}
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
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
&& (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)
{
strcpy (entryval_error, except.what ());
}
}
- END_CATCH
if (entryval != NULL && value_optimized_out (entryval))
entryval = NULL;
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;
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. */
strcpy (entryval_error, except.what ());
}
}
- END_CATCH
/* Value was not a reference; and its content matches. */
if (val == val_deref)
{
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
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
{
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. */
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)
{
break;
}
}
- END_CATCH
}
if (caller_pc_p)
QUIT;
select_frame (fi);
- TRY
+ try
{
std::string cmd_result;
{
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."));
throw_exception (ex);
}
}
- END_CATCH;
}
}
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
name,
0 /* from_tty */);
}
- CATCH (ex, RETURN_MASK_ALL)
+ catch (const gdb_exception_RETURN_MASK_ALL &ex)
{
exception_print (gdb_stderr, ex);
}
- END_CATCH
}
}
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");
{
ptid_t ptid = inferior_ptid;
- TRY
+ try
{
CORE_ADDR lm_addr;
}
/* 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);
break;
}
}
- END_CATCH
}
else
error (_("Cannot find thread-local variables on this target"));
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)
printf_filtered ("%s", cmd_result.c_str ());
}
}
- CATCH (ex, RETURN_MASK_ERROR)
+ catch (const gdb_exception_RETURN_MASK_ERROR &ex)
{
if (!flags.silent)
{
throw_exception (ex);
}
}
- END_CATCH;
}
/* Apply a GDB command to a list of threads. List syntax is a whitespace
/* 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)
{
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
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);
}
ts->disconnected_tracing = 0;
ts->circular_buffer = 0;
- TRY
+ try
{
/* Read through a section of newline-terminated lines that
define things like tracepoints. */
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);
/* 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)
{
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. */
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 {};
}
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. */
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,
&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);
"test_parse_flags_qcs.t4.cs: "
"-c and -s are mutually exclusive") == 0);
}
- END_CATCH;
}
}
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);
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)
{
}
throw_exception (except);
}
- END_CATCH
}
else
return NULL;
{
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;
}
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;
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 ();
}
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"));
}
| 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
/* 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. */
var->type = value_type (type_only_value);
}
- END_CATCH
if (value != NULL)
{
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));
/* 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
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
}
}
/* 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;
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. */
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;
}
{
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. */
{
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. */