GDB (xrefs)
/tmp/gdb-7.10/gdb/break-catch-syscall.c
Go to the documentation of this file.
1 /* Everything about syscall catchpoints, for GDB.
2 
3  Copyright (C) 2009-2015 Free Software Foundation, Inc.
4 
5  This file is part of GDB.
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 #include "defs.h"
21 #include <ctype.h>
22 #include "breakpoint.h"
23 #include "gdbcmd.h"
24 #include "inferior.h"
25 #include "cli/cli-utils.h"
26 #include "annotate.h"
27 #include "mi/mi-common.h"
28 #include "valprint.h"
29 #include "arch-utils.h"
30 #include "observer.h"
31 #include "xml-syscall.h"
32 
33 /* An instance of this type is used to represent a syscall catchpoint.
34  It includes a "struct breakpoint" as a kind of base class; users
35  downcast to "struct breakpoint *" when needed. A breakpoint is
36  really of this type iff its ops pointer points to
37  CATCH_SYSCALL_BREAKPOINT_OPS. */
38 
40 {
41  /* The base class. */
42  struct breakpoint base;
43 
44  /* Syscall numbers used for the 'catch syscall' feature. If no
45  syscall has been specified for filtering, its value is NULL.
46  Otherwise, it holds a list of all syscalls to be caught. The
47  list elements are allocated with xmalloc. */
48  VEC(int) *syscalls_to_be_caught;
49 };
50 
51 /* Implement the "dtor" breakpoint_ops method for syscall
52  catchpoints. */
53 
54 static void
56 {
57  struct syscall_catchpoint *c = (struct syscall_catchpoint *) b;
58 
59  VEC_free (int, c->syscalls_to_be_caught);
60 
62 }
63 
64 static const struct inferior_data *catch_syscall_inferior_data = NULL;
65 
66 struct catch_syscall_inferior_data
67 {
68  /* We keep a count of the number of times the user has requested a
69  particular syscall to be tracked, and pass this information to the
70  target. This lets capable targets implement filtering directly. */
71 
72  /* Number of times that "any" syscall is requested. */
74 
75  /* Count of each system call. */
76  VEC(int) *syscalls_counts;
77 
78  /* This counts all syscall catch requests, so we can readily determine
79  if any catching is necessary. */
80  int total_syscalls_count;
81 };
82 
83 static struct catch_syscall_inferior_data*
85 {
86  struct catch_syscall_inferior_data *inf_data;
87 
88  inf_data = inferior_data (inf, catch_syscall_inferior_data);
89  if (inf_data == NULL)
90  {
91  inf_data = XCNEW (struct catch_syscall_inferior_data);
92  set_inferior_data (inf, catch_syscall_inferior_data, inf_data);
93  }
94 
95  return inf_data;
96 }
97 
98 static void
100 {
101  xfree (arg);
102 }
103 
104 
105 /* Implement the "insert" breakpoint_ops method for syscall
106  catchpoints. */
107 
108 static int
110 {
111  struct syscall_catchpoint *c = (struct syscall_catchpoint *) bl->owner;
112  struct inferior *inf = current_inferior ();
113  struct catch_syscall_inferior_data *inf_data
115 
116  ++inf_data->total_syscalls_count;
117  if (!c->syscalls_to_be_caught)
118  ++inf_data->any_syscall_count;
119  else
120  {
121  int i, iter;
122 
123  for (i = 0;
124  VEC_iterate (int, c->syscalls_to_be_caught, i, iter);
125  i++)
126  {
127  int elem;
128 
129  if (iter >= VEC_length (int, inf_data->syscalls_counts))
130  {
131  int old_size = VEC_length (int, inf_data->syscalls_counts);
132  uintptr_t vec_addr_offset
133  = old_size * ((uintptr_t) sizeof (int));
134  uintptr_t vec_addr;
135  VEC_safe_grow (int, inf_data->syscalls_counts, iter + 1);
136  vec_addr = ((uintptr_t) VEC_address (int,
137  inf_data->syscalls_counts)
138  + vec_addr_offset);
139  memset ((void *) vec_addr, 0,
140  (iter + 1 - old_size) * sizeof (int));
141  }
142  elem = VEC_index (int, inf_data->syscalls_counts, iter);
143  VEC_replace (int, inf_data->syscalls_counts, iter, ++elem);
144  }
145  }
146 
148  inf_data->total_syscalls_count != 0,
149  inf_data->any_syscall_count,
150  VEC_length (int,
151  inf_data->syscalls_counts),
152  VEC_address (int,
153  inf_data->syscalls_counts));
154 }
155 
156 /* Implement the "remove" breakpoint_ops method for syscall
157  catchpoints. */
158 
159 static int
161 {
162  struct syscall_catchpoint *c = (struct syscall_catchpoint *) bl->owner;
163  struct inferior *inf = current_inferior ();
164  struct catch_syscall_inferior_data *inf_data
166 
167  --inf_data->total_syscalls_count;
168  if (!c->syscalls_to_be_caught)
169  --inf_data->any_syscall_count;
170  else
171  {
172  int i, iter;
173 
174  for (i = 0;
175  VEC_iterate (int, c->syscalls_to_be_caught, i, iter);
176  i++)
177  {
178  int elem;
179  if (iter >= VEC_length (int, inf_data->syscalls_counts))
180  /* Shouldn't happen. */
181  continue;
182  elem = VEC_index (int, inf_data->syscalls_counts, iter);
183  VEC_replace (int, inf_data->syscalls_counts, iter, --elem);
184  }
185  }
186 
188  inf_data->total_syscalls_count != 0,
189  inf_data->any_syscall_count,
190  VEC_length (int,
191  inf_data->syscalls_counts),
192  VEC_address (int,
193  inf_data->syscalls_counts));
194 }
195 
196 /* Implement the "breakpoint_hit" breakpoint_ops method for syscall
197  catchpoints. */
198 
199 static int
201  struct address_space *aspace, CORE_ADDR bp_addr,
202  const struct target_waitstatus *ws)
203 {
204  /* We must check if we are catching specific syscalls in this
205  breakpoint. If we are, then we must guarantee that the called
206  syscall is the same syscall we are catching. */
207  int syscall_number = 0;
208  const struct syscall_catchpoint *c
209  = (const struct syscall_catchpoint *) bl->owner;
210 
213  return 0;
214 
215  syscall_number = ws->value.syscall_number;
216 
217  /* Now, checking if the syscall is the same. */
218  if (c->syscalls_to_be_caught)
219  {
220  int i, iter;
221 
222  for (i = 0;
223  VEC_iterate (int, c->syscalls_to_be_caught, i, iter);
224  i++)
225  if (syscall_number == iter)
226  return 1;
227 
228  return 0;
229  }
230 
231  return 1;
232 }
233 
234 /* Implement the "print_it" breakpoint_ops method for syscall
235  catchpoints. */
236 
237 static enum print_stop_action
239 {
240  struct ui_out *uiout = current_uiout;
241  struct breakpoint *b = bs->breakpoint_at;
242  /* These are needed because we want to know in which state a
243  syscall is. It can be in the TARGET_WAITKIND_SYSCALL_ENTRY
244  or TARGET_WAITKIND_SYSCALL_RETURN, and depending on it we
245  must print "called syscall" or "returned from syscall". */
246  ptid_t ptid;
247  struct target_waitstatus last;
248  struct syscall s;
249  struct gdbarch *gdbarch = bs->bp_location_at->gdbarch;
250 
251  get_last_target_status (&ptid, &last);
252 
253  get_syscall_by_number (gdbarch, last.value.syscall_number, &s);
254 
256 
257  if (b->disposition == disp_del)
258  ui_out_text (uiout, "\nTemporary catchpoint ");
259  else
260  ui_out_text (uiout, "\nCatchpoint ");
261  if (ui_out_is_mi_like_p (uiout))
262  {
263  ui_out_field_string (uiout, "reason",
267  ui_out_field_string (uiout, "disp", bpdisp_text (b->disposition));
268  }
269  ui_out_field_int (uiout, "bkptno", b->number);
270 
272  ui_out_text (uiout, " (call to syscall ");
273  else
274  ui_out_text (uiout, " (returned from syscall ");
275 
276  if (s.name == NULL || ui_out_is_mi_like_p (uiout))
277  ui_out_field_int (uiout, "syscall-number", last.value.syscall_number);
278  if (s.name != NULL)
279  ui_out_field_string (uiout, "syscall-name", s.name);
280 
281  ui_out_text (uiout, "), ");
282 
283  return PRINT_SRC_AND_LOC;
284 }
285 
286 /* Implement the "print_one" breakpoint_ops method for syscall
287  catchpoints. */
288 
289 static void
291  struct bp_location **last_loc)
292 {
293  struct syscall_catchpoint *c = (struct syscall_catchpoint *) b;
294  struct value_print_options opts;
295  struct ui_out *uiout = current_uiout;
296  struct gdbarch *gdbarch = b->loc->gdbarch;
297 
298  get_user_print_options (&opts);
299  /* Field 4, the address, is omitted (which makes the columns not
300  line up too nicely with the headers, but the effect is relatively
301  readable). */
302  if (opts.addressprint)
303  ui_out_field_skip (uiout, "addr");
304  annotate_field (5);
305 
306  if (c->syscalls_to_be_caught
307  && VEC_length (int, c->syscalls_to_be_caught) > 1)
308  ui_out_text (uiout, "syscalls \"");
309  else
310  ui_out_text (uiout, "syscall \"");
311 
312  if (c->syscalls_to_be_caught)
313  {
314  int i, iter;
315  char *text = xstrprintf ("%s", "");
316 
317  for (i = 0;
318  VEC_iterate (int, c->syscalls_to_be_caught, i, iter);
319  i++)
320  {
321  char *x = text;
322  struct syscall s;
323  get_syscall_by_number (gdbarch, iter, &s);
324 
325  if (s.name != NULL)
326  text = xstrprintf ("%s%s, ", text, s.name);
327  else
328  text = xstrprintf ("%s%d, ", text, iter);
329 
330  /* We have to xfree the last 'text' (now stored at 'x')
331  because xstrprintf dynamically allocates new space for it
332  on every call. */
333  xfree (x);
334  }
335  /* Remove the last comma. */
336  text[strlen (text) - 2] = '\0';
337  ui_out_field_string (uiout, "what", text);
338  }
339  else
340  ui_out_field_string (uiout, "what", "<any syscall>");
341  ui_out_text (uiout, "\" ");
342 
343  if (ui_out_is_mi_like_p (uiout))
344  ui_out_field_string (uiout, "catch-type", "syscall");
345 }
346 
347 /* Implement the "print_mention" breakpoint_ops method for syscall
348  catchpoints. */
349 
350 static void
352 {
353  struct syscall_catchpoint *c = (struct syscall_catchpoint *) b;
354  struct gdbarch *gdbarch = b->loc->gdbarch;
355 
356  if (c->syscalls_to_be_caught)
357  {
358  int i, iter;
359 
360  if (VEC_length (int, c->syscalls_to_be_caught) > 1)
361  printf_filtered (_("Catchpoint %d (syscalls"), b->number);
362  else
363  printf_filtered (_("Catchpoint %d (syscall"), b->number);
364 
365  for (i = 0;
366  VEC_iterate (int, c->syscalls_to_be_caught, i, iter);
367  i++)
368  {
369  struct syscall s;
370  get_syscall_by_number (gdbarch, iter, &s);
371 
372  if (s.name)
373  printf_filtered (" '%s' [%d]", s.name, s.number);
374  else
375  printf_filtered (" %d", s.number);
376  }
377  printf_filtered (")");
378  }
379  else
380  printf_filtered (_("Catchpoint %d (any syscall)"),
381  b->number);
382 }
383 
384 /* Implement the "print_recreate" breakpoint_ops method for syscall
385  catchpoints. */
386 
387 static void
389 {
390  struct syscall_catchpoint *c = (struct syscall_catchpoint *) b;
391  struct gdbarch *gdbarch = b->loc->gdbarch;
392 
393  fprintf_unfiltered (fp, "catch syscall");
394 
395  if (c->syscalls_to_be_caught)
396  {
397  int i, iter;
398 
399  for (i = 0;
400  VEC_iterate (int, c->syscalls_to_be_caught, i, iter);
401  i++)
402  {
403  struct syscall s;
404 
405  get_syscall_by_number (gdbarch, iter, &s);
406  if (s.name)
407  fprintf_unfiltered (fp, " %s", s.name);
408  else
409  fprintf_unfiltered (fp, " %d", s.number);
410  }
411  }
412  print_recreate_thread (b, fp);
413 }
414 
415 /* The breakpoint_ops structure to be used in syscall catchpoints. */
416 
418 
419 /* Returns non-zero if 'b' is a syscall catchpoint. */
420 
421 static int
423 {
424  return (b->ops == &catch_syscall_breakpoint_ops);
425 }
426 
427 static void
428 create_syscall_event_catchpoint (int tempflag, VEC(int) *filter,
429  const struct breakpoint_ops *ops)
430 {
431  struct syscall_catchpoint *c;
432  struct gdbarch *gdbarch = get_current_arch ();
433 
434  c = XNEW (struct syscall_catchpoint);
435  init_catchpoint (&c->base, gdbarch, tempflag, NULL, ops);
436  c->syscalls_to_be_caught = filter;
437 
438  install_breakpoint (0, &c->base, 1);
439 }
440 
441 /* Splits the argument using space as delimiter. Returns an xmalloc'd
442  filter list, or NULL if no filtering is required. */
443 static VEC(int) *
444 catch_syscall_split_args (char *arg)
445 {
446  VEC(int) *result = NULL;
447  struct cleanup *cleanup = make_cleanup (VEC_cleanup (int), &result);
448  struct gdbarch *gdbarch = target_gdbarch ();
449 
450  while (*arg != '\0')
451  {
452  int i, syscall_number;
453  char *endptr;
454  char cur_name[128];
455  struct syscall s;
456 
457  /* Skip whitespace. */
458  arg = skip_spaces (arg);
459 
460  for (i = 0; i < 127 && arg[i] && !isspace (arg[i]); ++i)
461  cur_name[i] = arg[i];
462  cur_name[i] = '\0';
463  arg += i;
464 
465  /* Check if the user provided a syscall name or a number. */
466  syscall_number = (int) strtol (cur_name, &endptr, 0);
467  if (*endptr == '\0')
468  get_syscall_by_number (gdbarch, syscall_number, &s);
469  else
470  {
471  /* We have a name. Let's check if it's valid and convert it
472  to a number. */
473  get_syscall_by_name (gdbarch, cur_name, &s);
474 
475  if (s.number == UNKNOWN_SYSCALL)
476  /* Here we have to issue an error instead of a warning,
477  because GDB cannot do anything useful if there's no
478  syscall number to be caught. */
479  error (_("Unknown syscall name '%s'."), cur_name);
480  }
481 
482  /* Ok, it's valid. */
483  VEC_safe_push (int, result, s.number);
484  }
485 
486  discard_cleanups (cleanup);
487  return result;
488 }
489 
490 /* Implement the "catch syscall" command. */
491 
492 static void
493 catch_syscall_command_1 (char *arg, int from_tty,
494  struct cmd_list_element *command)
495 {
496  int tempflag;
497  VEC(int) *filter;
498  struct syscall s;
499  struct gdbarch *gdbarch = get_current_arch ();
500 
501  /* Checking if the feature if supported. */
502  if (gdbarch_get_syscall_number_p (gdbarch) == 0)
503  error (_("The feature 'catch syscall' is not supported on \
504 this architecture yet."));
505 
506  tempflag = get_cmd_context (command) == CATCH_TEMPORARY;
507 
508  arg = skip_spaces (arg);
509 
510  /* We need to do this first "dummy" translation in order
511  to get the syscall XML file loaded or, most important,
512  to display a warning to the user if there's no XML file
513  for his/her architecture. */
514  get_syscall_by_number (gdbarch, 0, &s);
515 
516  /* The allowed syntax is:
517  catch syscall
518  catch syscall <name | number> [<name | number> ... <name | number>]
519 
520  Let's check if there's a syscall name. */
521 
522  if (arg != NULL)
523  filter = catch_syscall_split_args (arg);
524  else
525  filter = NULL;
526 
527  create_syscall_event_catchpoint (tempflag, filter,
529 }
530 
531 
532 /* Returns 0 if 'bp' is NOT a syscall catchpoint,
533  non-zero otherwise. */
534 static int
536 {
537  if (syscall_catchpoint_p (bp)
538  && bp->enable_state != bp_disabled
539  && bp->enable_state != bp_call_disabled)
540  return 1;
541  else
542  return 0;
543 }
544 
545 int
547 {
548  struct catch_syscall_inferior_data *inf_data
550 
551  return inf_data->total_syscalls_count != 0;
552 }
553 
554 /* Helper function for catching_syscall_number. If B is a syscall
555  catchpoint for SYSCALL_NUMBER, return 1 (which will make
556  'breakpoint_find_if' return). Otherwise, return 0. */
557 
558 static int
560  void *data)
561 {
562  int syscall_number = (int) (uintptr_t) data;
563 
565  {
566  struct syscall_catchpoint *c = (struct syscall_catchpoint *) b;
567 
568  if (c->syscalls_to_be_caught)
569  {
570  int i, iter;
571  for (i = 0;
572  VEC_iterate (int, c->syscalls_to_be_caught, i, iter);
573  i++)
574  if (syscall_number == iter)
575  return 1;
576  }
577  else
578  return 1;
579  }
580 
581  return 0;
582 }
583 
584 int
585 catching_syscall_number (int syscall_number)
586 {
588  (void *) (uintptr_t) syscall_number);
589 
590  return b != NULL;
591 }
592 
593 /* Complete syscall names. Used by "catch syscall". */
594 static VEC (char_ptr) *
595 catch_syscall_completer (struct cmd_list_element *cmd,
596  const char *text, const char *word)
597 {
598  const char **list = get_syscall_names (get_current_arch ());
599  VEC (char_ptr) *retlist
600  = (list == NULL) ? NULL : complete_on_enum (list, word, word);
601 
602  xfree (list);
603  return retlist;
604 }
605 
606 static void
608 {
609  struct catch_syscall_inferior_data *inf_data
611 
612  inf_data->total_syscalls_count = 0;
613  inf_data->any_syscall_count = 0;
614  VEC_free (int, inf_data->syscalls_counts);
615 }
616 
617 static void
619 {
620  struct breakpoint_ops *ops;
621 
623 
624  /* Syscall catchpoints. */
626  *ops = base_breakpoint_ops;
627  ops->dtor = dtor_catch_syscall;
635 }
636 
638 
639 void
641 {
643 
645  catch_syscall_inferior_data
646  = register_inferior_data_with_cleanup (NULL,
648 
649  add_catch_command ("syscall", _("\
650 Catch system calls by their names and/or numbers.\n\
651 Arguments say which system calls to catch. If no arguments\n\
652 are given, every system call will be caught.\n\
653 Arguments, if given, should be one or more system call names\n\
654 (if your system supports that), or system call numbers."),
656  catch_syscall_completer,
659 }
void get_last_target_status(ptid_t *ptidp, struct target_waitstatus *status)
Definition: infrun.c:3408
struct gdbarch * target_gdbarch(void)
Definition: gdbarch.c:5143
void(* print_recreate)(struct breakpoint *, struct ui_file *fp)
Definition: breakpoint.h:575
int catch_syscall_enabled(void)
static struct breakpoint_ops catch_syscall_breakpoint_ops
void * get_cmd_context(struct cmd_list_element *cmd)
Definition: cli-decode.c:147
#define VEC_replace(T, V, I, O)
Definition: vec.h:302
void ui_out_field_int(struct ui_out *uiout, const char *fldname, int value)
Definition: ui-out.c:467
Definition: target.h:98
bfd_vma CORE_ADDR
Definition: common-types.h:41
int gdbarch_get_syscall_number_p(struct gdbarch *gdbarch)
Definition: gdbarch.c:4008
static VEC(int)
void xfree(void *)
Definition: common-utils.c:97
if(!(yy_init))
Definition: ada-lex.c:1072
#define CATCH_TEMPORARY
Definition: breakpoint.h:1247
static void print_recreate_catch_syscall(struct breakpoint *b, struct ui_file *fp)
enum print_stop_action(* print_it)(struct bpstats *bs)
Definition: breakpoint.h:550
void annotate_field(int num)
Definition: annotate.c:188
static int remove_catch_syscall(struct bp_location *bl)
static int is_syscall_catchpoint_enabled(struct breakpoint *bp)
int ui_out_is_mi_like_p(struct ui_out *uiout)
Definition: ui-out.c:655
void(* print_mention)(struct breakpoint *)
Definition: breakpoint.h:572
static void catch_syscall_command_1(char *arg, int from_tty, struct cmd_list_element *command)
int(* breakpoint_hit)(const struct bp_location *bl, struct address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws)
Definition: breakpoint.h:529
struct observer * observer_attach_inferior_exit(observer_inferior_exit_ftype *f)
#define VEC_safe_push(T, V, O)
Definition: vec.h:260
void get_syscall_by_name(struct gdbarch *gdbarch, const char *syscall_name, struct syscall *s)
Definition: xml-syscall.c:408
char * skip_spaces(char *chp)
Definition: common-utils.c:259
#define _(String)
Definition: gdb_locale.h:40
#define VEC_safe_grow(T, V, I)
Definition: vec.h:288
char * char_ptr
Definition: gdb_vecs.h:25
void add_catch_command(char *name, char *docstring, cmd_sfunc_ftype *sfunc, completer_ftype *completer, void *user_data_catch, void *user_data_tcatch)
Definition: breakpoint.c:15474
Definition: ui-out.c:99
void ui_out_text(struct ui_out *uiout, const char *string)
Definition: ui-out.c:582
void printf_filtered(const char *format,...)
Definition: utils.c:2388
Definition: ptid.h:35
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)
Definition: xml-syscall.c:398
static void initialize_syscall_catchpoint_ops(void)
enum bpdisp disposition
Definition: breakpoint.h:673
int(* insert_location)(struct bp_location *)
Definition: breakpoint.h:515
static void dtor_catch_syscall(struct breakpoint *b)
int number
Definition: target.h:101
static int insert_catch_syscall(struct bp_location *bl)
#define VEC_iterate(T, V, I, P)
Definition: vec.h:165
static void create_syscall_event_catchpoint(int tempflag, VEC(int)*filter, const struct breakpoint_ops *ops)
static int breakpoint_hit_catch_syscall(const struct bp_location *bl, struct address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws)
void ui_out_field_skip(struct ui_out *uiout, const char *fldname)
Definition: ui-out.c:528
void initialize_file_ftype(void)
Definition: defs.h:281
struct bp_location * bp_location_at
Definition: breakpoint.h:1089
void init_catchpoint(struct breakpoint *b, struct gdbarch *gdbarch, int tempflag, char *cond_string, const struct breakpoint_ops *ops)
Definition: breakpoint.c:8439
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
Definition: utils.c:2361
#define VEC_length(T, V)
Definition: vec.h:124
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
Definition: cleanups.c:117
int catching_syscall_number(int syscall_number)
union target_waitstatus::@161 value
#define CATCH_PERMANENT
Definition: breakpoint.h:1246
const char * word
Definition: symtab.h:1448
struct breakpoint * breakpoint_find_if(int(*func)(struct breakpoint *b, void *d), void *user_data)
#define VEC_index(T, V, I)
Definition: vec.h:151
Definition: gnu-nat.c:163
struct gdbarch * get_current_arch(void)
Definition: arch-utils.c:781
static int syscall_catchpoint_p(struct breakpoint *b)
#define UNKNOWN_SYSCALL
Definition: gdbarch.h:1478
static struct catch_syscall_inferior_data * get_catch_syscall_inferior_data(struct inferior *inf)
char * xstrprintf(const char *format,...)
Definition: common-utils.c:107
static void print_mention_catch_syscall(struct breakpoint *b)
initialize_file_ftype _initialize_break_catch_syscall
int ptid_get_pid(ptid_t ptid)
Definition: ptid.c:52
void print_recreate_thread(struct breakpoint *b, struct ui_file *fp)
Definition: breakpoint.c:15272
struct breakpoint * breakpoint_at
Definition: breakpoint.h:1095
const char ** get_syscall_names(struct gdbarch *gdbarch)
Definition: xml-syscall.c:418
print_stop_action
Definition: breakpoint.h:476
const char const char int
Definition: command.h:229
void discard_cleanups(struct cleanup *old_chain)
Definition: cleanups.c:213
static int catching_syscall_number_1(struct breakpoint *b, void *data)
void install_breakpoint(int internal, struct breakpoint *b, int update_gll)
Definition: breakpoint.c:8456
static void clear_syscall_counts(struct inferior *inf)
const char * async_reason_lookup(enum async_reply_reason reason)
Definition: mi-common.c:49
enum target_waitkind kind
Definition: waitstatus.h:100
ptid_t inferior_ptid
Definition: infcmd.c:124
struct bp_location * loc
Definition: breakpoint.h:678
void get_user_print_options(struct value_print_options *opts)
Definition: valprint.c:129
int(* remove_location)(struct bp_location *)
Definition: breakpoint.h:521
#define VEC_free(T, V)
Definition: vec.h:180
static void catch_syscall_inferior_data_cleanup(struct inferior *inf, void *arg)
#define VEC_address(T, V)
Definition: vec.h:369
struct breakpoint_ops base_breakpoint_ops
Definition: breakpoint.c:12761
struct inferior * current_inferior(void)
Definition: inferior.c:57
#define target_set_syscall_catchpoint(pid, needed, any_count, table_size, table)
Definition: target.h:1601
void initialize_breakpoint_ops(void)
Definition: breakpoint.c:15571
#define VEC_cleanup(T)
Definition: vec.h:187
static enum print_stop_action print_it_catch_syscall(bpstat bs)
void(* dtor)(struct breakpoint *self)
Definition: breakpoint.h:502
void ui_out_field_string(struct ui_out *uiout, const char *fldname, const char *string)
Definition: ui-out.c:541
void annotate_catchpoint(int num)
Definition: annotate.c:98
struct ui_out * current_uiout
Definition: ui-out.c:233
enum enable_state enable_state
Definition: breakpoint.h:671
struct gdbarch * gdbarch
Definition: breakpoint.h:396
const char * name
Definition: target.h:104
struct breakpoint * owner
Definition: breakpoint.h:324
void(* print_one)(struct breakpoint *, struct bp_location **)
Definition: breakpoint.h:554
void error(const char *fmt,...)
Definition: errors.c:38
const char * bpdisp_text(enum bpdisp disp)
Definition: breakpoint.c:383
struct breakpoint base
const struct breakpoint_ops * ops
Definition: breakpoint.h:665