aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2017-12-06 17:45:09 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2017-12-06 17:49:37 -0500
commit649a140ccf129ff79ea55ac0cc23ebddec0f02ef (patch)
tree83e0dbe669695dd27fd9b8a4e7abe698dd3f287c /gdb/target.h
parent9a93831ccc0ba3ba447552069f230e6d93dcbf3f (diff)
downloadgdb-649a140ccf129ff79ea55ac0cc23ebddec0f02ef.zip
gdb-649a140ccf129ff79ea55ac0cc23ebddec0f02ef.tar.gz
gdb-649a140ccf129ff79ea55ac0cc23ebddec0f02ef.tar.bz2
target_set_syscall_catchpoint, use gdb::array_view and bool
I noticed that we're passing down a data/size pair to target_ops::to_set_syscall_catchpoint. This commit makes use of gdb::array_view instead. While at it, use bool where appropriate as well. gdb/ChangeLog: * break-catch-syscall.c (insert_catch_syscall) (remove_catch_syscall): Adjust to pass reference to inf_data->syscalls_counts directly via gdb::array_view. * fbsd-nat.c (fbsd_set_syscall_catchpoint): Adjust to use bool and gdb::array_view. * linux-nat.c (linux_child_set_syscall_catchpoint): Likewise. * remote.c (remote_set_syscall_catchpoint): Likewise. * target-debug.h (target_debug_print_bool): New. (define target_debug_print_gdb_array_view_const_int): New. * target-delegates.c: Regenerate. * target.h (target_ops) <to_set_syscall_catchpoint>: Use gdb::array_view and bool. (target_set_syscall_catchpoint): Likewise.
Diffstat (limited to 'gdb/target.h')
-rw-r--r--gdb/target.h23
1 files changed, 10 insertions, 13 deletions
diff --git a/gdb/target.h b/gdb/target.h
index 638e2f0..7863a8d 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -607,7 +607,8 @@ struct target_ops
void (*to_follow_exec) (struct target_ops *, struct inferior *, char *)
TARGET_DEFAULT_IGNORE ();
int (*to_set_syscall_catchpoint) (struct target_ops *,
- int, int, int, int, int *)
+ int, bool, int,
+ gdb::array_view<const int>)
TARGET_DEFAULT_RETURN (1);
int (*to_has_exited) (struct target_ops *, int, int, int *)
TARGET_DEFAULT_RETURN (0);
@@ -1615,28 +1616,24 @@ void target_follow_exec (struct inferior *inf, char *execd_pathname);
/* Syscall catch.
- NEEDED is nonzero if any syscall catch (of any kind) is requested.
- If NEEDED is zero, it means the target can disable the mechanism to
+ NEEDED is true if any syscall catch (of any kind) is requested.
+ If NEEDED is false, it means the target can disable the mechanism to
catch system calls because there are no more catchpoints of this type.
ANY_COUNT is nonzero if a generic (filter-less) syscall catch is
- being requested. In this case, both TABLE_SIZE and TABLE should
- be ignored.
+ being requested. In this case, SYSCALL_COUNTS should be ignored.
- TABLE_SIZE is the number of elements in TABLE. It only matters if
- ANY_COUNT is zero.
-
- TABLE is an array of ints, indexed by syscall number. An element in
- this array is nonzero if that syscall should be caught. This argument
- only matters if ANY_COUNT is zero.
+ SYSCALL_COUNTS is an array of ints, indexed by syscall number. An
+ element in this array is nonzero if that syscall should be caught.
+ This argument only matters if ANY_COUNT is zero.
Return 0 for success, 1 if syscall catchpoints are not supported or -1
for failure. */
-#define target_set_syscall_catchpoint(pid, needed, any_count, table_size, table) \
+#define target_set_syscall_catchpoint(pid, needed, any_count, syscall_counts) \
(*current_target.to_set_syscall_catchpoint) (&current_target, \
pid, needed, any_count, \
- table_size, table)
+ syscall_counts)
/* Returns TRUE if PID has exited. And, also sets EXIT_STATUS to the
exit code of PID, if any. */