[Lldb-commits] [PATCH] Move FileSystem functions from Host to their own class

Zachary Turner zturner at google.com
Wed Aug 13 13:29:49 PDT 2014


As part of an effort to make Host not be such a monolithic, catch-all class, this patch moves file system logic out of Host and into a smaller, more appropriate class, which is also in the Host layer.  More specifically, this patch makes the following changes:

1) Creates an lldbHostPosix library which can is useful for containing code which can compile and link on any posix-compliant platform
2) Creates Host/FileSystem.h which defines a common file system interface
3) Implements FileSystem.h in Host/windows/FileSystem.cpp and Host/posix/FileSystem.cpp
4) Creates Host/FileCache.h and Host/common/FileCache.cpp, which defines a class useful for storing handles to open files needed by the debugger

Tested on Windows and Linux using CMake.  There are probably outstanding issues with the Mac build, as I don't have that setup yet.  In particular, Mac build will need to create the lldbHostPosix library, link against it, and add the new files to the Xcode project.

http://reviews.llvm.org/D4889

Files:
  include/lldb/Host/FileCache.h
  include/lldb/Host/FileSystem.h
  include/lldb/Host/Host.h
  include/lldb/Target/FileAction.h
  source/CMakeLists.txt
  source/Host/CMakeLists.txt
  source/Host/common/CMakeLists.txt
  source/Host/common/FileCache.cpp
  source/Host/common/FileSpec.cpp
  source/Host/common/Host.cpp
  source/Host/common/Socket.cpp
  source/Host/posix/CMakeLists.txt
  source/Host/posix/FileSystem.cpp
  source/Host/windows/CMakeLists.txt
  source/Host/windows/FileSystem.cpp
  source/Host/windows/Host.cpp
  source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
  source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
  source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
  source/Plugins/Process/Linux/NativeProcessLinux.cpp
  source/Plugins/Process/POSIX/ProcessPOSIX.cpp
  source/Plugins/Process/POSIX/ProcessPOSIX.h
  source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  source/Target/FileAction.cpp
  source/Target/Platform.cpp
  source/Target/Process.cpp
  source/Target/ProcessLaunchInfo.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4889.12467.patch
Type: text/x-patch
Size: 62192 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140813/f56b6f1e/attachment.bin>


More information about the lldb-commits mailing list