LLDB  mainline
Classes | Macros | Typedefs | Enumerations | Functions
ObjectFileMachO.cpp File Reference
#include "llvm/ADT/StringRef.h"
#include "Plugins/Process/Utility/RegisterContextDarwin_arm.h"
#include "Plugins/Process/Utility/RegisterContextDarwin_arm64.h"
#include "Plugins/Process/Utility/RegisterContextDarwin_i386.h"
#include "Plugins/Process/Utility/RegisterContextDarwin_x86_64.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/FileSpecList.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Progress.h"
#include "lldb/Core/Section.h"
#include "lldb/Core/StreamFile.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/SafeMachO.h"
#include "lldb/Symbol/DWARFCallFrameInfo.h"
#include "lldb/Symbol/LocateSymbolFile.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Target/DynamicLoader.h"
#include "lldb/Target/MemoryRegionInfo.h"
#include "lldb/Target/Platform.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadList.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/DataBuffer.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RangeMap.h"
#include "lldb/Utility/RegisterValue.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/Timer.h"
#include "lldb/Utility/UUID.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "ObjectFileMachO.h"
#include "Utility/UuidCompatibility.h"
#include <bitset>
#include <memory>
Include dependency graph for ObjectFileMachO.cpp:

Go to the source code of this file.

Classes

struct  lldb_copy_dyld_cache_header_v1
 
struct  lldb_copy_dyld_cache_mapping_info
 
struct  lldb_copy_dyld_cache_local_symbols_info
 
struct  lldb_copy_dyld_cache_local_symbols_entry
 
class  RegisterContextDarwin_x86_64_Mach
 
class  RegisterContextDarwin_i386_Mach
 
class  RegisterContextDarwin_arm_Mach
 
class  RegisterContextDarwin_arm64_Mach
 
struct  ObjectFileMachO::SegmentParsingContext
 
class  MachSymtabSectionInfo
 
struct  MachSymtabSectionInfo::SectionInfo
 
struct  TrieEntry
 
struct  TrieEntryWithOffset
 
struct  lldb_copy__dyld_process_cache_info
 
struct  all_image_infos_header
 
struct  image_entry
 
struct  segment_vmaddr
 
struct  page_object
 

Macros

#define THUMB_ADDRESS_BIT_MASK   0xfffffffffffffffeull
 
#define MACHO_NLIST_ARM_SYMBOL_IS_THUMB   0x0008
 
#define TRIE_SYMBOL_IS_THUMB   (1ULL << 63)
 

Typedefs

typedef void * dyld_process_info
 

Enumerations

enum  { DebugSymbols = true, NonDebugSymbols = false }
 

Functions

static void PrintRegisterValue (RegisterContext *reg_ctx, const char *name, const char *alt_name, size_t reg_byte_size, Stream &data)
 
static uint32_t MachHeaderSizeFromMagic (uint32_t magic)
 
static uint32_t GetSegmentPermissions (const llvm::MachO::segment_command_64 &seg_cmd)
 
static lldb::SectionType GetSectionType (uint32_t flags, ConstString section_name)
 
static bool ParseTrieEntries (DataExtractor &data, lldb::offset_t offset, const bool is_arm, addr_t text_seg_base_addr, std::vector< llvm::StringRef > &nameSlices, std::set< lldb::addr_t > &resolver_addresses, std::vector< TrieEntryWithOffset > &reexports, std::vector< TrieEntryWithOffset > &ext_symbols)
 
static SymbolType GetSymbolType (const char *&symbol_name, bool &demangled_is_synthesized, const SectionSP &text_section_sp, const SectionSP &data_section_sp, const SectionSP &data_dirty_section_sp, const SectionSP &data_const_section_sp, const SectionSP &symbol_section)
 
static llvm::Optional< struct nlist_64 > ParseNList (DataExtractor &nlist_data, lldb::offset_t &nlist_data_offset, size_t nlist_byte_size)
 
static llvm::StringRef GetOSName (uint32_t cmd)
 
unsigned int mach_task_self ()
 
static offset_t CreateAllImageInfosPayload (const lldb::ProcessSP &process_sp, offset_t initial_file_offset, StreamString &all_image_infos_payload, SaveCoreStyle core_style)
 

Macro Definition Documentation

◆ MACHO_NLIST_ARM_SYMBOL_IS_THUMB

#define MACHO_NLIST_ARM_SYMBOL_IS_THUMB   0x0008

Definition at line 804 of file ObjectFileMachO.cpp.

◆ THUMB_ADDRESS_BIT_MASK

#define THUMB_ADDRESS_BIT_MASK   0xfffffffffffffffeull

Definition at line 113 of file ObjectFileMachO.cpp.

◆ TRIE_SYMBOL_IS_THUMB

#define TRIE_SYMBOL_IS_THUMB   (1ULL << 63)

Definition at line 1990 of file ObjectFileMachO.cpp.

Typedef Documentation

◆ dyld_process_info

typedef void* dyld_process_info

Definition at line 5933 of file ObjectFileMachO.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DebugSymbols 
NonDebugSymbols 

Definition at line 2224 of file ObjectFileMachO.cpp.

Function Documentation

◆ CreateAllImageInfosPayload()

static offset_t CreateAllImageInfosPayload ( const lldb::ProcessSP &  process_sp,
offset_t  initial_file_offset,
StreamString all_image_infos_payload,
SaveCoreStyle  core_style 
)
static

◆ GetOSName()

static llvm::StringRef GetOSName ( uint32_t  cmd)
static

Definition at line 4967 of file ObjectFileMachO.cpp.

Referenced by ObjectFileMachO::GetAllArchSpecs().

◆ GetSectionType()

static lldb::SectionType GetSectionType ( uint32_t  flags,
ConstString  section_name 
)
static

◆ GetSegmentPermissions()

static uint32_t GetSegmentPermissions ( const llvm::MachO::segment_command_64 &  seg_cmd)
static

Definition at line 1438 of file ObjectFileMachO.cpp.

Referenced by ObjectFileMachO::ProcessSegmentCommand().

◆ GetSymbolType()

static SymbolType GetSymbolType ( const char *&  symbol_name,
bool &  demangled_is_synthesized,
const SectionSP &  text_section_sp,
const SectionSP &  data_section_sp,
const SectionSP &  data_dirty_section_sp,
const SectionSP &  data_const_section_sp,
const SectionSP &  symbol_section 
)
static

◆ mach_task_self()

unsigned int mach_task_self ( )

◆ MachHeaderSizeFromMagic()

static uint32_t MachHeaderSizeFromMagic ( uint32_t  magic)
static

◆ ParseNList()

static llvm::Optional<struct nlist_64> ParseNList ( DataExtractor nlist_data,
lldb::offset_t nlist_data_offset,
size_t  nlist_byte_size 
)
static

◆ ParseTrieEntries()

static bool ParseTrieEntries ( DataExtractor data,
lldb::offset_t  offset,
const bool  is_arm,
addr_t  text_seg_base_addr,
std::vector< llvm::StringRef > &  nameSlices,
std::set< lldb::addr_t > &  resolver_addresses,
std::vector< TrieEntryWithOffset > &  reexports,
std::vector< TrieEntryWithOffset > &  ext_symbols 
)
static

◆ PrintRegisterValue()

static void PrintRegisterValue ( RegisterContext reg_ctx,
const char *  name,
const char *  alt_name,
size_t  reg_byte_size,
Stream data 
)
static