[PATCH 2/2] target_set_syscall_catchpoint, use gdb::array_view and bool

Simon Marchi simon.marchi@ericsson.com
Wed Dec 6 22:50:00 GMT 2017


On 2017-12-06 05:38 PM, John Baldwin wrote:
> On 12/3/17 10:18 AM, Simon Marchi wrote:
>> On 2017-10-30 11:59 AM, John Baldwin wrote:
>>> On 10/30/17 3:32 PM, Pedro Alves wrote:
>>>> 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:
>>>> yyyy-mm-dd  Pedro Alves  <palves@redhat.com>
>>>>
>>>> 	* break-catch-syscall.c (insert_catch_syscall)
>>>> 	(remove_catch_syscall): Adjust to pass reference to
>>>> 	inf_data->syscalls_counts directly via gdb::array_view.
>>>> 	* linux-nat.c (linux_child_set_syscall_catchpoint): Adjust to use
>>>> 	bool and gdb::array_view.
>>>
>>> I believe fbsd-nat.c will need a similar fixup?  It doesn't use the
>>> values passed but does implement the target method.
>>
>> Hi John,
>>
>> Can you check if this updated patch builds properly on FreeBSD?
>>
>> Thanks!
> 
> Just one typo below:
> 
>> diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
>> index 265175a769..1a36414837 100644
>> --- a/gdb/fbsd-nat.c
>> +++ b/gdb/fbsd-nat.c
>> @@ -1163,8 +1163,9 @@ fbsd_remove_exec_catchpoint (struct target_ops *self, int pid)
>>
>>  #ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_SYSCALL_CODE
>>  static int
>> -fbsd_set_syscall_catchpoint (struct target_ops *self, int pid, int needed,
>> -			     int any_count, int table_size, int *table)
>> +fbsd_set_syscall_catchpoint (struct target_ops *self, int pid, bool needed,
>> +			     int any_count,
>> +			     gdb::array_view<const int> syscall_counts))
> 
> Double close paren here should be a single, but builds fine aside from that, thanks!
> 

Thanks, I pushed the patch with that fixed.

Simon



More information about the Gdb-patches mailing list