This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [gdb-remote] Refactor killing process and move it to client
ClosedPublic

Authored by mgorny on Jul 22 2022, 2:57 AM.

Details

Summary

Refactor the code responsible for sending the "k" packet and move it
into GDBRemoteCommunicationClient::KillProcess() method. This is part
of refactoring to enable multiprocess support in the client,
and to support using the vKill packet instead.

As part of the refactoring, the following functional changes apply:

  • Some redundant logging has been removed, as any failures are returned via exit_string anyway.
  • SetLastStopPacket() is no longer called. It is used only to populate the thread list, and since the process has just exited and we're terminating the process instance, there's really no reason to set it.
  • On successful kill, exit_string is set to "killed", to clearly indicate that the process has terminated on our request rather than on its own.

Sponsored by: The FreeBSD Foundation

Diff Detail

Event Timeline

mgorny created this revision.Jul 22 2022, 2:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2022, 2:57 AM
Herald added a subscriber: arichardson. · View Herald Transcript
mgorny requested review of this revision.Jul 22 2022, 2:57 AM
labath accepted this revision.Jul 25 2022, 5:44 AM
This revision is now accepted and ready to land.Jul 25 2022, 5:44 AM
This revision was landed with ongoing or failed builds.Jul 25 2022, 9:43 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 25 2022, 9:43 AM