[NPL] Simplify process launch code
Summary:
This removes one level of indirection, which was just packing and repacking launch args into
different structures. NFC.
Reviewers: tberghammer
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D22357
llvm-svn: 275544
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
index d00b9c8..d5be06f 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
@@ -149,47 +149,14 @@
// the relevan breakpoint
std::map<lldb::tid_t, lldb::addr_t> m_threads_stepping_with_breakpoint;
- /// @class LauchArgs
- ///
- /// @brief Simple structure to pass data to the thread responsible for
- /// launching a child process.
- struct LaunchArgs
- {
- LaunchArgs(char const **argv, char const **envp, const FileSpec &stdin_file_spec,
- const FileSpec &stdout_file_spec, const FileSpec &stderr_file_spec, const FileSpec &working_dir,
- const ProcessLaunchInfo &launch_info);
-
- ~LaunchArgs();
-
- char const **m_argv; // Process arguments.
- char const **m_envp; // Process environment.
- const FileSpec m_stdin_file_spec; // Redirect stdin if not empty.
- const FileSpec m_stdout_file_spec; // Redirect stdout if not empty.
- const FileSpec m_stderr_file_spec; // Redirect stderr if not empty.
- const FileSpec m_working_dir; // Working directory or empty.
- const ProcessLaunchInfo &m_launch_info;
- };
-
- typedef std::function< ::pid_t(Error &)> InitialOperation;
// ---------------------------------------------------------------------
// Private Instance Methods
// ---------------------------------------------------------------------
NativeProcessLinux ();
- /// Launches an inferior process ready for debugging. Forms the
- /// implementation of Process::DoLaunch.
- void
- LaunchInferior (
- MainLoop &mainloop,
- char const *argv[],
- char const *envp[],
- const FileSpec &stdin_file_spec,
- const FileSpec &stdout_file_spec,
- const FileSpec &stderr_file_spec,
- const FileSpec &working_dir,
- const ProcessLaunchInfo &launch_info,
- Error &error);
+ Error
+ LaunchInferior(MainLoop &mainloop, ProcessLaunchInfo &launch_info);
/// Attaches to an existing process. Forms the
/// implementation of Process::DoAttach
@@ -197,13 +164,10 @@
AttachToInferior (MainLoop &mainloop, lldb::pid_t pid, Error &error);
::pid_t
- Launch(LaunchArgs *args, Error &error);
-
- ::pid_t
Attach(lldb::pid_t pid, Error &error);
static void
- ChildFunc(const LaunchArgs &args) LLVM_ATTRIBUTE_NORETURN;
+ ChildFunc(const ProcessLaunchInfo &launch_info) LLVM_ATTRIBUTE_NORETURN;
static Error
SetDefaultPtraceOpts(const lldb::pid_t);