GDB (xrefs)

Classes | Functions | Variables
/tmp/gdb-8.1/gdb/break-catch-syscall.c File Reference
`#include "defs.h"`
`#include <ctype.h>`
`#include "breakpoint.h"`
`#include "gdbcmd.h"`
`#include "inferior.h"`
`#include "cli/cli-utils.h"`
`#include "annotate.h"`
`#include "mi/mi-common.h"`
`#include "valprint.h"`
`#include "arch-utils.h"`
`#include "observer.h"`
`#include "xml-syscall.h"`

Go to the source code of this file.

## Classes
struct | syscall_catchpoint
struct | catch_syscall_inferior_data

## Functions
static struct catch_syscall_inferior_data * | get_catch_syscall_inferior_data (struct inferior *inf)
static void | catch_syscall_inferior_data_cleanup (struct inferior *inf, void *arg)
static int | insert_catch_syscall (struct bp_location *bl)
static int | remove_catch_syscall (struct bp_location *bl, enum remove_bp_reason reason)
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)
static void | print_one_catch_syscall (struct breakpoint *b, struct bp_location **last_loc)
static void | print_mention_catch_syscall (struct breakpoint *b)
static void | print_recreate_catch_syscall (struct breakpoint *b, struct ui_file *fp)
static int | syscall_catchpoint_p (struct breakpoint *b)
static void | create_syscall_event_catchpoint (int tempflag, std::vector< int > &&filter, const struct breakpoint_ops *ops)
static std::vector< int > | catch_syscall_split_args (const char *arg)
static void | catch_syscall_command_1 (const char *arg, int from_tty, struct cmd_list_element *command)
static int | is_syscall_catchpoint_enabled (struct breakpoint *bp)
int | catch_syscall_enabled (void)
static int | catching_syscall_number_1 (struct breakpoint *b, void *data)
int | catching_syscall_number (int syscall_number)
static void | catch_syscall_completer (struct cmd_list_element *cmd, completion_tracker &tracker, const char *text, const char *word)
static void | clear_syscall_counts (struct inferior *inf)
static void | initialize_syscall_catchpoint_ops (void)
void | _initialize_break_catch_syscall (void)

## Variables
static const struct inferior_data * | catch_syscall_inferior_data = NULL
static struct breakpoint_ops | catch_syscall_breakpoint_ops

## Function Documentation

## ◆ _initialize_break_catch_syscall()

void _initialize_break_catch_syscall | ( | void |  | ) |

Definition at line 631 of file break-catch-syscall.c.

References _, add_catch_command(), CATCH_PERMANENT, catch_syscall_command_1(), catch_syscall_completer(), catch_syscall_inferior_data_cleanup(), CATCH_TEMPORARY, clear_syscall_counts(), initialize_syscall_catchpoint_ops(), and observer_attach_inferior_exit().

## ◆ breakpoint_hit_catch_syscall()

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

Definition at line 154 of file break-catch-syscall.c.

References if(), target_waitstatus::kind, bp_location::owner, target_waitstatus::syscall_number, syscall_catchpoint::syscalls_to_be_caught, TARGET_WAITKIND_SYSCALL_ENTRY, TARGET_WAITKIND_SYSCALL_RETURN, and target_waitstatus::value.

Referenced by initialize_syscall_catchpoint_ops().

## ◆ catch_syscall_command_1()

static void catch_syscall_command_1 | ( | const char * | arg,
|  | int | from_tty,
|  | struct cmd_list_element * | command
| ) |  |
| static

Definition at line 455 of file break-catch-syscall.c.

References _, catch_syscall_breakpoint_ops, catch_syscall_split_args(), CATCH_TEMPORARY, create_syscall_event_catchpoint(), error(), gdbarch_get_syscall_number_p(), get_cmd_context(), get_current_arch(), get_syscall_by_number(), and skip_spaces().

Referenced by _initialize_break_catch_syscall().

## ◆ catch_syscall_completer()

static void catch_syscall_completer | ( | struct cmd_list_element * | cmd,
|  | completion_tracker & | tracker,
|  | const char * | text,
|  | const char * | word
| ) |  |
| static

Definition at line 553 of file break-catch-syscall.c.

References complete_on_enum(), get_current_arch(), get_syscall_group_names(), get_syscall_names(), startswith(), and string_printf().

Referenced by _initialize_break_catch_syscall().

## ◆ catch_syscall_enabled()

