[Lldb-commits] [PATCH] D126614: [lldb] [gdb-remote] Client support for using the non-stop protocol

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun May 29 07:28:35 PDT 2022


mgorny created this revision.
mgorny added reviewers: labath, krytarowski, emaste.
Herald added a subscriber: arichardson.
Herald added a project: All.
mgorny requested review of this revision.

Add a client support for using the non-stop protocol to run processes
in all-stop mode.  The operations are still done synchronously, so this
does not enable client to asynchronously resume threads or send
additional requests while the process is running.

If plugin.process.gdb-remote.use-non-stop-protocol is set to true prior
to connecting and the server reports support for QNonStop extension,
the client attempts to enable non-stop mode.  Using non-stop mode has
the following implications:

1. When a continue packet is sent, the client receives the synchronous "OK" notification and blocks until %Stop notification arrives.  Then it issues an additional "vCtrlC" command to ensure that all threads are stopped, as is currently required by the client's architecture. In both events, the client drains the notification queue.

2. When a "?" packet is sent, the client issues "vStopped" command series in order to drain the notification queue.

3. When the process is about to be stopped, the client issues a "vCtrlC" command instead of the break sequence.

API tests required changing the Process::Halt() API to inspect process'
private state rather than the public state, that remains eStateUnloaded
in gdb_remote_client tests.

Sponsored by: The FreeBSD Foundation


https://reviews.llvm.org/D126614

Files:
  lldb/packages/Python/lldbsuite/test/gdbclientutils.py
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteProperties.td
  lldb/source/Target/Process.cpp
  lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126614.432788.patch
Type: text/x-patch
Size: 20946 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220529/d6fec9e0/attachment-0001.bin>


More information about the lldb-commits mailing list