This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [Process/FreeBSDRemote] Fix attaching via lldb-server
ClosedPublic

Authored by mgorny on Oct 31 2020, 2:51 AM.

Details

Summary

Fix two bugs that caused attaching to a process in a pre-connected
lldb-server to fail. These are:

  1. Prematurely reporting status in NativeProcessFreeBSD::Attach(). The SetState() call defaulted to notify the process, and LLGS tried to send the stopped packet before the process instance was assigned to it. While at it, add an assert for that in LLGS.
  1. Duplicate call to ReinitializeThreads() (via SetupTrace()) that overwrote the stopped status in threads. Now SetupTrace() is called directly by NativeProcessFreeBSD::Attach() (not the Factory) in place of ReinitializeThreads().

This fixes at least commands/process/attach/TestProcessAttach.py
and python_api/hello_world/TestHelloWorld.py.

Diff Detail

Event Timeline

mgorny created this revision.Oct 31 2020, 2:51 AM
mgorny requested review of this revision.Oct 31 2020, 2:51 AM
krytarowski accepted this revision.Oct 31 2020, 8:12 AM
This revision is now accepted and ready to land.Oct 31 2020, 8:12 AM
labath accepted this revision.Nov 2 2020, 12:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2020, 12:46 AM