#include <cstdlib>
#include <memory>
#include <mutex>
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Section.h"
#include "lldb/Target/ABI.h"
#include "lldb/Target/DynamicLoader.h"
#include "lldb/Target/MemoryRegionInfo.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/UnixSignals.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/State.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/Support/Threading.h"
#include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h"
#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
#include "Plugins/Process/elf-core/RegisterUtilities.h"
#include "ProcessElfCore.h"
#include "ThreadElfCore.h"
usingnamespacelldb_private;
ELF;
LLDB_PLUGIN_DEFINE(…)
llvm::StringRef ProcessElfCore::GetPluginDescriptionStatic() { … }
void ProcessElfCore::Terminate() { … }
lldb::ProcessSP ProcessElfCore::CreateInstance(lldb::TargetSP target_sp,
lldb::ListenerSP listener_sp,
const FileSpec *crash_file,
bool can_connect) { … }
bool ProcessElfCore::CanDebug(lldb::TargetSP target_sp,
bool plugin_specified_by_name) { … }
ProcessElfCore::ProcessElfCore(lldb::TargetSP target_sp,
lldb::ListenerSP listener_sp,
const FileSpec &core_file)
: … { … }
ProcessElfCore::~ProcessElfCore() { … }
lldb::addr_t ProcessElfCore::AddAddressRangeFromLoadSegment(
const elf::ELFProgramHeader &header) { … }
lldb::addr_t ProcessElfCore::AddAddressRangeFromMemoryTagSegment(
const elf::ELFProgramHeader &header) { … }
Status ProcessElfCore::DoLoadCore() { … }
void ProcessElfCore::UpdateBuildIdForNTFileEntries() { … }
lldb_private::DynamicLoader *ProcessElfCore::GetDynamicLoader() { … }
bool ProcessElfCore::DoUpdateThreadList(ThreadList &old_thread_list,
ThreadList &new_thread_list) { … }
void ProcessElfCore::RefreshStateAfterStop() { … }
Status ProcessElfCore::DoDestroy() { … }
bool ProcessElfCore::IsAlive() { … }
size_t ProcessElfCore::ReadMemory(lldb::addr_t addr, void *buf, size_t size,
Status &error) { … }
Status ProcessElfCore::DoGetMemoryRegionInfo(lldb::addr_t load_addr,
MemoryRegionInfo ®ion_info) { … }
size_t ProcessElfCore::DoReadMemory(lldb::addr_t addr, void *buf, size_t size,
Status &error) { … }
llvm::Expected<std::vector<lldb::addr_t>>
ProcessElfCore::ReadMemoryTags(lldb::addr_t addr, size_t len) { … }
void ProcessElfCore::Clear() { … }
void ProcessElfCore::Initialize() { … }
lldb::addr_t ProcessElfCore::GetImageInfoAddress() { … }
static void ParseFreeBSDPrStatus(ThreadData &thread_data,
const DataExtractor &data,
bool lp64) { … }
static void ParseFreeBSDPrPsInfo(ProcessElfCore &process,
const DataExtractor &data,
bool lp64) { … }
static llvm::Error ParseNetBSDProcInfo(const DataExtractor &data,
uint32_t &cpi_nlwps,
uint32_t &cpi_signo,
uint32_t &cpi_siglwp,
uint32_t &cpi_pid) { … }
static void ParseOpenBSDProcInfo(ThreadData &thread_data,
const DataExtractor &data) { … }
llvm::Expected<std::vector<CoreNote>>
ProcessElfCore::parseSegment(const DataExtractor &segment) { … }
llvm::Error ProcessElfCore::parseFreeBSDNotes(llvm::ArrayRef<CoreNote> notes) { … }
llvm::Error ProcessElfCore::parseNetBSDNotes(llvm::ArrayRef<CoreNote> notes) { … }
llvm::Error ProcessElfCore::parseOpenBSDNotes(llvm::ArrayRef<CoreNote> notes) { … }
llvm::Error ProcessElfCore::parseLinuxNotes(llvm::ArrayRef<CoreNote> notes) { … }
llvm::Error ProcessElfCore::ParseThreadContextsFromNoteSegment(
const elf::ELFProgramHeader &segment_header,
const DataExtractor &segment_data) { … }
UUID ProcessElfCore::FindBuidIdInCoreMemory(lldb::addr_t address) { … }
uint32_t ProcessElfCore::GetNumThreadContexts() { … }
ArchSpec ProcessElfCore::GetArchitecture() { … }
DataExtractor ProcessElfCore::GetAuxvData() { … }
bool ProcessElfCore::GetProcessInfo(ProcessInstanceInfo &info) { … }