<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Just pinging on this one to see if it's ok?<br>
<br>
Thanks much.<br>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF279149"><font face="Tahoma" color="#000000" size="2"><b>From:</b> lldb-dev-bounces@cs.uiuc.edu [lldb-dev-bounces@cs.uiuc.edu] on behalf of Matthew Sorrels [sorrels.m@gmail.com]<br>
<b>Sent:</b> Friday, May 17, 2013 2:39 PM<br>
<b>To:</b> lldb-dev@cs.uiuc.edu<br>
<b>Subject:</b> [lldb-dev] Patch for garbage characters on quit<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div>
<div>
<div>It's possible others aren't seeing this but on Ubuntu 12.04 64 bits, when I exit lldb I get a few randomish garbage characters spewed to the terminal. It appears the problem is the shutdown of master_out_comm in tools/driver/Driver.cpp around line 1591.
But I'm not sure I know enough about how this works to say what I'm doing to fix it is the best solution. Other code for handling a Communication clear appears to shut them down by doing the following:<br>
<br>
SetReadThreadBytesReceivedCallback (NULL, NULL);<br>
Disconnect (NULL);<br>
StopReadThread (NULL);<br>
<br>
</div>
Using this sequence on the master_out_comm seems to stop it from spewing random characters while quiting. Just stoping the read thread wasn't a good solution, since it caused a huge pause. Had to set the callback to NULL and disconnect first.<br>
<br>
It also seemed kind of odd to me that you are closing the editline_output_pty before shutting down master_out_comm and out_comm_2 (which both were passed the editline file descriptor). So I moved that CloseMasterFileDescriptor down after shutting down master_out_comm
and out_comm_2. Not sure this really needed to be done(didn't make any visible difference), but it felt right.<br>
<br>
</div>
Here's the patch -- it seems to work for me (but I have no Mac to test it on), it's very possible I'm completely misunderstanding how this should work. I'm still trying to get my feet wet on this code base. Thanks,<br>
<br>
</div>
<div><br>
<br>
Index: tools/driver/Driver.cpp<br>
===================================================================<br>
--- tools/driver/Driver.cpp (revision 182137)<br>
+++ tools/driver/Driver.cpp (working copy)<br>
@@ -1587,9 +1587,16 @@<br>
}<br>
}<br>
<br>
- editline_output_pty.CloseMasterFileDescriptor();<br>
+<br>
+ master_out_comm.SetReadThreadBytesReceivedCallback(NULL, NULL);<br>
master_out_comm.Disconnect();<br>
+ master_out_comm.ReadThreadStop();<br>
+<br>
+ out_comm_2.SetReadThreadBytesReceivedCallback(NULL, NULL);<br>
out_comm_2.Disconnect();<br>
+ out_comm_2.ReadThreadStop(); <br>
+<br>
+ editline_output_pty.CloseMasterFileDescriptor();<br>
reset_stdin_termios();<br>
fclose (stdin);<br>
<br>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>