#include <cerrno>
#include <cstdio>
#include <cstring>
#include <dirent.h>
#include <fcntl.h>
#include <optional>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <unistd.h>
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Object/ELF.h"
#include "llvm/Support/ScopedPrinter.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/ProcessInfo.h"
#include "lldb/Utility/Status.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/linux/Host.h"
#include "lldb/Host/linux/Support.h"
#include "lldb/Utility/DataExtractor.h"
usingnamespacelldb;
usingnamespacelldb_private;
namespace {
enum class ProcessState { … };
struct StatFields { … };
}
namespace lldb_private {
class ProcessLaunchInfo;
}
static bool GetStatusInfo(::pid_t Pid, ProcessInstanceInfo &ProcessInfo,
ProcessState &State, ::pid_t &TracerPid,
::pid_t &Tgid) { … }
static bool IsDirNumeric(const char *dname) { … }
static ArchSpec GetELFProcessCPUType(llvm::StringRef exe_path) { … }
static void GetProcessArgs(::pid_t pid, ProcessInstanceInfo &process_info) { … }
static void GetExePathAndArch(::pid_t pid, ProcessInstanceInfo &process_info) { … }
static void GetProcessEnviron(::pid_t pid, ProcessInstanceInfo &process_info) { … }
static bool GetProcessAndStatInfo(::pid_t pid,
ProcessInstanceInfo &process_info,
ProcessState &State, ::pid_t &tracerpid) { … }
uint32_t Host::FindProcessesImpl(const ProcessInstanceInfoMatch &match_info,
ProcessInstanceInfoList &process_infos) { … }
bool Host::FindProcessThreads(const lldb::pid_t pid, TidMap &tids_to_attach) { … }
bool Host::GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &process_info) { … }
Environment Host::GetEnvironment() { … }
Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) { … }
std::optional<lldb::pid_t> lldb_private::getPIDForTID(lldb::pid_t tid) { … }