#include "lldb/Host/Host.h"
#include "PosixSpawnResponsible.h"
#include <AvailabilityMacros.h>
#include <TargetConditionals.h>
#include "llvm/TargetParser/Host.h"
#include <asl.h>
#include <cassert>
#include <cerrno>
#include <crt_externs.h>
#include <cstdio>
#include <cstdlib>
#include <dlfcn.h>
#include <grp.h>
#include <libproc.h>
#include <pwd.h>
#include <spawn.h>
#include <sys/proc.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/types.h>
#include <unistd.h>
#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/ProcessLaunchInfo.h"
#include "lldb/Host/ThreadLauncher.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Endian.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/NameMatches.h"
#include "lldb/Utility/ProcessInfo.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/StructuredData.h"
#include "lldb/lldb-defines.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/Support/Errno.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorExtras.h"
#include "llvm/Support/FileSystem.h"
#include "../cfcpp/CFCBundle.h"
#include "../cfcpp/CFCMutableArray.h"
#include "../cfcpp/CFCMutableDictionary.h"
#include "../cfcpp/CFCReleaser.h"
#include "../cfcpp/CFCString.h"
#include <objc/objc-auto.h>
#include <os/log.h>
#include <CoreFoundation/CoreFoundation.h>
#include <Foundation/Foundation.h>
Go to the source code of this file.
◆ _POSIX_SPAWN_DISABLE_ASLR
| #define _POSIX_SPAWN_DISABLE_ASLR 0x0100 |
◆ __pthread_chdir()
| int __pthread_chdir |
( |
const char * | path | ) |
|
◆ __pthread_fchdir()
| int __pthread_fchdir |
( |
int | fildes | ) |
|
◆ AddPosixSpawnFileAction()
Definition at line 1139 of file Host.mm.
References lldb::eErrorTypePOSIX, lldb_private::FileAction::eFileActionClose, lldb_private::FileAction::eFileActionDuplicate, lldb_private::FileAction::eFileActionNone, lldb_private::FileAction::eFileActionOpen, error(), lldb_private::Status::FromErrorString(), lldb_private::FileAction::GetAction(), lldb_private::FileAction::GetActionArgument(), lldb_private::FileAction::GetFD(), lldb_private::FileAction::GetFileSpec(), lldb_private::FileSpec::GetPath(), LLDB_LOG, and lldb_private::Status.
Referenced by LaunchProcessPosixSpawn().
◆ finalize_xpc()
| void finalize_xpc |
( |
void * | xpc_object | ) |
|
|
static |
◆ GetMacOSXProcessArgs()
Definition at line 576 of file Host.mm.
References lldb_private::Args::AppendArgument(), lldb_private::ProcessInfo::GetArchitecture(), lldb_private::ProcessInfo::GetArguments(), lldb_private::WritableDataBuffer::GetBytes(), lldb_private::DataBufferHeap::GetByteSize(), lldb_private::DataExtractor::GetCStr(), lldb_private::ConstString::GetCString(), lldb_private::ProcessInfo::GetEnvironment(), lldb_private::ProcessInfo::GetExecutableFile(), lldb_private::FileSpec::GetFilename(), lldb_private::ProcessInfo::GetName(), lldb_private::ProcessInstanceInfoMatch::GetNameMatchType(), lldb_private::ProcessInfo::GetProcessID(), lldb_private::ProcessInstanceInfoMatch::GetProcessInfo(), lldb_private::ArchSpec::GetTriple(), lldb_private::DataExtractor::GetU32(), lldb_private::endian::InlHostByteOrder(), lldb_private::Environment::insert(), lldb_private::NameMatches(), lldb_private::DataExtractor::PeekData(), lldb_private::ProcessInfo::ProcessIDIsValid(), lldb_private::ProcessInfo::SetArg0(), and lldb_private::FileSpec::SetFile().
◆ GetMacOSXProcessCPUType()
◆ GetMacOSXProcessUserAndGroup()
◆ GetPosixspawnFlags()
◆ GetProcessList()
| llvm::Error GetProcessList |
( |
std::vector< struct kinfo_proc > & | kinfos | ) |
|
|
static |
Fetches the list of all processes into kinfos.
Definition at line 692 of file Host.mm.
◆ LaunchProcessPosixSpawn()
Definition at line 1225 of file Host.mm.
References __pthread_chdir(), __pthread_fchdir(), AddPosixSpawnFileAction(), CPU_SUBTYPE_X86_64_H, lldb::eErrorTypePOSIX, error(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::Environment::Envp::get(), lldb_private::ProcessInfo::GetArchitecture(), lldb_private::ProcessInfo::GetArguments(), lldb_private::ProcessInfo::GetEnvironment(), lldb_private::Environment::getEnvp(), lldb_private::ProcessLaunchInfo::GetFileActionAtIndex(), lldb_private::ProcessLaunchInfo::GetFlags(), lldb_private::GetLog(), lldb_private::ArchSpec::GetMachOCPUSubType(), lldb_private::ArchSpec::GetMachOCPUType(), lldb_private::ProcessLaunchInfo::GetNumFileActions(), lldb_private::FileSpec::GetPath(), GetPosixspawnFlags(), lldb_private::ProcessLaunchInfo::GetShell(), lldb_private::ProcessLaunchInfo::GetWorkingDirectory(), lldb_private::Host, LLDB_INVALID_CPUTYPE, LLDB_INVALID_PROCESS_ID, LLDB_LOG, lldb_private::Process, setup_posix_spawn_responsible_flag(), lldb_private::Status, lldb_private::Flags::Test(), and UINT32_MAX.
◆ LaunchProcessXPC()
Definition at line 993 of file Host.mm.
References lldb::eErrorTypeGeneric, error(), finalize_xpc(), lldb_private::Status::FromErrorStringWithFormat(), lldb_private::ProcessInfo::GetArchitecture(), lldb_private::ProcessInfo::GetArguments(), lldb_private::ProcessInfo::GetEnvironment(), lldb_private::ProcessLaunchInfo::GetFileActionForFD(), lldb_private::FileAction::GetFileSpec(), lldb_private::GetLog(), lldb_private::ArchSpec::GetMachOCPUType(), lldb_private::FileSpec::GetPath(), GetPosixspawnFlags(), lldb_private::ProcessInfo::GetUserID(), lldb_private::Host, LLDB_LOG, lldb_private::Process, and lldb_private::Status.
◆ ShouldLaunchUsingXPC()
◆ g_os_log
◆ g_os_log_once
| std::once_flag g_os_log_once |
|
static |