along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-
-/* Standard C includes. */
-#include <ctype.h>
-
-/* Local non-gdb includes. */
-#include "ada-lang.h"
-#include "annotate.h"
#include "arch-utils.h"
-#include "ax-gdb.h"
-#include "block.h"
+#include <ctype.h>
+#include "hashtab.h"
+#include "symtab.h"
+#include "frame.h"
#include "breakpoint.h"
-#include "cli/cli-script.h"
-#include "cli/cli-style.h"
-#include "cli/cli-utils.h"
-#include "command.h"
-#include "common/format.h"
-#include "completer.h"
-#include "continuations.h"
-#include "dummy-frame.h"
+#include "tracepoint.h"
+#include "gdbtypes.h"
#include "expression.h"
-#include "filenames.h"
-#include "frame.h"
-#include "gdb-demangle.h"
-#include "gdb_regex.h"
-#include "gdbcmd.h"
#include "gdbcore.h"
-#include "gdbthread.h"
-#include "gdbtypes.h"
-#include "hashtab.h"
+#include "gdbcmd.h"
+#include "value.h"
+#include "command.h"
#include "inferior.h"
#include "infrun.h"
-#include "interps.h"
-#include "jit.h"
+#include "gdbthread.h"
+#include "target.h"
#include "language.h"
-#include "linespec.h"
-#include "memattr.h"
-#include "mi/mi-main.h"
+#include "gdb-demangle.h"
+#include "filenames.h"
+#include "annotate.h"
+#include "symfile.h"
#include "objfiles.h"
+#include "source.h"
+#include "linespec.h"
+#include "completer.h"
+#include "ui-out.h"
+#include "cli/cli-script.h"
+#include "block.h"
+#include "solib.h"
+#include "solist.h"
#include "observable.h"
+#include "memattr.h"
+#include "ada-lang.h"
+#include "top.h"
+#include "valprint.h"
+#include "jit.h"
#include "parser-defs.h"
+#include "gdb_regex.h"
#include "probe.h"
-#include "skip.h"
-#include "solib.h"
-#include "solist.h"
-#include "source.h"
+#include "cli/cli-utils.h"
+#include "continuations.h"
#include "stack.h"
-#include "symfile.h"
-#include "symtab.h"
-#include "target.h"
+#include "skip.h"
+#include "ax-gdb.h"
+#include "dummy-frame.h"
+#include "interps.h"
+#include "common/format.h"
#include "thread-fsm.h"
#include "tid-parse.h"
-#include "top.h"
-#include "tracepoint.h"
-#include "ui-out.h"
-#include "valprint.h"
-#include "value.h"
+#include "cli/cli-style.h"
+#include "mi/mi-main.h"
/* readline include files */
#include "readline/readline.h"
/* 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_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_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 &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 &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 &e)
{
bp_excpt = e;
}
- END_CATCH
}
else
{
bp_excpt.message ? ":" : ".\n");
if (bp_excpt.message != NULL)
fprintf_unfiltered (tmp_error_stream, "%s.\n",
- bp_excpt.message);
+ bp_excpt.what ());
}
else
{
fprintf_unfiltered (tmp_error_stream,
"Cannot insert breakpoint %d: %s\n",
bl->owner->number,
- bp_excpt.message);
+ bp_excpt.what ());
}
}
return 1;
{
wp_check_result e;
- TRY
+ try
{
e = watchpoint_check (bs);
}
- CATCH (ex, RETURN_MASK_ALL)
+ catch (const gdb_exception &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 &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_error &e)
{
/* If caller is interested in rc value from parse, set
value. */
error. */
if (pending_break_support == AUTO_BOOLEAN_FALSE)
- throw_exception (e);
+ throw;
exception_print (gdb_stderr, e);
pending = 1;
}
else
- throw_exception (e);
+ throw;
}
- 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_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_error &e)
{
warning (_("failed to reevaluate condition "
"for breakpoint %d: %s"),
- b->number, e.message);
+ 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_error &e)
{
int not_found_and_ok = 0;
happens only when a binary has changed, I don't know
which approach is better. */
b->enable_state = bp_disabled;
- throw_exception (e);
+ throw;
}
}
- 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 &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 &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 &ex)
{
current_uiout->redirect (NULL);
- throw_exception (ex);
+ throw;
}
- END_CATCH
current_uiout->redirect (NULL);
fp.puts (" end\n");