Page MenuHomePhabricator

Extract common PlatformPOSIX/Windows code into a separate class

Authored by labath on Feb 11 2019, 7:24 AM.



The two classes contained a lot of duplicated code, but there wasn't a
good place to factor it to. It couldn't be the base Platform class,
since we also have platforms which are only remote (such as
PlatformGDBRemoteServer), and so it did not make sense for those to have
an m_remote_platform member.

This patch creates a new class, RemoteAwarePlatform, which can serve as
a base class for platforms which can both serve as a host, and forward
actions to a remote system. It is motivated partly by D56232 (which was
about to add a bunch of additional duplicated methods), and partly by my
own need to modify a function which happens to be implemented in both
places identically.

The patch moves the methods which are trivially identical in the two
classes into the common base class, there were one or two more methods
which could probably be merged into one, but this wasn't completely
trivial, so I did not attempt to do that now.

Diff Detail


Event Timeline

labath created this revision.Feb 11 2019, 7:24 AM
clayborg accepted this revision.Feb 11 2019, 9:31 AM
This revision is now accepted and ready to land.Feb 11 2019, 9:31 AM
jingham accepted this revision.Feb 11 2019, 11:04 AM


This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2019, 1:27 AM
Herald added a subscriber: jdoerfert. · View Herald Transcript