This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Always call DestroyImpl from Process::Finalize
ClosedPublic

Authored by JDevlieghere on Jul 14 2021, 11:35 AM.

Details

Summary

Always destroy the process, regardless of its private state. This will call the virtual function DoDestroy under the hood, giving our derived class a chance to do the necessary tear down, including what to do when the private state is eStateExited.

Diff Detail

Event Timeline

JDevlieghere requested review of this revision.Jul 14 2021, 11:35 AM
JDevlieghere created this revision.
jingham accepted this revision.Jul 14 2021, 1:18 PM

This seems better to me. It's a little odd that the Process was short-cutting DoDestroy for these states. How can it know that one of the plugins might not need to handle that case? As an object lesson, that's true of eStateInvalid, which is the state you return with in the ProcessGDBRemote case when interrupting the stub fails, and that definitely needs cleanup.

Looks like the Windows plugin handles these cases already anyway, so this should be good.

This revision is now accepted and ready to land.Jul 14 2021, 1:18 PM
This revision was landed with ongoing or failed builds.Jul 14 2021, 1:36 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2021, 1:36 PM