[Lldb-commits] [PATCH] D34236: Delete ProcessLauncherPosix

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 15 06:25:58 PDT 2017


labath created this revision.
Herald added subscribers: mgorny, srhines.

ProcessLauncherPosix was using posix_spawn for launching the process,
but this function is not available on all platforms we support, and even
where it was avaialable, it did not support the full range of options we
require for launching (most importantly, launching in stop-on-entry
mode). For these reasons, the set of ifdefs around these functions has
grown untractably large, and we were forced to implement our own
launcher from more basic primitives anyway (ProcessLauncherPosixFork --
used on Linux, Android, and NetBSD).

Therefore, I remove this class, and move the relevant parts of the code
to the darwin-specific Host.mm file. This is the platform that code was
originally written for anyway, and it's the only platform where this
implementation makes sense (e.g. the lack of the "thread-specific
working directory" concept makes these functions racy on all other
platforms). This allows us to remove a lot of ifdefs and simplify the
code.

Effectively, the only change this introduces is that FreeBSD will now
use the fork-based launcher instead of posix_spawnp. That sholdn't be a
problem as this approach works at least on one other BSD-based system
already.


https://reviews.llvm.org/D34236

Files:
  include/lldb/Host/Host.h
  include/lldb/Host/posix/ProcessLauncherPosix.h
  source/Host/CMakeLists.txt
  source/Host/common/Host.cpp
  source/Host/macosx/Host.mm
  source/Host/posix/ProcessLauncherPosix.cpp
  unittests/tools/lldb-server/tests/TestClient.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34236.102667.patch
Type: text/x-patch
Size: 30748 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170615/1d8fe98b/attachment-0001.bin>


More information about the lldb-commits mailing list