int catch_syscall_enabled | ( | void |  | ) |

Definition at line 506 of file break-catch-syscall.c.

References current_inferior(), get_catch_syscall_inferior_data(), and catch_syscall_inferior_data::total_syscalls_count.

Referenced by handle_syscall_event(), i386_linux_resume(), inf_ptrace_resume(), and linux_handle_syscall_trap().

## ◆ catch_syscall_inferior_data_cleanup()

static void catch_syscall_inferior_data_cleanup | ( | struct inferior * | inf,
|  | void * | arg
| ) |  |
| static

Definition at line 81 of file break-catch-syscall.c.

Referenced by _initialize_break_catch_syscall().

## ◆ catch_syscall_split_args()

static std::vector<int> catch_syscall_split_args | ( | const char * | arg | ) |
| static

Definition at line 380 of file break-catch-syscall.c.

References _, error(), get_syscall_by_name(), get_syscall_by_number(), get_syscalls_by_group(), syscall::name, syscall::number, skip_spaces(), startswith(), target_gdbarch(), UNKNOWN_SYSCALL, and xfree().

Referenced by catch_syscall_command_1().

## ◆ catching_syscall_number()

int catching_syscall_number | ( | int | syscall_number | ) |

Definition at line 542 of file break-catch-syscall.c.

References breakpoint_find_if(), and catching_syscall_number_1().

Referenced by handle_syscall_event(), and linux_handle_syscall_trap().

## ◆ catching_syscall_number_1()

static int catching_syscall_number_1 | ( | struct breakpoint * | b,
|  | void * | data
| ) |  |
| static

Definition at line 519 of file break-catch-syscall.c.

References is_syscall_catchpoint_enabled(), and syscall_catchpoint::syscalls_to_be_caught.

Referenced by catching_syscall_number().

## ◆ clear_syscall_counts()

static void clear_syscall_counts | ( | struct inferior * | inf | ) |
| static

Definition at line 601 of file break-catch-syscall.c.

References catch_syscall_inferior_data::any_syscall_count, get_catch_syscall_inferior_data(), catch_syscall_inferior_data::syscalls_counts, and catch_syscall_inferior_data::total_syscalls_count.

Referenced by _initialize_break_catch_syscall().

## ◆ create_syscall_event_catchpoint()

static void create_syscall_event_catchpoint | ( | int | tempflag,
|  | std::vector< int > && | filter,
|  | const struct breakpoint_ops * | ops
| ) |  |
| static

Definition at line 365 of file break-catch-syscall.c.

References get_current_arch(), init_catchpoint(), and install_breakpoint().

Referenced by catch_syscall_command_1().

## ◆ get_catch_syscall_inferior_data()

static struct catch_syscall_inferior_data* get_catch_syscall_inferior_data | ( | struct inferior * | inf | ) |
| static

Definition at line 65 of file break-catch-syscall.c.

Referenced by catch_syscall_enabled(), clear_syscall_counts(), insert_catch_syscall(), and remove_catch_syscall().

## ◆ initialize_syscall_catchpoint_ops()

static void initialize_syscall_catchpoint_ops | ( | void |  | ) |
| static

Definition at line 612 of file break-catch-syscall.c.

References base_breakpoint_ops, breakpoint_ops::breakpoint_hit, breakpoint_hit_catch_syscall(), catch_syscall_breakpoint_ops, initialize_breakpoint_ops(), insert_catch_syscall(), breakpoint_ops::insert_location, breakpoint_ops::print_it, print_it_catch_syscall(), breakpoint_ops::print_mention, print_mention_catch_syscall(), breakpoint_ops::print_one, print_one_catch_syscall(), breakpoint_ops::print_recreate, print_recreate_catch_syscall(), remove_catch_syscall(), and breakpoint_ops::remove_location.

Referenced by _initialize_break_catch_syscall().

## ◆ insert_catch_syscall()

static int insert_catch_syscall | ( | struct bp_location * | bl | ) |
| static

Definition at line 93 of file break-catch-syscall.c.

References catch_syscall_inferior_data::any_syscall_count, current_inferior(), get_catch_syscall_inferior_data(), bp_location::owner, catch_syscall_inferior_data::syscalls_counts, syscall_catchpoint::syscalls_to_be_caught, and catch_syscall_inferior_data::total_syscalls_count.

Referenced by initialize_syscall_catchpoint_ops().

## ◆ is_syscall_catchpoint_enabled()

