This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [gdb-remote] Use vKill packet if multiprocess & available
Needs ReviewPublic

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

Details

Summary

Prefer the modern vKill packet over k if the server reports multiprocess
support. This ensures that when multiple processes are debugged over
a shared connection, only the correct one will be killed.

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 added inline comments.Jul 27 2022, 6:20 AM
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
4268

This is a host signal number (and not really available on windows). Maybe we should just return zero or indicate that we don't know the "cause of death" in some other way? (Are we sure that there's no way to determine the cause of death?)

mgorny added inline comments.Jul 27 2022, 7:05 AM
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
4268

Either way's fine with me, I was treating it as pretty much "an arbitrary return value". The way I understand the protocol, we're supposed to assume that if vKill succeeded, then the process died because of our kill, and the client isn't really supposed to be interested in the technical details of how it died. FWICS if we issue a ? to gdbserver after a vKill, it returns W00 (also, it doesn't return it in non-stop mode at all).