diff options
| author | Pavel Labath <labath@google.com> | 2016-07-15 10:18:15 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2016-07-15 10:18:15 +0000 |
| commit | 4abe5d69ea2828b9afca49b47442515dea98211a (patch) | |
| tree | e5b4825b1de8ca2b8b84ff4c0a4381073c3d28c4 /lldb/source/Plugins/Process/Linux/NativeProcessLinux.h | |
| parent | 2683ad54ad0cd5b12db99395a72498f8af92fd45 (diff) | |
| download | llvm-4abe5d69ea2828b9afca49b47442515dea98211a.zip llvm-4abe5d69ea2828b9afca49b47442515dea98211a.tar.gz llvm-4abe5d69ea2828b9afca49b47442515dea98211a.tar.bz2 | |
[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
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.h')
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeProcessLinux.h | 42 |
1 files changed, 3 insertions, 39 deletions
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 @@ namespace process_linux { // 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 @@ namespace process_linux { 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); |
