This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [llgs] Fix signo sent with fork/vfork/vforkdone events
ClosedPublic

Authored by mgorny on Jun 7 2022, 2:00 AM.

Details

Summary

Fix ThreadStopInfo struct to include the signal number for all events.
Since signo was not included in the details for fork, vfork
and vforkdone stops, the code incidentally referenced the wrong union
member, resulting in wrong signo being sent.

Sponsored by: The FreeBSD Foundation

Diff Detail

Event Timeline

mgorny created this revision.Jun 7 2022, 2:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2022, 2:00 AM
Herald added a subscriber: arichardson. · View Herald Transcript
mgorny requested review of this revision.Jun 7 2022, 2:00 AM
labath added inline comments.Jun 20 2022, 12:08 AM
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
697

It seems this struct is only used in the lldb-server. Maybe we could make this a member function instead? Or move the signo field out of the union?

mgorny added inline comments.Jun 20 2022, 3:44 AM
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
697

I would lean towards the latter, I guess. Lemme look about updating the patch.

mgorny updated this revision to Diff 438410.Jun 20 2022, 8:25 AM
mgorny edited the summary of this revision. (Show Details)

Update to make signo an unconditional member of the struct, and set it for fork/vfork/vforkdone events explicitly.

mgorny marked an inline comment as done.Jun 20 2022, 8:26 AM
labath accepted this revision.Jun 21 2022, 8:09 AM

cool

This revision is now accepted and ready to land.Jun 21 2022, 8:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2022, 10:47 AM