[PATCH 01/10] Merge netbsd_ptrace_fun into the netbsd_process_target class

Kamil Rytarowski kamil@netbsd.org
Wed Oct 7 04:36:44 GMT 2020


On 07.10.2020 04:37, Simon Marchi wrote:
> On 2020-10-01 10:17 p.m., Kamil Rytarowski wrote:
>> Change netbsd_ptrace_fun into a local lambda function, as otherwise
>> if it is a class member it is harder to pass it as a callbakc function
> 
> callbakc -> callback
> 
> I'm not sure I see the advantage of having it as a lambda over a free
> function as it is now (not that I see a disadvantage either, and maybe
> that will become evident in the following patches), but if it makes you
> happy, this is ok.
> 

I prefer to keep all the local static functions in gdbserver citizens of
the NetBSD gdbserver. Long term, shared functionality with the native
target will go to gdb/nat and perhaps some functions like
elf_64_file_p() could be shared by ELF targets.

This refers to all the follow up patches.

>> @@ -96,8 +64,39 @@ netbsd_process_target::create_inferior (const char *program,
>>  {
>>    std::string str_program_args = construct_inferior_arguments (program_args);
>>
>> +  /* Callback used by fork_inferior to start tracing the inferior.  */
>> +  auto fn
> 
> I'd suggest choosing a more meaningful name than "fn", maybe
> "traceme_fn", to match the fork_inferior parameter name.
> 

I will do it.

> Simon
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20201007/4fa211be/attachment-0001.sig>


More information about the Gdb-patches mailing list