/* Everything about catch/throw catchpoints, for GDB.
- Copyright (C) 1986-2016 Free Software Foundation, Inc.
+ Copyright (C) 1986-2017 Free Software Foundation, Inc.
This file is part of GDB.
maybe_print_thread_hit_breakpoint (uiout);
bp_temp = b->disposition == disp_del;
- ui_out_text (uiout,
- bp_temp ? "Temporary catchpoint "
+ uiout->text (bp_temp ? "Temporary catchpoint "
: "Catchpoint ");
- if (!ui_out_is_mi_like_p (uiout))
- ui_out_field_int (uiout, "bkptno", b->number);
- ui_out_text (uiout,
- (kind == EX_EVENT_THROW ? " (exception thrown), "
+ if (!uiout->is_mi_like_p ())
+ uiout->field_int ("bkptno", b->number);
+ uiout->text ((kind == EX_EVENT_THROW ? " (exception thrown), "
: (kind == EX_EVENT_CATCH ? " (exception caught), "
: " (exception rethrown), ")));
- if (ui_out_is_mi_like_p (uiout))
+ if (uiout->is_mi_like_p ())
{
- ui_out_field_string (uiout, "reason",
+ uiout->field_string ("reason",
async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT));
- ui_out_field_string (uiout, "disp", bpdisp_text (b->disposition));
- ui_out_field_int (uiout, "bkptno", b->number);
+ uiout->field_string ("disp", bpdisp_text (b->disposition));
+ uiout->field_int ("bkptno", b->number);
}
return PRINT_SRC_AND_LOC;
}
{
annotate_field (4);
if (b->loc == NULL || b->loc->shlib_disabled)
- ui_out_field_string (uiout, "addr", "<PENDING>");
+ uiout->field_string ("addr", "<PENDING>");
else
- ui_out_field_core_addr (uiout, "addr",
+ uiout->field_core_addr ("addr",
b->loc->gdbarch, b->loc->address);
}
annotate_field (5);
switch (kind)
{
case EX_EVENT_THROW:
- ui_out_field_string (uiout, "what", "exception throw");
- if (ui_out_is_mi_like_p (uiout))
- ui_out_field_string (uiout, "catch-type", "throw");
+ uiout->field_string ("what", "exception throw");
+ if (uiout->is_mi_like_p ())
+ uiout->field_string ("catch-type", "throw");
break;
case EX_EVENT_RETHROW:
- ui_out_field_string (uiout, "what", "exception rethrow");
- if (ui_out_is_mi_like_p (uiout))
- ui_out_field_string (uiout, "catch-type", "rethrow");
+ uiout->field_string ("what", "exception rethrow");
+ if (uiout->is_mi_like_p ())
+ uiout->field_string ("catch-type", "rethrow");
break;
case EX_EVENT_CATCH:
- ui_out_field_string (uiout, "what", "exception catch");
- if (ui_out_is_mi_like_p (uiout))
- ui_out_field_string (uiout, "catch-type", "catch");
+ uiout->field_string ("what", "exception catch");
+ if (uiout->is_mi_like_p ())
+ uiout->field_string ("catch-type", "catch");
break;
}
}
if (cp->exception_rx != NULL)
{
- ui_out_text (uiout, _("\tmatching: "));
- ui_out_field_string (uiout, "regexp", cp->exception_rx);
- ui_out_text (uiout, "\n");
+ uiout->text (_("\tmatching: "));
+ uiout->field_string ("regexp", cp->exception_rx);
+ uiout->text ("\n");
}
}
enum exception_event_kind kind = classify_exception_breakpoint (b);
bp_temp = b->disposition == disp_del;
- ui_out_text (uiout, bp_temp ? _("Temporary catchpoint ")
+ uiout->text (bp_temp ? _("Temporary catchpoint ")
: _("Catchpoint "));
- ui_out_field_int (uiout, "bkptno", b->number);
- ui_out_text (uiout, (kind == EX_EVENT_THROW ? _(" (throw)")
+ uiout->field_int ("bkptno", b->number);
+ uiout->text ((kind == EX_EVENT_THROW ? _(" (throw)")
: (kind == EX_EVENT_CATCH ? _(" (catch)")
: _(" (rethrow)"))));
}
}
static void
-handle_gnu_v3_exceptions (int tempflag, char *except_rx, char *cond_string,
+handle_gnu_v3_exceptions (int tempflag, char *except_rx,
+ const char *cond_string,
enum exception_event_kind ex_event, int from_tty)
{
regex_t *pattern = NULL;
_("invalid type-matching regexp"));
}
- gdb::unique_ptr<exception_catchpoint> cp (new exception_catchpoint ());
+ std::unique_ptr<exception_catchpoint> cp (new exception_catchpoint ());
init_catchpoint (&cp->base, get_current_arch (), tempflag, cond_string,
&gnu_v3_exception_catchpoint_ops);
the end of the string. */
static char *
-extract_exception_regexp (char **string)
+extract_exception_regexp (const char **string)
{
- char *start;
- char *last, *last_space;
+ const char *start;
+ const char *last, *last_space;
- start = skip_spaces (*string);
+ start = skip_spaces_const (*string);
last = start;
last_space = start;
while (*last != '\0')
{
- char *if_token = last;
+ const char *if_token = last;
/* Check for the "if". */
if (check_for_argument (&if_token, "if", 2))
/* No "if" token here. Skip to the next word start. */
last_space = skip_to_space (last);
- last = skip_spaces (last_space);
+ last = skip_spaces_const (last_space);
}
*string = last;
commands. */
static void
-catch_exception_command_1 (enum exception_event_kind ex_event, char *arg,
+catch_exception_command_1 (enum exception_event_kind ex_event,
+ char *arg_entry,
int tempflag, int from_tty)
{
char *except_rx;
- char *cond_string = NULL;
+ const char *cond_string = NULL;
struct cleanup *cleanup;
+ const char *arg = arg_entry;
if (!arg)
arg = "";
- arg = skip_spaces (arg);
+ arg = skip_spaces_const (arg);
except_rx = extract_exception_regexp (&arg);
cleanup = make_cleanup (xfree, except_rx);