1 //===-- SBLaunchInfo.h ------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_SBLaunchInfo_h_
11 #define LLDB_SBLaunchInfo_h_
13 #include "lldb/API/SBDefines.h"
20 class LLDB_API SBLaunchInfo
23 SBLaunchInfo (const char **argv);
43 SetUserID (uint32_t uid);
46 SetGroupID (uint32_t gid);
51 //----------------------------------------------------------------------
52 /// Set the executable file that will be used to launch the process and
53 /// optionally set it as the first argument in the argument vector.
55 /// This only needs to be specified if clients wish to carefully control
56 /// the exact path will be used to launch a binary. If you create a
57 /// target with a symlink, that symlink will get resolved in the target
58 /// and the resolved path will get used to launch the process. Calling
59 /// this function can help you still launch your process using the
60 /// path of your choice.
62 /// If this function is not called prior to launching with
63 /// SBTarget::Launch(...), the target will use the resolved executable
64 /// path that was used to create the target.
66 /// @param[in] exe_file
67 /// The override path to use when launching the executable.
69 /// @param[in] add_as_first_arg
70 /// If true, then the path will be inserted into the argument vector
71 /// prior to launching. Otherwise the argument vector will be left
73 //----------------------------------------------------------------------
75 SetExecutableFile (SBFileSpec exe_file, bool add_as_first_arg);
78 //----------------------------------------------------------------------
79 /// Get the listener that will be used to receive process events.
81 /// If no listener has been set via a call to
82 /// SBLaunchInfo::SetListener(), then an invalid SBListener will be
83 /// returned (SBListener::IsValid() will return false). If a listener
84 /// has been set, then the valid listener object will be returned.
85 //----------------------------------------------------------------------
89 //----------------------------------------------------------------------
90 /// Set the listener that will be used to receive process events.
92 /// By default the SBDebugger, which has a listener, that the SBTarget
93 /// belongs to will listen for the process events. Calling this function
94 /// allows a different listener to be used to listen for process events.
95 //----------------------------------------------------------------------
97 SetListener (SBListener &listener);
103 GetArgumentAtIndex (uint32_t idx);
106 SetArguments (const char **argv, bool append);
109 GetNumEnvironmentEntries ();
112 GetEnvironmentEntryAtIndex (uint32_t idx);
115 SetEnvironmentEntries (const char **envp, bool append);
121 GetWorkingDirectory () const;
124 SetWorkingDirectory (const char *working_dir);
130 SetLaunchFlags (uint32_t flags);
133 GetProcessPluginName ();
136 SetProcessPluginName (const char *plugin_name);
142 SetShell (const char * path);
145 GetShellExpandArguments ();
148 SetShellExpandArguments (bool glob);
154 SetResumeCount (uint32_t c);
157 AddCloseFileAction (int fd);
160 AddDuplicateFileAction (int fd, int dup_fd);
163 AddOpenFileAction (int fd, const char *path, bool read, bool write);
166 AddSuppressFileAction (int fd, bool read, bool write);
169 SetLaunchEventData (const char *data);
172 GetLaunchEventData () const;
175 GetDetachOnError() const;
178 SetDetachOnError(bool enable);
181 friend class SBPlatform;
182 friend class SBTarget;
184 lldb_private::ProcessLaunchInfo &
187 const lldb_private::ProcessLaunchInfo &
190 ProcessLaunchInfoSP m_opaque_sp;
195 #endif // LLDB_SBLaunchInfo_h_