[Lldb-commits] [PATCH] D20106: Generalize child process monitoring functions

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue May 10 08:28:01 PDT 2016


labath created this revision.
labath added reviewers: clayborg, zturner, emaste, krytarowski.
labath added a subscriber: lldb-commits.

This replaces the C-style "void *" baton of the child process monitoring functions with a more
C++-like API taking a std::function. The motivation for this was that it was very difficult to
handle the ownership of the object passed into the callback function -- each caller ended up
implementing his own way of doing it, some doing it better than others. With the new API, one can
just pass a smart pointer into the callback and all of the lifetime management will be handled
automatically.

This has enabled me to simplify the rather complicated handshake in Host::RunShellCommand. I have
left handling of MonitorDebugServerProcess (my original motivation for this change) to a separate
commit to reduce the scope of this change.

http://reviews.llvm.org/D20106

Files:
  include/lldb/Host/Host.h
  include/lldb/Host/HostNativeProcessBase.h
  include/lldb/Host/HostProcess.h
  include/lldb/Host/posix/HostProcessPosix.h
  include/lldb/Target/Process.h
  include/lldb/Target/ProcessLaunchInfo.h
  source/Host/common/Host.cpp
  source/Host/common/HostProcess.cpp
  source/Host/common/MonitoringProcessLauncher.cpp
  source/Host/posix/HostProcessPosix.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
  source/Target/Process.cpp
  source/Target/ProcessLaunchInfo.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20106.56721.patch
Type: text/x-patch
Size: 24826 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160510/28722951/attachment-0001.bin>


More information about the lldb-commits mailing list