[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCHv2 6/7] hurd: add gnu_target pointer to fix thread API calls
From: |
Samuel Thibault |
Subject: |
Re: [PATCHv2 6/7] hurd: add gnu_target pointer to fix thread API calls |
Date: |
Sat, 30 May 2020 19:22:11 +0200 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Simon Marchi, le sam. 30 mai 2020 12:08:53 -0400, a ecrit:
> On 2020-05-30 11:53 a.m., Samuel Thibault wrote:
> > Simon Marchi, le sam. 30 mai 2020 10:57:42 -0400, a ecrit:
> >>> @@ -1106,12 +1109,12 @@ inf_validate_procs (struct inf *inf)
> >>> if (inferior_ptid == ptid_t (inf->pid))
> >>> /* This is the first time we're hearing about thread
> >>> ids, after a fork-child. */
> >>> - thread_change_ptid (inferior_ptid, ptid);
> >>> + thread_change_ptid (gnu_target, inferior_ptid, ptid);
> >>
> >>
> >> I think it would have been more straightforward and clean to use
> >> `inf->process_target ()`
> >> (assuming it's the correct thing to do), given that you have access to the
> >> appropriate
> >> inferior everywhere you made changes.
> >
> > I didn't see a way to access the inferior here (inf is a
> > gnu-nat.c-specific structure with no link to struct inferior)
>
> Ah I see. Well, I didn't check all code paths, but for example, for the one
> that goes:
>
> - gnu_nat_target::attach
> - inf_attach
> - inf_startup
> - inf_set_pid
>
> A solution would be to make all these inf_* functions to be private methods
> of the
> gnu_nat_target class.
Ok, I see. thread_change_ptid is however also called from
inf_validate_procs, called from inf_update_procs, called from
i386_gnu_dr_set_control, referenced from the x86 backend
x86_dr_low.set_control = i386_gnu_dr_set_control;
For simplicity I'll keep gnu_target for now, but also work on cleaning
these should-be-static/private functions.
Samuel
- Re: [PATCHv2 3/7] hurd: make function cast stronger, (continued)
[PATCHv2 4/7] hurd: add missing include, Samuel Thibault, 2020/05/29
[PATCHv2 5/7] hurd: remove unused variables, Samuel Thibault, 2020/05/29
[PATCHv2 6/7] hurd: add gnu_target pointer to fix thread API calls, Samuel Thibault, 2020/05/29
[PATCHv2 7/7] hurd: fix pushing target on inferior creation, Samuel Thibault, 2020/05/29
Re: [PATCHv2 1/7] hurd: fix gnu_debug_flag type, Simon Marchi, 2020/05/30
Re: [PATCHv2 1/7] hurd: fix gnu_debug_flag type, Samuel Thibault, 2020/05/30