[Lldb-commits] [PATCH] Implement ProcessLauncherWindows, and refactor some other code to be more modular.

Zachary Turner zturner at google.com
Tue Oct 14 12:45:08 PDT 2014


Hi clayborg, jingham,

This implements Host::LaunchProcess for windows, and in doing so does some minor refactor to move towards a more modular process launching design, as discussed in detail previously on the list.

The original motivation for this is that launching processes on windows needs some very windows specific code, which would live most appropriately in source/Host/windows somewhere.  However, there is already some common code that all platforms use when launching a process before delegating to the platform specific stuff, which lives in source/Host/common/Host.cpp which would be nice to reuse without duplicating.  

This commonality has been abstracted into MonitoringProcessLauncher, a class which abstracts out the notion of launching a process using an arbitrary algorithm, and then monitoring it for state changes.  

The windows specific launching code lives in ProcessLauncherWindows, and the posix specific launching code lives in ProcessLauncherPosix.  after the refactor, a MonitoringProcessLauncher is created, and then an appropriate delegate launcher is created and given to the MonitoringProcessLauncher.

Comments have been inserted to indicate future places for cleanup, so that this refactor can happen iteratively instead as one massive risky CL.

Tested on Windows, MacOSX, and Linux.  Did not see any test regressions.

http://reviews.llvm.org/D5781

Files:
  include/lldb/Host/Host.h
  include/lldb/Host/HostNativeProcessBase.h
  include/lldb/Host/HostProcess.h
  include/lldb/Host/MonitoringProcessLauncher.h
  include/lldb/Host/ProcessLauncher.h
  include/lldb/Host/posix/HostProcessPosix.h
  include/lldb/Host/posix/ProcessLauncherPosix.h
  include/lldb/Host/windows/HostProcessWindows.h
  include/lldb/Host/windows/ProcessLauncherWindows.h
  include/lldb/Target/ProcessLaunchInfo.h
  include/lldb/lldb-defines.h
  include/lldb/lldb-types.h
  source/Host/CMakeLists.txt
  source/Host/common/Host.cpp
  source/Host/common/HostProcess.cpp
  source/Host/common/MonitoringProcessLauncher.cpp
  source/Host/macosx/Host.mm
  source/Host/posix/HostProcessPosix.cpp
  source/Host/posix/ProcessLauncherPosix.cpp
  source/Host/windows/Host.cpp
  source/Host/windows/HostProcessWindows.cpp
  source/Host/windows/ProcessLauncherWindows.cpp
  source/Plugins/Process/Windows/ProcessWindows.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5781.14880.patch
Type: text/x-patch
Size: 35977 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20141014/2fbcd01d/attachment.bin>


More information about the lldb-commits mailing list