This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [llgs] Support resuming multiple processes via vCont w/ nonstop
ClosedPublic

Authored by mgorny on Jul 1 2022, 6:17 AM.

Details

Summary

Support using the vCont packet to resume multiple processes
simultaneously when in non-stop mode. The new logic now assumes that:

  • actions without a thread-id or with process id of "p-1" apply to all debugged processes
  • actions with a thread-id without process id apply to the current process (m_continue_process)

As with the other continue packets, it is only possible to resume
processes that are currently stopped (or stop these that are running).
It is unsupported to resume or stop individual threads of a running
process.

Sponsored by: The FreeBSD Foundation

Diff Detail

Event Timeline

mgorny created this revision.Jul 1 2022, 6:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 1 2022, 6:17 AM
Herald added a subscriber: arichardson. · View Herald Transcript
mgorny requested review of this revision.Jul 1 2022, 6:17 AM

@labath, gentle ping. We appreciate all the work you've done reviewing my patches already, and we realize this is a lot of extra work for you. However, could you please try to review this one as well? It's the last patch from our LLGS effort, so getting it in could help us close this topic for now.

labath accepted this revision.Aug 1 2022, 6:29 AM

Looks good modulo the comments.

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
1803

https://sourceware.org/gdb/onlinedocs/gdb/Packets.html#Packets says "It is an error to specify all processes but a specific thread, such as ‘p-1.tid’", so I guess this should error out if tid != AllThreads.

lldb/test/API/tools/lldb-server/TestGdbRemoteForkNonStop.py
160

See cd18e2ea3f4e87f8804a7d6661d5596ef1f07b81 for why that does not work.

This revision is now accepted and ready to land.Aug 1 2022, 6:29 AM
mgorny marked 2 inline comments as done.Aug 1 2022, 9:22 AM

Thanks!

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
1803

Makes sense. For some reason, I thought we've covered it somewhere but maybe it got lost in refactoring.

This revision was landed with ongoing or failed builds.Aug 1 2022, 9:53 AM
This revision was automatically updated to reflect the committed changes.
mgorny marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2022, 9:53 AM