[Lldb-commits] [PATCH] D58052: Extract common PlatformPOSIX/Windows code into a separate class

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 11 07:26:11 PST 2019


labath created this revision.
labath added reviewers: jingham, zturner, clayborg, asmith.
Herald added subscribers: mgorny, emaste.

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 <https://reviews.llvm.org/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.


https://reviews.llvm.org/D58052

Files:
  include/lldb/Target/RemoteAwarePlatform.h
  source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
  source/Plugins/Platform/POSIX/PlatformPOSIX.h
  source/Plugins/Platform/Windows/PlatformWindows.cpp
  source/Plugins/Platform/Windows/PlatformWindows.h
  source/Target/CMakeLists.txt
  source/Target/RemoteAwarePlatform.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58052.186258.patch
Type: text/x-patch
Size: 26277 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190211/aa596924/attachment-0001.bin>


More information about the lldb-commits mailing list