114 inf_data->total_syscalls_count != 0,
115 inf_data->any_syscall_count,
116 inf_data->syscalls_counts);
145 inf_data->total_syscalls_count != 0,
146 inf_data->any_syscall_count,
147 inf_data->syscalls_counts);
161 int syscall_number = 0;
175 if (syscall_number == iter)
209 uiout->
text (
"Temporary catchpoint ");
211 uiout->
text (
"Catchpoint ");
223 uiout->
text (
" (call to syscall ");
225 uiout->
text (
" (returned from syscall ");
258 uiout->
text (
"syscalls \"");
260 uiout->
text (
"syscall \"");
283 text[strlen (text) - 2] =
'\0';
372 c->syscalls_to_be_caught = std::move (filter);
379 static std::vector<int>
382 std::vector<int> result;
387 int i, syscall_number;
395 for (i = 0; i < 127 && arg[i] && !isspace (arg[i]); ++i)
396 cur_name[i] = arg[i];
401 syscall_number = (int) strtol (cur_name, &endptr, 0);
405 result.push_back (s.
number);
413 const char *group_name;
416 group_name = strchr (cur_name,
':') + 1;
420 if (syscall_list == NULL)
421 error (
_(
"Unknown syscall group '%s'."), group_name);
423 for (i = 0; syscall_list[i].
name != NULL; i++)
427 result.push_back (syscall_list[i].
number);
430 xfree (syscall_list);
442 error (
_(
"Unknown syscall name '%s'."), cur_name);
445 result.push_back (s.
number);
459 std::vector<int> filter;
465 error (
_(
"The feature 'catch syscall' is not supported on \ 466 this architecture yet."));
522 int syscall_number = (int) (uintptr_t) data;
531 if (syscall_number == iter)
545 (
void *) (uintptr_t) syscall_number);
555 const char *text,
const char *word)
564 for (prefix = word; prefix != text && prefix[-1] !=
' '; prefix--)
571 if (group_list != NULL)
581 const char **group_ptr = group_list.get ();
584 std::vector<std::string> holders;
587 for (
int i = 0; group_ptr[i] != NULL; i++)
588 holders.push_back (
string_printf (
"group:%s", group_ptr[i]));
590 for (
int i = 0; group_ptr[i] != NULL; i++)
591 group_ptr[i] = holders[i].c_str ();
593 if (syscall_list != NULL)
595 if (group_list != NULL)
637 = register_inferior_data_with_cleanup (NULL,
641 Catch system calls by their names, groups and/or numbers.\n\ 642 Arguments say which system calls to catch. If no arguments are given,\n\ 643 every system call will be caught. Arguments, if given, should be one\n\ 644 or more system call names (if your system supports that), system call\n\ 645 groups or system call numbers."),
void get_last_target_status(ptid_t *ptidp, struct target_waitstatus *status)
struct gdbarch * target_gdbarch(void)
void(* print_recreate)(struct breakpoint *, struct ui_file *fp)
static void create_syscall_event_catchpoint(int tempflag, std::vector< int > &&filter, const struct breakpoint_ops *ops)
int catch_syscall_enabled(void)
static struct breakpoint_ops catch_syscall_breakpoint_ops
static int remove_catch_syscall(struct bp_location *bl, enum remove_bp_reason reason)
void * get_cmd_context(struct cmd_list_element *cmd)
void field_string(const char *fldname, const char *string)
int gdbarch_get_syscall_number_p(struct gdbarch *gdbarch)
int ptid_get_pid(const ptid_t &ptid)
static void print_recreate_catch_syscall(struct breakpoint *b, struct ui_file *fp)
enum print_stop_action(* print_it)(struct bpstats *bs)
void install_breakpoint(int internal, std::unique_ptr< breakpoint > &&arg, int update_gll)
void field_skip(const char *fldname)
void annotate_field(int num)
static int is_syscall_catchpoint_enabled(struct breakpoint *bp)
void complete_on_enum(completion_tracker &tracker, const char *const *enumlist, const char *text, const char *word)
void(* print_mention)(struct breakpoint *)
union target_waitstatus::@174 value
static void catch_syscall_command_1(const char *arg, int from_tty, struct cmd_list_element *command)
struct observer * observer_attach_inferior_exit(observer_inferior_exit_ftype *f)
const breakpoint_ops * ops
std::vector< int > syscalls_to_be_caught
void get_syscall_by_name(struct gdbarch *gdbarch, const char *syscall_name, struct syscall *s)
char * skip_spaces(char *chp)
void text(const char *string)
void printf_filtered(const char *format,...)
static void print_one_catch_syscall(struct breakpoint *b, struct bp_location **last_loc)
void get_syscall_by_number(struct gdbarch *gdbarch, int syscall_number, struct syscall *s)
static void initialize_syscall_catchpoint_ops(void)
int(* insert_location)(struct bp_location *)
static int insert_catch_syscall(struct bp_location *bl)
std::unique_ptr< T, xfree_deleter< T > > unique_xmalloc_ptr
struct bp_location * bp_location_at
#define target_set_syscall_catchpoint(pid, needed, any_count, syscall_counts)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
int(* breakpoint_hit)(const struct bp_location *bl, const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws)
int catching_syscall_number(int syscall_number)
struct breakpoint * breakpoint_find_if(int(*func)(struct breakpoint *b, void *d), void *user_data)
struct gdbarch * get_current_arch(void)
static void catch_syscall_completer(struct cmd_list_element *cmd, completion_tracker &tracker, const char *text, const char *word)
static int startswith(const char *string, const char *pattern)
static int syscall_catchpoint_p(struct breakpoint *b)
static struct catch_syscall_inferior_data * get_catch_syscall_inferior_data(struct inferior *inf)
char * xstrprintf(const char *format,...)
static void print_mention_catch_syscall(struct breakpoint *b)
std::vector< int > syscalls_counts
void print_recreate_thread(struct breakpoint *b, struct ui_file *fp)
struct breakpoint * breakpoint_at
const char ** get_syscall_names(struct gdbarch *gdbarch)
static int catching_syscall_number_1(struct breakpoint *b, void *data)
static void clear_syscall_counts(struct inferior *inf)
const char * async_reason_lookup(enum async_reply_reason reason)
int(* remove_location)(struct bp_location *, enum remove_bp_reason reason)
enum target_waitkind kind
void add_catch_command(const char *name, const char *docstring, cmd_const_sfunc_ftype *sfunc, completer_ftype *completer, void *user_data_catch, void *user_data_tcatch)
void field_int(const char *fldname, int value)
void get_user_print_options(struct value_print_options *opts)
static void catch_syscall_inferior_data_cleanup(struct inferior *inf, void *arg)
struct breakpoint_ops base_breakpoint_ops
std::string string_printf(const char *fmt,...)
struct inferior * current_inferior(void)
void initialize_breakpoint_ops(void)
const char ** get_syscall_group_names(struct gdbarch *gdbarch)
static int breakpoint_hit_catch_syscall(const struct bp_location *bl, const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws)
static enum print_stop_action print_it_catch_syscall(bpstat bs)
struct syscall * get_syscalls_by_group(struct gdbarch *gdbarch, const char *group)
void annotate_catchpoint(int num)
static std::vector< int > catch_syscall_split_args(const char *arg)
void(* print_one)(struct breakpoint *, struct bp_location **)
void maybe_print_thread_hit_breakpoint(struct ui_out *uiout)
void error(const char *fmt,...)
const char * bpdisp_text(enum bpdisp disp)
void _initialize_break_catch_syscall(void)
void init_catchpoint(struct breakpoint *b, struct gdbarch *gdbarch, int tempflag, const char *cond_string, const struct breakpoint_ops *ops)