106 for (i = 0; i < strlen (
argv[0]); i++)
138 if (isprint (
argv[0][i]))
139 result +=
argv[0][i];
145 (
unsigned char)
argv[0][i]);
154 for (i = 1; i < argc; i++)
170 const char *address = NULL;
175 char *condition = NULL;
188 HARDWARE_OPT, TEMP_OPT, CONDITION_OPT,
189 IGNORE_COUNT_OPT, THREAD_OPT, PENDING_OPT, DISABLE_OPT,
191 EXPLICIT_SOURCE_OPT, EXPLICIT_FUNC_OPT,
192 EXPLICIT_LABEL_OPT, EXPLICIT_LINE_OPT
194 static const struct mi_opt opts[] =
196 {
"h", HARDWARE_OPT, 0},
198 {
"c", CONDITION_OPT, 1},
199 {
"i", IGNORE_COUNT_OPT, 1},
200 {
"p", THREAD_OPT, 1},
201 {
"f", PENDING_OPT, 0},
202 {
"d", DISABLE_OPT, 0},
203 {
"a", TRACEPOINT_OPT, 0},
204 {
"-source" , EXPLICIT_SOURCE_OPT, 1},
205 {
"-function", EXPLICIT_FUNC_OPT, 1},
206 {
"-label", EXPLICIT_LABEL_OPT, 1},
207 {
"-line", EXPLICIT_LINE_OPT, 1},
224 switch ((
enum opt) opt)
235 case IGNORE_COUNT_OPT:
236 ignore_count = atol (oarg);
239 thread = atol (oarg);
250 case EXPLICIT_SOURCE_OPT:
254 case EXPLICIT_FUNC_OPT:
258 case EXPLICIT_LABEL_OPT:
262 case EXPLICIT_LINE_OPT:
269 if (oind >= argc && !is_explicit)
270 error (
_(
"-%s-insert: Missing <location>"),
271 dprintf ?
"dprintf" :
"break");
274 int format_num = is_explicit ? oind : oind + 1;
277 error (
_(
"-dprintf-insert: does not support -h or -a"));
278 if (format_num >= argc)
279 error (
_(
"-dprintf-insert: Missing <format>"));
282 address =
argv[oind];
289 error (
_(
"-break-insert: Garbage following explicit location"));
294 error (
_(
"-break-insert: Garbage following <location>"));
295 address =
argv[oind];
333 error (
_(
"-%s-insert: --source option requires --function, --label," 334 " or --line"), dprintf ?
"dprintf" :
"break");
343 error (
_(
"Garbage '%s' at end of location"), address);
347 extra_string.c_str (),
352 ops, 0, enabled, 0, 0);
388 error (
_(
"Usage: tracepoint-number passcount"));
401 error (
_(
"Could not find tracepoint %d"), n);
420 static const struct mi_opt opts[] =
423 {
"a", ACCESS_OPT, 0},
438 switch ((
enum opt) opt)
449 error (
_(
"-break-watch: Missing <expression>"));
451 error (
_(
"-break-watch: Garbage following <expression>"));
467 error (
_(
"-break-watch: Unknown watchpoint type."));
498 error (
_(
"USAGE: %s <BKPT> [<COMMAND> [<COMMAND>...]]"), command);
500 bnum = strtol (
argv[0], &endptr, 0);
501 if (endptr ==
argv[0])
502 error (
_(
"breakpoint number argument \"%s\" is not a number."),
504 else if (*endptr !=
'\0')
505 error (
_(
"junk at the end of breakpoint number argument \"%s\"."),
510 error (
_(
"breakpoint %d not found."), bnum);
void check_tracepoint_command(char *line, void *closure)
command_line_up read_command_lines_1(char *(*read_next_line_func)(void), int parse_commands, void(*validator)(char *, void *), void *closure)
static void breakpoint_notify(struct breakpoint *b)
void mi_cmd_break_insert(const char *command, char **argv, int argc)
static char * mi_read_next_line(void)
void awatch_command_wrapper(const char *arg, int from_tty, int internal)
struct breakpoint_ops dprintf_breakpoint_ops
struct line_offset line_offset
struct tracepoint * get_tracepoint(int num)
struct breakpoint_ops tracepoint_breakpoint_ops
event_location_up string_to_event_location_basic(const char **stringp, const struct language_defn *language, symbol_name_match_type match_type)
void initialize_explicit_location(struct explicit_location *explicit_loc)
enum offset_relative_sign sign
scoped_restore_tmpl< T > make_scoped_restore(T *var)
void mi_cmd_break_commands(const char *command, char **argv, int argc)
int mi_getopt(const char *prefix, int argc, char **argv, const struct mi_opt *opts, int *oind, char **oarg)
#define CATCH(EXCEPTION, MASK)
static int mi_command_line_array_cnt
scoped_restore_tmpl< int > setup_breakpoint_reporting(void)
void mi_cmd_break_watch(const char *command, char **argv, int argc)
void exception_print(struct ui_file *file, struct gdb_exception e)
struct observer * observer_attach_breakpoint_created(observer_breakpoint_created_ftype *f)
struct gdbarch * get_current_arch(void)
struct breakpoint * get_breakpoint(int num)
void mi_cmd_break_passcount(const char *command, char **argv, int argc)
event_location_up new_explicit_location(const struct explicit_location *explicit_loc)
std::unique_ptr< event_location, event_location_deleter > event_location_up
void print_breakpoint(breakpoint *b)
struct breakpoint_ops bkpt_breakpoint_ops
void breakpoint_set_commands(struct breakpoint *b, command_line_up &&commands)
void watch_command_wrapper(const char *arg, int from_tty, int internal)
static char ** mi_command_line_array
static int mi_command_line_array_ptr
const struct language_defn * current_language
struct line_offset linespec_parse_line_offset(const char *string)
event_location_up location
int xsnprintf(char *str, size_t size, const char *format,...)
int create_breakpoint(struct gdbarch *gdbarch, const struct event_location *location, const char *cond_string, int thread, const char *extra_string, int parse_extra, int tempflag, enum bptype type_wanted, int ignore_count, enum auto_boolean pending_break_support, const struct breakpoint_ops *ops, int from_tty, int enabled, int internal, unsigned flags)
static void mi_cmd_break_insert_1(int dprintf, const char *command, char **argv, int argc)
void break_command(const char *arg, int from_tty)
std::unique_ptr< command_line, command_lines_deleter > command_line_up
static int mi_can_breakpoint_notify
static int mi_breakpoint_observers_installed
static std::string mi_argv_to_format(char **argv, int argc)
void rwatch_command_wrapper(const char *arg, int from_tty, int internal)
int is_tracepoint(const struct breakpoint *b)
void mi_cmd_dprintf_insert(const char *command, char **argv, int argc)
void error(const char *fmt,...)
void observer_notify_breakpoint_modified(struct breakpoint *b)