]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/API/SBLaunchInfo.h
Update llvm, clang and lldb to 3.7.0 release.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / API / SBLaunchInfo.h
1 //===-- SBLaunchInfo.h ------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLDB_SBLaunchInfo_h_
11 #define LLDB_SBLaunchInfo_h_
12
13 #include "lldb/API/SBDefines.h"
14
15 namespace lldb {
16
17 class SBPlatform;
18 class SBTarget;
19
20 class LLDB_API SBLaunchInfo
21 {
22 public:
23     SBLaunchInfo (const char **argv);
24
25     ~SBLaunchInfo();
26
27     lldb::pid_t
28     GetProcessID();
29
30     uint32_t
31     GetUserID();
32
33     uint32_t
34     GetGroupID();
35
36     bool
37     UserIDIsValid ();
38
39     bool
40     GroupIDIsValid ();
41
42     void
43     SetUserID (uint32_t uid);
44
45     void
46     SetGroupID (uint32_t gid);
47
48     SBFileSpec
49     GetExecutableFile ();
50
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.
54     ///
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.
61     ///
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.
65     ///
66     /// @param[in] exe_file
67     ///     The override path to use when launching the executable.
68     ///
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
72     ///     alone.
73     //----------------------------------------------------------------------
74     void
75     SetExecutableFile (SBFileSpec exe_file, bool add_as_first_arg);
76
77
78     //----------------------------------------------------------------------
79     /// Get the listener that will be used to receive process events.
80     ///
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     //----------------------------------------------------------------------
86     SBListener
87     GetListener ();
88
89     //----------------------------------------------------------------------
90     /// Set the listener that will be used to receive process events.
91     ///
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     //----------------------------------------------------------------------
96     void
97     SetListener (SBListener &listener);
98
99     uint32_t
100     GetNumArguments ();
101
102     const char *
103     GetArgumentAtIndex (uint32_t idx);
104
105     void
106     SetArguments (const char **argv, bool append);
107
108     uint32_t
109     GetNumEnvironmentEntries ();
110
111     const char *
112     GetEnvironmentEntryAtIndex (uint32_t idx);
113
114     void
115     SetEnvironmentEntries (const char **envp, bool append);
116
117     void
118     Clear ();
119
120     const char *
121     GetWorkingDirectory () const;
122
123     void
124     SetWorkingDirectory (const char *working_dir);
125
126     uint32_t
127     GetLaunchFlags ();
128
129     void
130     SetLaunchFlags (uint32_t flags);
131
132     const char *
133     GetProcessPluginName ();
134
135     void
136     SetProcessPluginName (const char *plugin_name);
137
138     const char *
139     GetShell ();
140
141     void
142     SetShell (const char * path);
143     
144     bool
145     GetShellExpandArguments ();
146     
147     void
148     SetShellExpandArguments (bool glob);
149     
150     uint32_t
151     GetResumeCount ();
152
153     void
154     SetResumeCount (uint32_t c);
155
156     bool
157     AddCloseFileAction (int fd);
158
159     bool
160     AddDuplicateFileAction (int fd, int dup_fd);
161
162     bool
163     AddOpenFileAction (int fd, const char *path, bool read, bool write);
164
165     bool
166     AddSuppressFileAction (int fd, bool read, bool write);
167
168     void
169     SetLaunchEventData (const char *data);
170
171     const char *
172     GetLaunchEventData () const;
173
174     bool
175     GetDetachOnError() const;
176
177     void
178     SetDetachOnError(bool enable);
179
180 protected:
181     friend class SBPlatform;
182     friend class SBTarget;
183
184     lldb_private::ProcessLaunchInfo &
185     ref ();
186
187     const lldb_private::ProcessLaunchInfo &
188     ref () const;
189
190     ProcessLaunchInfoSP m_opaque_sp;
191 };
192
193 } // namespace lldb
194
195 #endif  // LLDB_SBLaunchInfo_h_