static int is_syscall_catchpoint_enabled | ( | struct breakpoint * | bp | ) |
| static

Definition at line 495 of file break-catch-syscall.c.

References bp, bp_call_disabled, bp_disabled, and syscall_catchpoint_p().

Referenced by catching_syscall_number_1().

## ◆ print_it_catch_syscall()

static enum print_stop_action print_it_catch_syscall | ( | bpstat | bs | ) |
| static

Definition at line 188 of file break-catch-syscall.c.

References annotate_catchpoint(), async_reason_lookup(), bpstats::bp_location_at, bpdisp_text(), bpstats::breakpoint_at, current_uiout, disp_del, breakpoint::disposition, EXEC_ASYNC_SYSCALL_ENTRY, EXEC_ASYNC_SYSCALL_RETURN, ui_out::field_int(), ui_out::field_string(), bp_location::gdbarch, get_last_target_status(), get_syscall_by_number(), ui_out::is_mi_like_p(), target_waitstatus::kind, maybe_print_thread_hit_breakpoint(), syscall::name, breakpoint::number, PRINT_SRC_AND_LOC, target_waitstatus::syscall_number, TARGET_WAITKIND_SYSCALL_ENTRY, ui_out::text(), and target_waitstatus::value.

Referenced by initialize_syscall_catchpoint_ops().

## ◆ print_mention_catch_syscall()

static void print_mention_catch_syscall | ( | struct breakpoint * | b | ) |
| static

Definition at line 298 of file break-catch-syscall.c.

References _, bp_location::gdbarch, get_syscall_by_number(), breakpoint::loc, syscall::name, syscall::number, breakpoint::number, printf_filtered(), and syscall_catchpoint::syscalls_to_be_caught.

Referenced by initialize_syscall_catchpoint_ops().

## ◆ print_one_catch_syscall()

static void print_one_catch_syscall | ( | struct breakpoint * | b,
|  | struct bp_location ** | last_loc
| ) |  |
| static

Definition at line 241 of file break-catch-syscall.c.

References value_print_options::addressprint, annotate_field(), current_uiout, ui_out::field_skip(), ui_out::field_string(), bp_location::gdbarch, get_syscall_by_number(), get_user_print_options(), ui_out::is_mi_like_p(), breakpoint::loc, syscall::name, syscall_catchpoint::syscalls_to_be_caught, ui_out::text(), xfree(), and xstrprintf().

Referenced by initialize_syscall_catchpoint_ops().

## ◆ print_recreate_catch_syscall()

static void print_recreate_catch_syscall | ( | struct breakpoint * | b,
|  | struct ui_file * | fp
| ) |  |
| static

Definition at line 331 of file break-catch-syscall.c.

References fprintf_unfiltered(), bp_location::gdbarch, get_syscall_by_number(), breakpoint::loc, syscall::name, syscall::number, print_recreate_thread(), and syscall_catchpoint::syscalls_to_be_caught.

Referenced by initialize_syscall_catchpoint_ops().

## ◆ remove_catch_syscall()

static int remove_catch_syscall | ( | struct bp_location * | bl,
|  | enum remove_bp_reason | reason
| ) |  |
| static

Definition at line 123 of file break-catch-syscall.c.

References catch_syscall_inferior_data::any_syscall_count, current_inferior(), get_catch_syscall_inferior_data(), bp_location::owner, catch_syscall_inferior_data::syscalls_counts, syscall_catchpoint::syscalls_to_be_caught, and catch_syscall_inferior_data::total_syscalls_count.

Referenced by initialize_syscall_catchpoint_ops().

## ◆ syscall_catchpoint_p()

static int syscall_catchpoint_p | ( | struct breakpoint * | b | ) |
| static

Definition at line 359 of file break-catch-syscall.c.

References catch_syscall_breakpoint_ops, and breakpoint::ops.

Referenced by is_syscall_catchpoint_enabled().

## Variable Documentation

## ◆ catch_syscall_breakpoint_ops

struct breakpoint_ops catch_syscall_breakpoint_ops
| static

Definition at line 354 of file break-catch-syscall.c.

Referenced by catch_syscall_command_1(), initialize_syscall_catchpoint_ops(), and syscall_catchpoint_p().

## ◆ catch_syscall_inferior_data

const struct inferior_data* catch_syscall_inferior_data = NULL
| static

Definition at line 45 of file break-catch-syscall.c.