On 4 March 2014 16:55, Greg Clayton <[email protected]> wrote:
> So the timing of when the process IO handler gets pushed seems to be the 
> timing difference. On MacOSX, the IOHandlerProcessSTDIO gets pushed as we are 
> handling the "process launch" or "process attach" and before it asks for 
> another line, the IOHandlerProcessSTDIO is already pushed. Not so for the 
> linux and free bsd case. Does that sound like what you are seeing?

Hi Greg,

I had a little time to look at this again this morning.  Yes, what you
describe sounds like what I'm seeing:

1. ProcessFreeBSD::DoResume returns
2. (lldb) prompt is printed
3. Debugger::PushIOHandler is called

It's not yet clear to me how we should ensure the stdio IOHandler is
pushed prior to emitting the prompt.  As a hack, I added a short sleep
in Process:PrivateResume, and that's sufficient to avoid the race:

diff --git a/source/Target/Process.cpp b/source/Target/Process.cpp
index 5fd73cb..a71fc14 100644
--- a/source/Target/Process.cpp
+++ b/source/Target/Process.cpp
@@ -3527,6 +3527,7 @@ Process::PrivateResume ()
     }
     else if (log)
         log->Printf ("Process::PrivateResume() got an error \"%s\".",
error.AsCString("<unknown error>"));
+    usleep(100);
     return error;
 }

_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to