#include <cerrno>
#include <cstdlib>
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Threading.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Section.h"
#include "lldb/Host/Host.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Target/MemoryRegionInfo.h"
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/AppleUuidCompatibility.h"
#include "lldb/Utility/DataBuffer.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/State.h"
#include "lldb/Utility/UUID.h"
#include "ProcessMachCore.h"
#include "Plugins/Process/Utility/StopInfoMachException.h"
#include "ThreadMachCore.h"
#include "lldb/Host/SafeMachO.h"
#include "Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h"
#include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h"
#include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h"
#include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
#include "Plugins/Platform/MacOSX/PlatformDarwinKernel.h"
#include <memory>
#include <mutex>
usingnamespacelldb;
usingnamespacelldb_private;
LLDB_PLUGIN_DEFINE(…)
llvm::StringRef ProcessMachCore::GetPluginDescriptionStatic() { … }
void ProcessMachCore::Terminate() { … }
lldb::ProcessSP ProcessMachCore::CreateInstance(lldb::TargetSP target_sp,
ListenerSP listener_sp,
const FileSpec *crash_file,
bool can_connect) { … }
bool ProcessMachCore::CanDebug(lldb::TargetSP target_sp,
bool plugin_specified_by_name) { … }
ProcessMachCore::ProcessMachCore(lldb::TargetSP target_sp,
ListenerSP listener_sp,
const FileSpec &core_file)
: … { … }
ProcessMachCore::~ProcessMachCore() { … }
bool ProcessMachCore::CheckAddressForDyldOrKernel(lldb::addr_t addr,
addr_t &dyld,
addr_t &kernel) { … }
void ProcessMachCore::CreateMemoryRegions() { … }
bool ProcessMachCore::LoadBinaryViaLowmemUUID() { … }
bool ProcessMachCore::LoadBinariesViaMetadata() { … }
void ProcessMachCore::LoadBinariesViaExhaustiveSearch() { … }
void ProcessMachCore::LoadBinariesAndSetDYLD() { … }
void ProcessMachCore::CleanupMemoryRegionPermissions() { … }
Status ProcessMachCore::DoLoadCore() { … }
lldb_private::DynamicLoader *ProcessMachCore::GetDynamicLoader() { … }
bool ProcessMachCore::DoUpdateThreadList(ThreadList &old_thread_list,
ThreadList &new_thread_list) { … }
void ProcessMachCore::RefreshStateAfterStop() { … }
Status ProcessMachCore::DoDestroy() { … }
bool ProcessMachCore::IsAlive() { … }
bool ProcessMachCore::WarnBeforeDetach() const { … }
size_t ProcessMachCore::ReadMemory(addr_t addr, void *buf, size_t size,
Status &error) { … }
size_t ProcessMachCore::DoReadMemory(addr_t addr, void *buf, size_t size,
Status &error) { … }
Status ProcessMachCore::DoGetMemoryRegionInfo(addr_t load_addr,
MemoryRegionInfo ®ion_info) { … }
void ProcessMachCore::Clear() { … }
void ProcessMachCore::Initialize() { … }
addr_t ProcessMachCore::GetImageInfoAddress() { … }
lldb_private::ObjectFile *ProcessMachCore::GetCoreObjectFile() { … }