This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: RFA: EINTR in procfs_wait

Fernando Nasser wrote:
> Folks,
> I got this patch and it seems that we did forget to test for EINTR in
> procfs_wait(). It looks like an "obvious fix" but I would like someone
> else to double check it.

Anything involving a goto is not an obvious fix :-)

> +           goto wait_again;

In theory, procfs_wait() should be able to return (target.h):

    /* This is used for target async and extended-async
       only. Remote_async_wait() returns this when there is an event
       on the inferior, but the rest of the world is not interested in
       it. The inferior has not stopped, but has just sent some output
       to the console, for instance. In this case, we want to go back
       to the event loop and wait there for another event from the
       inferior, rather than being stuck in the remote_async_wait()
       function. This way the event loop is responsive to other events,
       like for instance the user typing.  */

and let the event-loop force the reentry.  Looking at the code

        /* We had an event in the inferior, but we are not interested
           in handling it at this level. The lower layers have already
           done what needs to be done, if anything. This case can
           occur only when the target is async or extended-async. One
           of the circumstamces for this to happen is when the
           inferior produces output for the console. The inferior has
           not stopped, and we are ignoring the event. */
        ecs->wait_some_more = 1;

I think the restriction that that KIND only apples to
async/extended-async is incorrect.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]