1 //===-- ProcessInfo.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 liblldb_ProcessInfo_h_
11 #define liblldb_ProcessInfo_h_
14 #include "lldb/Core/ArchSpec.h"
15 #include "lldb/Host/FileSpec.h"
16 #include "lldb/Interpreter/Args.h"
18 namespace lldb_private
20 //----------------------------------------------------------------------
23 // A base class for information for a process. This can be used to fill
24 // out information for a process prior to launching it, or it can be
25 // used for an instance of a process and can be filled in with the
26 // existing values for that process.
27 //----------------------------------------------------------------------
33 ProcessInfo (const char *name,
44 GetNameLength() const;
53 SetExecutableFile (const FileSpec &exe_file, bool add_exe_file_as_first_arg);
56 GetExecutableFile () const
74 UserIDIsValid () const
76 return m_uid != UINT32_MAX;
80 GroupIDIsValid () const
82 return m_gid != UINT32_MAX;
86 SetUserID (uint32_t uid)
92 SetGroupID (uint32_t gid)
104 GetArchitecture () const
110 SetArchitecture (const ArchSpec& arch)
116 GetProcessID () const
122 SetProcessID (lldb::pid_t pid)
128 ProcessIDIsValid() const
130 return m_pid != LLDB_INVALID_PROCESS_ID;
134 Dump (Stream &s, Platform *platform) const;
143 GetArguments () const
152 SetArg0 (const char *arg);
155 SetArguments (const Args& args, bool first_arg_is_executable);
158 SetArguments (char const **argv, bool first_arg_is_executable);
161 GetEnvironmentEntries ()
163 return m_environment;
167 GetEnvironmentEntries () const
169 return m_environment;
173 FileSpec m_executable;
174 std::string m_arg0; // argv[0] if supported. If empty, then use m_executable.
175 // Not all process plug-ins support specifying an argv[0]
176 // that differs from the resolved platform executable
177 // (which is in m_executable)
178 Args m_arguments; // All program arguments except argv[0]
187 #endif // #ifndef liblldb_ProcessInfo_h_