[all-commits] [llvm/llvm-project] e8fe7e: [lldb] [llgs] Make `k` kill all processes, and fix...

Michał Górny via All-commits all-commits at lists.llvm.org
Fri Jun 24 08:20:40 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e8fe7e930a45764cbb88d9c3fa91ef7dc1ebcc97
      https://github.com/llvm/llvm-project/commit/e8fe7e930a45764cbb88d9c3fa91ef7dc1ebcc97
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2022-06-24 (Fri, 24 Jun 2022)

  Changed paths:
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
    M lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py

  Log Message:
  -----------
  [lldb] [llgs] Make `k` kill all processes, and fix multiple exits

Modify the behavior of the `k` packet to kill all inferiors rather than
just the current one.  The specification leaves the exact behavior
of this packet up to the implementation but since vKill is specifically
meant to be used to kill a single process, it seems logical to use `k`
to provide the alternate function of killing all of them.

Move starting stdio forwarding from the "running" response
to the packet handlers that trigger the process to start.  This avoids
attempting to start it multiple times when multiple processes are killed
on Linux which implicitly causes LLGS to receive "started" events
for all of them.  This is probably also more correct as the ability
to send "O" packets is implied by the continue-like command being issued
(and therefore the client waiting for responses) rather than the start
notification.

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


  Commit: c18784ba330ac0f57e6ec433cfa8317349c445ff
      https://github.com/llvm/llvm-project/commit/c18784ba330ac0f57e6ec433cfa8317349c445ff
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2022-06-24 (Fri, 24 Jun 2022)

  Changed paths:
    M lldb/include/lldb/Utility/StringExtractorGDBRemote.h
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
    M lldb/source/Utility/StringExtractorGDBRemote.cpp
    M lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py

  Log Message:
  -----------
  [lldb] [llgs] Implement the vKill packet

Implement the support for the vKill packet.  This is the modern packet
used by the GDB Remote Serial Protocol to kill one of the debugged
processes.  Unlike the `k` packet, it has well-defined semantics.

The `vKill` packet takes the PID of the process to kill, and always
replies with an `OK` reply (rather than the exit status, as LLGS does
for `k` packets at the moment).  Additionally, unlike the `k` packet
it does not cause the connection to be terminated once the last process
is killed — the client needs to close it explicitly.

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


  Commit: 3266b117147db73d1c42668c1033b59a36d8a2f3
      https://github.com/llvm/llvm-project/commit/3266b117147db73d1c42668c1033b59a36d8a2f3
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2022-06-24 (Fri, 24 Jun 2022)

  Changed paths:
    M lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py
    M lldb/test/API/tools/lldb-server/main.cpp

  Log Message:
  -----------
  [lldb] [llgs] Add test for resuming via c in multiprocess scenarios

Add a test verifying that it is possible to resume a single process
via the `c` packet when multiple processes are being debugged.  This
includes a tiny change to the test program — when `fork()` is called,
the child process is no longer terminated immediately but continues
performing the same tasks as queued for the parent.

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


  Commit: a3422793e0643fa849ff178d87fc706c81b734b7
      https://github.com/llvm/llvm-project/commit/a3422793e0643fa849ff178d87fc706c81b734b7
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2022-06-24 (Fri, 24 Jun 2022)

  Changed paths:
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
    M lldb/source/Utility/StringExtractorGDBRemote.cpp
    M lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py

  Log Message:
  -----------
  [lldb] [llgs] Support resuming one process with PID!=current via vCont

Extend vCont function to support resuming a process with an arbitrary
PID, that could be different than the one selected via Hc (or no process
at all may be selected).  Resuming more than one process simultaneously
is not supported yet.

Remove the ReadTid() method that was only used by Handle_vCont(),
and furthermore it was wrongly using m_current_process rather than
m_continue_process.

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


  Commit: 0481d8efa92f4508e847046b748c17ace1813272
      https://github.com/llvm/llvm-project/commit/0481d8efa92f4508e847046b748c17ace1813272
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2022-06-24 (Fri, 24 Jun 2022)

  Changed paths:
    M lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py

  Log Message:
  -----------
  [lldb] [llgs] Add a test for multiprocess memory read/write

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


  Commit: 75757c86c695a6b4695458343637b3c4fe86def6
      https://github.com/llvm/llvm-project/commit/75757c86c695a6b4695458343637b3c4fe86def6
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2022-06-24 (Fri, 24 Jun 2022)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
    M lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py

  Log Message:
  -----------
  [lldb] [llgs] Support multiprocess in qfThreadInfo

Update the `qfThreadInfo` handler to report threads of all debugged
processes and include PIDs when in multiprocess mode.

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


  Commit: 14d67073359a86f1d2ae9e140f0b29aa4e63a3af
      https://github.com/llvm/llvm-project/commit/14d67073359a86f1d2ae9e140f0b29aa4e63a3af
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2022-06-24 (Fri, 24 Jun 2022)

  Changed paths:
    M lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py

  Log Message:
  -----------
  [lldb] [llgs] Add a test for multiprocess register read/write

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


  Commit: 630da0e309ef4764465dcaf559676633e948f5c0
      https://github.com/llvm/llvm-project/commit/630da0e309ef4764465dcaf559676633e948f5c0
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2022-06-24 (Fri, 24 Jun 2022)

  Changed paths:
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
    M lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py

  Log Message:
  -----------
  [lldb] [llgs] Include PID in QC response in multiprocess mode

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


  Commit: e827e5186fb6991bc749eaaddf13f8a53ebb63c2
      https://github.com/llvm/llvm-project/commit/e827e5186fb6991bc749eaaddf13f8a53ebb63c2
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2022-06-24 (Fri, 24 Jun 2022)

  Changed paths:
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
    M lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py

  Log Message:
  -----------
  [lldb] [llgs] Implement the 'T' packet

Implement the 'T' packet that is used to verify whether the specified
thread belongs to the debugged processes.

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


  Commit: 4b485fc0ea4acf065c7992a5c9a1223f5565544e
      https://github.com/llvm/llvm-project/commit/4b485fc0ea4acf065c7992a5c9a1223f5565544e
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2022-06-24 (Fri, 24 Jun 2022)

  Changed paths:
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h

  Log Message:
  -----------
  [lldb] [llgs] Introduce an AppendThreadIDToResponse() helper

Introduce a helper function to append GDB Remote Serial Protocol "thread
IDs", with optional PID in multiprocess mode.

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


  Commit: c1829e0ec58bd974e65639de0b9cbab736bb624f
      https://github.com/llvm/llvm-project/commit/c1829e0ec58bd974e65639de0b9cbab736bb624f
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2022-06-24 (Fri, 24 Jun 2022)

  Changed paths:
    M lldb/test/API/tools/lldb-server/TestGdbRemoteFork.py

  Log Message:
  -----------
  [lldb] [test] Move part of fork tests to common helper

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


Compare: https://github.com/llvm/llvm-project/compare/8ad4c6e4b129...c1829e0ec58b


More information about the All-commits mailing list