Re: [PATCH v7 3/4] Share fork_inferior et al with gdbserver

Sergio Durigan Junior
2017-06-07T22:08:55Z

On Wednesday, June 07 2017, Pedro Alves wrote:

> On 06/07/2017 10:41 PM, Sergio Durigan Junior wrote:
>> On Wednesday, June 07 2017, I wrote:
>>
>>> On Wednesday, June 07 2017, Pedro Alves wrote:
>>>> I think we could get rid of the new common-inferior.h
>>>> header too, but I'll leave that as is, for now at least.
>>>
>>> And move get_exec_{wrapper,file} to fork-inferior.h and fork-child.c,
>>> you mean?
>>
>> Probably not, because get_exec_file is used by Windows targets as well.
>> I'll wait for your reply before submitting the next patch.
>>
>
> Considering exec_file for instance: fork_inferior calls
> get_exec_file if exec_file is NULL. But, we could just
> pass down the right exec_file to fork_inferior in the first
> place. We could do that by e.g., adding fork_child
> wrapper functions to both gdb and gdbserver's fork-child.c that
> would call the shared fork_inferior function, and then adjust
> targets to call that instead. For the exec wrapper, we could
> add a new "const char *exec_wrapper" parameter to fork_inferior.
>
> Since it's arguable which approach is better in this case,
> I'm totally fine with leaving things as is.
>
> I notice now that get_exec_file is still declared
> in gdbcore.h, however.

OK, I'll leave things as is then, and will tackle this problem at a
later date.

Thanks,

--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible