[Lldb-commits] [PATCH] Fix multiple problems of lldb-mi blocking on input monitoring and needing a return.
Ilia K
ki.stfu at gmail.com
Tue Feb 10 03:18:10 PST 2015
================
Comment at: test/tools/lldb-mi/TestMiExit.py:33-34
@@ -32,4 +31,2 @@
self.expect("\^exit")
- import pexpect
- self.expect(pexpect.EOF)
----------------
It checks that lldb-mi really exited. If it doesn't work on Linux we can skip test or it should be commented out and we should mark it as "FIXME" for future fixes.
I think "skip test" is preferable.
================
Comment at: tools/lldb-mi/MICmnStreamStdinLinux.cpp:162-164
@@ +161,5 @@
+ // The reason for delay was behavior of select in multithreaded app.
+ // The man pages for select suggest that closing a fd which is monitored
+ // by select from another thread has no effect. It effectively caused the
+ // application to block in select forever and test cases timed out.
+ // To fix this issue, I have introduced the a timeout using 3rd arg of select. It
----------------
Have you tried to monitor errors using 3rd arg of select?
================
Comment at: tools/lldb-mi/MICmnStreamStdinLinux.cpp:165
@@ +164,3 @@
+ // application to block in select forever and test cases timed out.
+ // To fix this issue, I have introduced the a timeout using 3rd arg of select. It
+ // gives us chance to see if other thread has asked us to stop waiting for
----------------
timeout is 4th argument
================
Comment at: tools/lldb-mi/MIDriver.cpp:524
@@ -524,1 +523,3 @@
+ // input and needs an extra return before exiting.
+ if ((vStdInBuffer == "quit") || (vStdInBuffer.find("-gdb-exit") != std::string::npos))
vrwbYesExit = true;
----------------
I do not like this "if", but you have extended its functionality. Maybe it would be better to call CMICmnStreamStdinLinux::InterruptReadLine() from -gdb-exit command? or use CMIDriver::GetExitApplicationFlag() instead of m_waitForInput in CMICmnStreamStdinLinux::InputAvailable()?
http://reviews.llvm.org/D7529
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the lldb-commits
mailing list