34 #define INTERNAL_SIGNAL(x) ((x) == GDB_SIGNAL_TRAP || (x) == GDB_SIGNAL_INT) 74 if (strcmp (result,
"?") == 0)
97 for (
int i = 0; i < GDB_SIGNAL_LAST; ++i)
128 for (
int i = 0; i < GDB_SIGNAL_LAST; ++i)
154 gdb_signal signal_number;
167 if (signal_number == iter)
185 const char *signal_name;
221 uiout->
text (
"signals \"");
223 uiout->
text (
"signal \"");
244 c->
catch_all ?
"<any signal>" :
"<standard signals>");
324 c->signals_to_be_caught = std::move (filter);
325 c->catch_all = catch_all;
334 static std::vector<gdb_signal>
337 std::vector<gdb_signal> result;
343 gdb_signal signal_number;
347 if (one_arg.empty ())
351 if (one_arg ==
"all")
354 if (*arg !=
'\0' || !first)
355 error (
_(
"'all' cannot be caught with other signals"));
364 num = (int) strtol (one_arg.c_str (), &endptr, 0);
370 if (signal_number == GDB_SIGNAL_UNKNOWN)
371 error (
_(
"Unknown signal name '%s'."), one_arg.c_str ());
374 result.push_back (signal_number);
377 result.shrink_to_fit ();
388 bool catch_all =
false;
389 std::vector<gdb_signal> filter;
434 Catch signals by their names and/or numbers.\n\ 435 Usage: catch signal [[NAME|NUMBER] [NAME|NUMBER]...|all]\n\ 436 Arguments say which signals to catch. If no arguments\n\ 437 are given, every \"normal\" signal will be caught.\n\ 438 The argument \"all\" means to also catch signals used by GDB.\n\ 439 Arguments, if given, should be one or more signal names\n\ 440 (if your system supports that), or signal numbers."),
void get_last_target_status(ptid_t *ptidp, struct target_waitstatus *status)
void(* print_recreate)(struct breakpoint *, struct ui_file *fp)
void * get_cmd_context(struct cmd_list_element *cmd)
static unsigned int * signal_catch_counts
void signal_catch_update(const unsigned int *info)
void field_string(const char *fldname, const char *string)
enum gdb_signal gdb_signal_from_command(int num)
enum print_stop_action(* print_it)(struct bpstats *bs)
void install_breakpoint(int internal, std::unique_ptr< breakpoint > &&arg, int update_gll)
char * plongest(LONGEST l)
void field_skip(const char *fldname)
void annotate_field(int num)
std::string extract_arg(const char **arg)
static void signal_catchpoint_print_one(struct breakpoint *b, struct bp_location **last_loc)
void(* print_mention)(struct breakpoint *)
union target_waitstatus::@174 value
static void create_signal_catchpoint(int tempflag, std::vector< gdb_signal > &&filter, bool catch_all)
char * skip_spaces(char *chp)
#define INTERNAL_SIGNAL(x)
void text(const char *string)
static int signal_catchpoint_explains_signal(struct breakpoint *b, enum gdb_signal sig)
void printf_filtered(const char *format,...)
void signal_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
int(* insert_location)(struct bp_location *)
static int signal_catchpoint_remove_location(struct bp_location *bl, enum remove_bp_reason reason)
static void catch_signal_command(const char *arg, int from_tty, struct cmd_list_element *command)
int fputc_unfiltered(int c, struct ui_file *stream)
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)
static const char * signal_to_name_or_int(enum gdb_signal sig)
struct gdbarch * get_current_arch(void)
static int signal_catchpoint_breakpoint_hit(const struct bp_location *bl, const address_space *aspace, CORE_ADDR bp_addr, const struct target_waitstatus *ws)
const char * gdb_signal_to_name(enum gdb_signal)
int(* explains_signal)(struct breakpoint *, enum gdb_signal)
struct breakpoint * breakpoint_at
enum gdb_signal gdb_signal_from_name(const char *)
static void signal_catchpoint_print_mention(struct breakpoint *b)
static void signal_catchpoint_print_recreate(struct breakpoint *b, struct ui_file *fp)
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)
std::vector< gdb_signal > signals_to_be_caught
static enum print_stop_action signal_catchpoint_print_it(bpstat bs)
void get_user_print_options(struct value_print_options *opts)
struct breakpoint_ops base_breakpoint_ops
void initialize_breakpoint_ops(void)
static int signal_catchpoint_insert_location(struct bp_location *bl)
static std::vector< gdb_signal > catch_signal_split_args(const char *arg, bool *catch_all)
void annotate_catchpoint(int num)
static void initialize_signal_catchpoint_ops(void)
void(* print_one)(struct breakpoint *, struct bp_location **)
void maybe_print_thread_hit_breakpoint(struct ui_out *uiout)
void error(const char *fmt,...)
static struct breakpoint_ops signal_catchpoint_ops
void _initialize_break_catch_sig(void)
void init_catchpoint(struct breakpoint *b, struct gdbarch *gdbarch, int tempflag, const char *cond_string, const struct breakpoint_ops *ops)