hanchenye-llvm-project/lldb/source/Host
Todd Fiala e77fce0a50 [NFC] Darwin llgs support from Week of Code
This code represents the Week of Code work I did on bringing up
lldb-server LLGS support for Darwin.  It does not include the
Xcode project changes needed, as we don't want to throw that switch
until more support is implemented (i.e. this change is inert, no
build systems use it yet.  I've verified on Ubuntu 16.04, macOS
Xcode and macOS cmake builds).

This change does some minimal refactoring of code that is shared
with the Linux LLGS portion, moving it from NativeProcessLinux into
NativeProcessProtocol.  That code is also used by NativeProcessDarwin.

Current state on Darwin:
* Process launching is implemented.  (Attach is not).
  Launching on devices has not yet been tested (FBS/BKS might
  need a bit of work).
* Inferior waitpid monitoring and communication of exit status
  via MainLoop callback is implemented.
* Memory read/write, breakpoints, thread register context, etc.
  are not yet implemented.  This impacts process stop/resume, as
  the initial launch suspended immediately starts the process
  up and running because it doesn't know it is supposed to remain
  stopped.
* I implemented the equivalent of MachThreadList as
  NativeThreadListDarwin, in anticipation that we might want to
  factor out common parts into NativeThreadList{Protocol} and share
  some code here.  After writing it, though, the fallout from merging
  Mach Task/Process into a single concept plus some other minor
  changes makes the whole NativeThreadListDarwin concept nothing more
  than dead weight.  I am likely going to get rid of this class and
  just manage it directly in NativeProcessDarwin, much like I did
  for NativeProcessLinux.
* There is a stub-out call for starting a STDIO thread.  That will
  go away and adopt the MainLoop pselect-based IOObject reading.

I am developing the fully-integrated changes in the following repo,
which contains the necessary Xcode bits and the glue that enables
lldb-debugserver on a macOS system:

  https://github.com/tfiala/lldb/tree/llgs-darwin

This change also breaks out a few of the lldb-server tests into
their own directory, and adds some $qHostInfo tests (not sure why
I didn't write those tests back when I initially implemented that
on the Linux side).

llvm-svn: 280604
2016-09-04 00:18:56 +00:00
..
android Unify process launching code on linux 2016-07-21 14:54:03 +00:00
common [NFC] Darwin llgs support from Week of Code 2016-09-04 00:18:56 +00:00
freebsd Make lldb::endian::InlHostByteOrder() private. 2015-11-07 04:40:13 +00:00
linux Remove Android.h 2016-08-08 12:54:36 +00:00
macosx Garbage collection is not around anymore, we can remove our support for it. 2016-08-08 22:48:57 +00:00
netbsd Remove autoconf support from source directories. 2016-01-28 22:05:24 +00:00
posix Centralize all select() calls into one place so that we can take advantage of system specific optimizations to deal with more file descriptors than FD_SETSIZE on some systems. 2016-08-10 22:43:48 +00:00
windows Delete Host/windows/win32.h 2016-08-09 23:06:08 +00:00
CMakeLists.txt Remove a duplicated block in cmake. 2016-07-28 22:11:54 +00:00