Re: [rfc] Call init_wait_for_inferior before get_offsets

Pedro Alves
2011-06-23T13:46:40Z

On Thursday 23 June 2011 14:19:59, Yao Qi wrote:
> On 06/23/2011 06:38 PM, Pedro Alves wrote:
> > On Thursday 23 June 2011 11:34:41, Yao Qi wrote:
> >
> >>> Yao> * remote.c (remote_start_remote): ... here.
> >
> > There's another call to get_offsets in the else branch.
> >
>
> Yes, but there has been a call to init_wait_for_inferior () "guarded" at
> the beginning of that branch.

Bah, and I was the one that put it there even... :-)

>
> else
> {
> /* Clear WFI global state. Do this before finding about new
> threads and inferiors, and setting the current inferior.
> Otherwise we would clear the proceed status of the current
> inferior when we want its stop_soon state to be preserved
> (see notice_new_inferior). */
> init_wait_for_inferior ();
> ...
> ...
> get_offsets (); /* Get text, data & bss offsets. */

Your patch is okay ...

> + init_wait_for_inferior ();
> +
> get_offsets (); /* Get text, data & bss offsets. */

... with a small comment above the init_wait_for_inferior call
mentioning the reason it is called before get_offsets.

--
Pedro Alves