This is an archive of the discontinued LLVM Phabricator instance.

Restore process events after a launch that stopped at the entry point
ClosedPublic

Authored by jingham on Oct 28 2021, 12:23 PM.

Details

Summary

We found a bug introduced by changes for the ScriptedProcess. It only manifests itself is you run a process with stop-at-entry set to true and when you are using an async debugger and when you are using a remote process. The solution is trivial. The majority of the patch is a test for stop-at-entry in the four cases of "sync & async" debugger crossed with "remote or local" process. The test both tests that stop-at-entry really does stop at entry, and then tests that we can resume afterwards.

I wrote the test for darwin because I don't know how to assert that we successfully stopped at entry on Linux or Windows. If someone more familiar with those platforms wants to extend the test to either of those hosts, it should be straightforward.

Diff Detail

Event Timeline

jingham requested review of this revision.Oct 28 2021, 12:23 PM
jingham created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2021, 12:23 PM
mib accepted this revision.Oct 28 2021, 3:41 PM

LGTM besides some minor things. Thanks for fixing this @jingham !

lldb/test/API/functionalities/launch_stop_at_entry/TestStopAtEntry.py
86

Did you forget to remove these comments or did you leave them on purpose ?

90

This comment doesn't match the following condition

135

As you mentioned in the FIXME above, this should be a cleanup (similarly to what TestPlatformSDK.py does)

This revision is now accepted and ready to land.Oct 28 2021, 3:41 PM
jingham updated this revision to Diff 383184.Oct 28 2021, 3:53 PM

Address Ismail's comments.

jingham marked 3 inline comments as done.Oct 28 2021, 3:53 PM

Thanks for pointing these out.

clayborg added inline comments.Oct 28 2021, 4:18 PM
lldb/test/API/functionalities/launch_stop_at_entry/TestStopAtEntry.py
22

This hard coded port worries me for buildbot flakiness. Do other tests do this?

jingham added inline comments.Oct 28 2021, 4:19 PM
lldb/test/API/functionalities/launch_stop_at_entry/TestStopAtEntry.py
22

The test I copied it from does...

jingham added inline comments.Oct 28 2021, 4:23 PM
lldb/test/API/functionalities/launch_stop_at_entry/TestStopAtEntry.py
22

That is "TestPlatformSDK.py". I didn't centralize that logic because the two uses were different, and the implementation is not very many lines. If we see flakiness in either of these tests we can centralize this logic and handle the port fetching better. But I'd rather not do that as part of this patch.

clayborg accepted this revision.Oct 28 2021, 4:30 PM

ok, lgtm