From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Fernando Nasser Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: EINTR in procfs_wait Date: Wed, 11 Apr 2001 11:13:00 -0000 Message-id: <3AD49EB7.60ECBB56@cygnus.com> References: <3AD32106.12A0443E@redhat.com> X-SW-Source: 2001-04/msg00112.html 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. */ TARGET_WAITKIND_IGNORE and let the event-loop force the reentry. Looking at the code (infrun.c:handle_inferior_event()): /* 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. */ case TARGET_WAITKIND_IGNORE: ecs->wait_some_more = 1; return; I think the restriction that that KIND only apples to async/extended-async is incorrect. Andrew