16#include "llvm/ADT/SmallString.h"
50 s <<
"Executable: " <<
GetName() <<
"\n";
62 bool add_exe_file_as_first_arg) {
65 if (add_exe_file_as_first_arg) {
66 llvm::SmallString<128> filename;
68 if (!filename.empty())
81 bool first_arg_is_executable) {
85 if (first_arg_is_executable) {
86 const char *first_arg =
m_arguments.GetArgumentAtIndex(0);
91 m_executable.SetFile(first_arg, FileSpec::Style::native);
101 if (first_arg_is_executable) {
102 const char *first_arg =
m_arguments.GetArgumentAtIndex(0);
107 m_executable.SetFile(first_arg, FileSpec::Style::native);
129 const uint32_t argc =
m_arguments.GetArgumentCount();
131 for (uint32_t i = 0; i < argc; i++) {
132 const char *arg =
m_arguments.GetArgumentAtIndex(i);
134 s.
Printf(
" arg[%u] = %s\n", i, arg);
136 s.
Printf(
"arg[%u] = %s\n", i, arg);
169 if (show_args || verbose)
175 s.
Printf(
"PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE "
179 "====== ====== ========== ========== ========== ========== "
180 "============================== ============================\n");
182 s.
Printf(
"PID PARENT USER TRIPLE %s\n",
184 s.
PutCString(
"====== ====== ========== ============================== "
185 "============================\n");
190 bool show_args,
bool verbose)
const {
203 const char *format =
"{0,-10} ";
204 if (!(this->*isValid)()) {
208 uint32_t
id = (this->*getID)();
209 if (
auto name = (resolver.*getName)(
id))
234 if (verbose || show_args) {
236 const uint32_t argc =
m_arguments.GetArgumentCount();
237 for (uint32_t i = 0; i < argc; i++) {
252 m_match_info.GetArchitecture().IsCompatibleMatch(arch_spec);
259 if (match_name.empty())
An architecture specification class.
A command line argument class.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
void SetExecutableFile(const FileSpec &exe_file, bool add_exe_file_as_first_arg)
Environment m_environment
lldb::ScriptedMetadataSP m_scripted_metadata_sp
void SetArg0(llvm::StringRef arg)
void Dump(Stream &s, Platform *platform) const
lldb::pid_t GetProcessID() const
llvm::StringRef GetArg0() const
lldb::ListenerSP m_hijack_listener_sp
void SetArguments(const Args &args, bool first_arg_is_executable)
lldb::ListenerSP m_listener_sp
llvm::StringRef GetName() const
bool UserIDIsValid() const
uint32_t GetUserID() const
uint32_t GetGroupID() const
bool IsScriptedProcess() const
bool GroupIDIsValid() const
ArchSpec & GetArchitecture()
lldb::ListenerSP m_shadow_listener_sp
bool MatchAllProcesses() const
NameMatch m_name_match_type
bool NameMatches(llvm::StringRef process_name) const
Return true iff the process name in this object matches process_name.
bool Matches(const ProcessInstanceInfo &proc_info) const
bool ProcessIDsMatch(const ProcessInstanceInfo &proc_info) const
Return true iff the process ID and parent process IDs in this object match the ones in proc_info.
ProcessInstanceInfo m_match_info
bool UserIDsMatch(const ProcessInstanceInfo &proc_info) const
Return true iff the (both effective and real) user and group IDs in this object match the ones in pro...
bool ArchitectureMatches(const ArchSpec &arch_spec) const
Return true iff the architecture in this object matches arch_spec.
uint32_t GetEffectiveUserID() const
static void DumpTableHeader(Stream &s, bool show_args, bool verbose)
lldb::pid_t GetParentProcessID() const
bool ParentProcessIDIsValid() const
uint32_t GetEffectiveGroupID() const
bool EffectiveUserIDIsValid() const
bool EffectiveGroupIDIsValid() const
void Dump(Stream &s, UserIDResolver &resolver) const
ProcessInstanceInfo()=default
void DumpAsTableRow(Stream &s, UserIDResolver &resolver, bool show_args, bool verbose) const
const char * GetData() const
A stream class that can stream formatted output to a file.
void Format(const char *format, Args &&... args)
Forwards the arguments to llvm::formatv and writes to the stream.
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
size_t EOL()
Output and End of Line character to the stream.
An abstract interface for things that know how to map numeric user/group IDs into names.
std::optional< llvm::StringRef > GetGroupName(id_t gid)
std::optional< llvm::StringRef > GetUserName(id_t uid)
#define LLDB_INVALID_PROCESS_ID
A class that represents a running process on the host machine.
bool NameMatches(llvm::StringRef name, NameMatch match_type, llvm::StringRef match)