[all-commits] [llvm/llvm-project] 9823d4: [lldb] [Core] Split read thread support into Threa...

Michał Górny via All-commits all-commits at lists.llvm.org
Tue Sep 6 04:10:02 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9823d42557eb1da3ecf2f771ea2cbc84a988ef92
      https://github.com/llvm/llvm-project/commit/9823d42557eb1da3ecf2f771ea2cbc84a988ef92
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2022-09-06 (Tue, 06 Sep 2022)

  Changed paths:
    M lldb/include/lldb/API/SBCommunication.h
    M lldb/include/lldb/Core/Communication.h
    A lldb/include/lldb/Core/ThreadedCommunication.h
    M lldb/include/lldb/Interpreter/ScriptInterpreter.h
    M lldb/include/lldb/Target/Process.h
    M lldb/include/lldb/lldb-forward.h
    M lldb/source/API/SBCommunication.cpp
    M lldb/source/Core/CMakeLists.txt
    M lldb/source/Core/Communication.cpp
    A lldb/source/Core/ThreadedCommunication.cpp
    M lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
    M lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
    M lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
    M lldb/unittests/Core/CommunicationTest.cpp

  Log Message:
  -----------
  [lldb] [Core] Split read thread support into ThreadedCommunication

Split the read thread support from Communication into a dedicated
ThreadedCommunication subclass.  The read thread support is used only
by a subset of Communication consumers, and it adds a lot of complexity
to the base class.  Furthermore, having a dedicated subclass makes it
clear whether a particular consumer needs to account for the possibility
of read thread being running or not.

The modules currently calling `StartReadThread()` are updated to use
`ThreadedCommunication`.  The remaining modules use the simplified
`Communication` class.

`SBCommunication` is changed to use `ThreadedCommunication` in order
to avoid changing the public API.

`CommunicationKDP` is updated in order to (hopefully) compile with
the new code.  However, I do not have a Darwin box to test it, so I've
limited the changes to the bare minimum.

`GDBRemoteCommunication` is updated to become a `Broadcaster` directly.
Since it does not inherit from `ThreadedCommunication`, its event
support no longer collides with the one used for read thread and can
be implemented cleanly.  The support for
`eBroadcastBitReadThreadDidExit` is removed from the code -- since
the read thread was not used, this event was never reported.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D133251




More information about the All-commits mailing list