This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Move host platform implementations into the base class
ClosedPublic

Authored by labath on Apr 1 2022, 5:46 AM.

Details

Summary

About half of our host platform code was implemented in the Platform
class, while the rest was it RemoteAwarePlatform. Most of the time, this
did not matter, as nearly all our platforms are also
RemoteAwarePlatforms. It makes a difference for PlatformQemu, which
descends directly from the base class (as it is local-only).

This patch moves all host code paths into the base class, and marks
PlatformQemu as a "host" platform so it can make use of them (it sounds
slightly strange, but that is consistent with what the apple simulator
platforms are doing). Not all of the host implementations make sense for
this platform, but it can always override those that don't.

I add some basic tests using the platform file apis to exercise this
functionality.

Diff Detail

Event Timeline

labath created this revision.Apr 1 2022, 5:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 1 2022, 5:46 AM
labath requested review of this revision.Apr 1 2022, 5:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 1 2022, 5:46 AM
This revision is now accepted and ready to land.Apr 1 2022, 9:32 AM