[Lldb-commits] [PATCH] D157159: [lldb] Properly protect the Communication class with reader/writer lock

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Aug 6 21:20:35 PDT 2023


JDevlieghere added inline comments.


================
Comment at: lldb/source/Core/ThreadedCommunication.cpp:63-67
-void ThreadedCommunication::Clear() {
-  SetReadThreadBytesReceivedCallback(nullptr, nullptr);
-  StopReadThread(nullptr);
-  Communication::Clear();
-}
----------------
This wasn't used: nobody called `Clear` on an instance of `ThreadedCommunication`. 


================
Comment at: lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp:560
   StopAsyncThread();
-  m_comm.Clear();
 
----------------
According to the comment on line 541 this is wrong:

```     // We are running and we can't interrupt a running kernel, so we need to
    // just close the connection to the kernel and hope for the best```

`m_comm` is an instance of `CommunicationKDP` which didn't override `Communication::Clear` and hence just called `Disconnected`. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157159/new/

https://reviews.llvm.org/D157159



More information about the lldb-commits mailing list