This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Duplicate Target::Launch resuming logic into CommandObjectPlatformProcessLaunch
ClosedPublic

Authored by kastiglione on Jun 27 2023, 2:27 PM.

Details

Summary

Fix platform process launch on macOS where it fails for lack of auto-resuming support.

This change reproduces the resuming logic found in Target::Launch.

This issue was identified by @DavidSpickett in D153636. This change relies on the tests
added in that PR. Thanks David.

Diff Detail

Event Timeline

kastiglione created this revision.Jun 27 2023, 2:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2023, 2:27 PM
kastiglione requested review of this revision.Jun 27 2023, 2:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2023, 2:27 PM
jingham accepted this revision.Jun 27 2023, 2:40 PM

The fact that you had to duplicate code from Target::Launch means the various paths to Launching a process aren't properly factored out. However, that seems like a lot just to get Dave's fix for "platform process launch" working, so this LGTM as a short-term patch.

This revision is now accepted and ready to land.Jun 27 2023, 2:40 PM
DavidSpickett added inline comments.Jun 28 2023, 1:40 AM
lldb/source/Commands/CommandObjectPlatform.cpp
1232

This assert fails on Linux. Is it necessary or should I look into why it's null here on Linux?

WaitForProcessToStop on down either checks that the pointer is non null before use, or substitutes in another (presumably non-null) hijacker.

Thanks for testing and fixing this.

DavidSpickett added inline comments.Jun 28 2023, 1:43 AM
lldb/source/Commands/CommandObjectPlatform.cpp
1232

To clarify, fails while running the tests in https://reviews.llvm.org/D153636.

kastiglione added inline comments.Jun 28 2023, 1:14 PM
lldb/source/Commands/CommandObjectPlatform.cpp
1232

I included it to follow (copy) Target::Launch. I don't know for fact that it's needed, so +1 to removing the assert if needed for Linux.