This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] target_set_syscall_catchpoint, use gdb::array_view and bool
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: John Baldwin <jhb at FreeBSD dot org>, Simon Marchi <simark at simark dot ca>, Pedro Alves <palves at redhat dot com>, <gdb-patches at sourceware dot org>
- Date: Wed, 6 Dec 2017 17:50:37 -0500
- Subject: Re: [PATCH 2/2] target_set_syscall_catchpoint, use gdb::array_view and bool
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=simon dot marchi at ericsson dot com;
- References: <1509377531-21044-1-git-send-email-palves@redhat.com> <1509377531-21044-3-git-send-email-palves@redhat.com> <c8c0319b-9568-1184-9b6d-1425199c8d5c@FreeBSD.org> <19e8ceb2-8c71-9d94-eeff-324200f2582b@simark.ca> <4f91f6f2-9b0f-d750-5d03-30fc23c0613d@FreeBSD.org>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
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