[all-commits] [llvm/llvm-project] 89a369: [lldb] Fix ThreadedCommunication races

Pavel Labath via All-commits all-commits at lists.llvm.org
Fri Sep 9 06:11:01 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 89a3691b794cee20187e14a750ecde8b6d3f7e71
      https://github.com/llvm/llvm-project/commit/89a3691b794cee20187e14a750ecde8b6d3f7e71
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2022-09-09 (Fri, 09 Sep 2022)

  Changed paths:
    M lldb/source/Core/ThreadedCommunication.cpp

  Log Message:
  -----------
  [lldb] Fix ThreadedCommunication races

The Read function could end up blocking if data (or EOF) arrived just as
it was about to start waiting for the events. This was only discovered
now, because we did not have unit tests for this functionality before.
We need to check for data *after* we start listening for incoming
events. There were no changes to the read thread code needed, as we
already use this pattern in SynchronizeWithReadThread, so I just updated
the comments to make it clear that it is used for reading as well.

Differential Revision: https://reviews.llvm.org/D133410


  Commit: 681d0d9e5f05405e4d0048e40796c5d08e85db93
      https://github.com/llvm/llvm-project/commit/681d0d9e5f05405e4d0048e40796c5d08e85db93
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2022-09-09 (Fri, 09 Sep 2022)

  Changed paths:
    M lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
    A lldb/test/API/tools/lldb-server/TestGdbRemoteLaunch.py
    M lldb/test/API/tools/lldb-server/TestLldbGdbServer.py

  Log Message:
  -----------
  [lldb-server] Report launch error in vRun packets

Uses our existing "error string" extension to provide a better
indication of why the launch failed (the client does not make use of the
error yet).

Also, fix the way we obtain the launch error message (make sure we read
the whole message, and skip trailing garbage), and reduce the size of
TestLldbGdbServer by splitting some tests into a separate file.

Differential Revision: https://reviews.llvm.org/D133352


Compare: https://github.com/llvm/llvm-project/compare/05f56f10ed84...681d0d9e5f05


More information about the All-commits mailing list