https://blog.csdn.net/hejinjing_tom_com/article/details/50570442
watch *(int*)0x12345678
info watch
/* Used when starting or continuing the program. */
static int
insert_bp_location (struct bp_location *bl,
struct ui_file *tmp_error_stream,
int *disabled_breaks,
int *hw_breakpoint_error,
int *hw_bp_error_explained_already)
static void
insert_breakpoint_locations (void)
{
。。。。。。。
if (some_failed)
{
for (loc = bpt->loc; loc; loc = loc->next)
if (loc->inserted)
remove_breakpoint (loc);
hw_breakpoint_error = 1;
tmp_error_stream.printf ("Could not insert "
"hardware watchpoint %d.\n",
bpt->number);
error_flag = -1;
}
if (error_flag)
{
/* If a hardware breakpoint or watchpoint was inserted, add a
message about possibly exhausted resources. */
if (hw_breakpoint_error && !hw_bp_error_explained_already)
{
tmp_error_stream.printf ("Could not insert hardware breakpoints:\n\
You may have requested too many hardware breakpoints/watchpoints.\n");
}
target_terminal::ours_for_output ();
error_stream (tmp_error_stream);
}
static void
initialize_syscall_catchpoint_ops (void)
{
struct breakpoint_ops *ops;
initialize_breakpoint_ops ();
/* Syscall catchpoints. */
ops = &catch_syscall_breakpoint_ops;
*ops = base_breakpoint_ops;
ops->insert_location = insert_catch_syscall;
ops->remove_location = remove_catch_syscall;
ops->breakpoint_hit = breakpoint_hit_catch_syscall;
ops->print_it = print_it_catch_syscall;
ops->print_one = print_one_catch_syscall;
ops->print_mention = print_mention_catch_syscall;
ops->print_recreate = print_recreate_catch_syscall;
}
int
remote_target::set_syscall_catchpoint (int pid, bool needed, int any_count,
gdb::array_view<const int> syscall_counts)