This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [llgs] Implement the vKill packet
ClosedPublic

Authored by mgorny on Jun 13 2022, 9:05 AM.

Details

Summary

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

Diff Detail

Event Timeline

mgorny created this revision.Jun 13 2022, 9:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2022, 9:05 AM
Herald added a subscriber: arichardson. · View Herald Transcript
mgorny updated this revision to Diff 436441.Jun 13 2022, 9:23 AM

Remove leftover exit_regex from test.

mgorny retitled this revision from [PATCH] [lldb] [llgs] Implement the vKill packet to [lldb] [llgs] Implement the vKill packet.Jun 20 2022, 10:48 AM
mgorny updated this revision to Diff 438706.Jun 21 2022, 8:02 AM

Rebase and update for changes in D127500.

Do we need the kill command to be asynchronous (return before the process actually dies) for anything. Could we just make it synchronous instead (call wait inside the process plugin, and return the wait result)?

Do we need the kill command to be asynchronous (return before the process actually dies) for anything. Could we just make it synchronous instead (call wait inside the process plugin, and return the wait result)?

Well, I have two concerns with that:

  1. I have no clue about Windows or an environment to test it, so I wouldn't be able to update the Windows plugin code.
  2. I'm a bit concerned about the Linux PTRACE_EVENT_EXIT handling. I mean, I suppose it's unlikely for something to go wrong there and cause us to hang but I'm not sure.
labath accepted this revision.Jun 24 2022, 7:17 AM

Yeah, the pre-exit event makes this somewhat tricky. Let's stick with this then.

This revision is now accepted and ready to land.Jun 24 2022, 7:17 AM
This revision was landed with ongoing or failed builds.Jun 24 2022, 8:20 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2022, 8:20 AM