36 char *condition = NULL;
45 OPT_CONDITION, OPT_DISABLED, OPT_TEMP,
47 static const struct mi_opt opts[] =
49 {
"c", OPT_CONDITION, 1},
50 {
"d", OPT_DISABLED, 0 },
57 int opt =
mi_getopt (
"-catch-assert", argc, argv, opts,
63 switch ((
enum opt) opt)
80 error (
_(
"Invalid argument: %s"), argv[oind]);
85 if (condition != NULL)
86 condition = xstrdup (condition);
88 NULL, condition, temp, enabled, 0);
97 char *condition = NULL;
99 char *exception_name = NULL;
108 OPT_CONDITION, OPT_DISABLED, OPT_EXCEPTION_NAME, OPT_TEMP,
111 static const struct mi_opt opts[] =
113 {
"c", OPT_CONDITION, 1},
114 {
"d", OPT_DISABLED, 0 },
115 {
"e", OPT_EXCEPTION_NAME, 1 },
116 {
"t", OPT_TEMP, 0 },
117 {
"u", OPT_UNHANDLED, 0},
123 int opt =
mi_getopt (
"-catch-exception", argc, argv, opts,
129 switch ((
enum opt) opt)
137 case OPT_EXCEPTION_NAME:
138 exception_name = oarg;
152 error (
_(
"Invalid argument: %s"), argv[oind]);
157 error (
_(
"\"-e\" and \"-u\" are mutually exclusive"));
162 if (exception_name != NULL)
163 exception_name = xstrdup (exception_name);
164 if (condition != NULL)
165 condition = xstrdup (condition);
167 exception_name, condition,
177 const char *actual_cmd = load ?
"-catch-load" :
"-catch-unload";
187 static const struct mi_opt opts[] =
189 {
"t", OPT_TEMP, 0 },
190 {
"d", OPT_DISABLED, 0 },
196 int opt =
mi_getopt (actual_cmd, argc, argv, opts,
202 switch ((
enum opt) opt)
214 error (
_(
"-catch-load/unload: Missing <library name>"));
216 error (
_(
"-catch-load/unload: Garbage following the <library name>"));
void mi_cmd_catch_exception(char *cmd, char *argv[], int argc)
struct cleanup * setup_breakpoint_reporting(void)
void mi_cmd_catch_assert(char *cmd, char *argv[], int argc)
int mi_getopt(const char *prefix, int argc, char **argv, const struct mi_opt *opts, int *oind, char **oarg)
void create_ada_exception_catchpoint(struct gdbarch *gdbarch, enum ada_exception_catchpoint_kind ex_kind, char *excep_string, char *cond_string, int tempflag, int disabled, int from_tty)
void add_solib_catchpoint(char *arg, int is_load, int is_temp, int enabled)
struct gdbarch * get_current_arch(void)
static void mi_catch_load_unload(int load, char *argv[], int argc)
ada_exception_catchpoint_kind
void mi_cmd_catch_load(char *cmd, char *argv[], int argc)
void error(const char *fmt,...)
void do_cleanups(struct cleanup *old_chain)
void mi_cmd_catch_unload(char *cmd, char *argv[], int argc)