From 649a140ccf129ff79ea55ac0cc23ebddec0f02ef Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 6 Dec 2017 17:45:09 -0500 Subject: 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) : Use gdb::array_view and bool. (target_set_syscall_catchpoint): Likewise. --- gdb/target-debug.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gdb/target-debug.h') diff --git a/gdb/target-debug.h b/gdb/target-debug.h index d1d7fb5..27e5a55 100644 --- a/gdb/target-debug.h +++ b/gdb/target-debug.h @@ -56,6 +56,8 @@ target_debug_do_print (((X) ? (X) : "(null)")) #define target_debug_print_int(X) \ target_debug_do_print (plongest (X)) +#define target_debug_print_bool(X) \ + target_debug_do_print ((X) ? "true" : "false") #define target_debug_print_long(X) \ target_debug_do_print (plongest (X)) #define target_debug_print_enum_target_xfer_status(X) \ @@ -166,6 +168,8 @@ target_debug_do_print (plongest (X)) #define target_debug_print_traceframe_info_up(X) \ target_debug_do_print (host_address_to_string (X.get ())) +#define target_debug_print_gdb_array_view_const_int(X) \ + target_debug_do_print (host_address_to_string (X.data ())) static void target_debug_print_struct_target_waitstatus_p (struct target_waitstatus *status) -- cgit v1.1