LLDB  mainline
Classes | Namespaces | Macros | Functions | Variables
ArchSpec.cpp File Reference
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StringList.h"
#include "lldb/lldb-defines.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/Support/Compiler.h"
Include dependency graph for ArchSpec.cpp:

Go to the source code of this file.

Classes

struct  lldb_private::CoreDefinition
 
struct  ArchDefinitionEntry
 
struct  ArchDefinition
 

Namespaces

 lldb_private
 A class that represents a running process on the host machine.
 

Macros

#define CPU_ANY   (UINT32_MAX)
 
#define SUBTYPE_MASK   0x00FFFFFFu
 

Functions

static bool cores_match (const ArchSpec::Core core1, const ArchSpec::Core core2, bool try_inverse, bool enforce_exact_match)
 
static const ArchDefinitionFindArchDefinition (ArchitectureType arch_type)
 
static const CoreDefinitionFindCoreDefinition (llvm::StringRef name)
 
static const CoreDefinitionFindCoreDefinition (ArchSpec::Core core)
 
static const ArchDefinitionEntryFindArchDefinitionEntry (const ArchDefinition *def, uint32_t cpu, uint32_t sub)
 
static const ArchDefinitionEntryFindArchDefinitionEntry (const ArchDefinition *def, ArchSpec::Core core)
 
static bool IsCompatibleEnvironment (llvm::Triple::EnvironmentType lhs, llvm::Triple::EnvironmentType rhs)
 

Variables

static const CoreDefinition g_core_definitions []
 
static const ArchDefinitionEntry g_macho_arch_entries []
 
static const ArchDefinition g_macho_arch_def
 
static const ArchDefinitionEntry g_elf_arch_entries []
 
static const ArchDefinition g_elf_arch_def
 
static const ArchDefinitionEntry g_coff_arch_entries []
 
static const ArchDefinition g_coff_arch_def
 
static const ArchDefinitiong_arch_definitions []
 
static const size_t k_num_arch_definitions
 

Macro Definition Documentation

◆ CPU_ANY

#define CPU_ANY   (UINT32_MAX)

Definition at line 266 of file ArchSpec.cpp.

◆ SUBTYPE_MASK

#define SUBTYPE_MASK   0x00FFFFFFu

Definition at line 273 of file ArchSpec.cpp.

Function Documentation

◆ cores_match()

static bool cores_match ( const ArchSpec::Core  core1,
const ArchSpec::Core  core2,
bool  try_inverse,
bool  enforce_exact_match 
)
static

Definition at line 1070 of file ArchSpec.cpp.

Referenced by lldb_private::ArchSpec::IsEqualTo().

◆ FindArchDefinition()

static const ArchDefinition* FindArchDefinition ( ArchitectureType  arch_type)
static

◆ FindArchDefinitionEntry() [1/2]

static const ArchDefinitionEntry* FindArchDefinitionEntry ( const ArchDefinition def,
ArchSpec::Core  core 
)
static

Definition at line 495 of file ArchSpec.cpp.

References ArchDefinition::entries, and ArchDefinition::num_entries.

◆ FindArchDefinitionEntry() [2/2]

static const ArchDefinitionEntry* FindArchDefinitionEntry ( const ArchDefinition def,
uint32_t  cpu,
uint32_t  sub 
)
static

◆ FindCoreDefinition() [1/2]

static const CoreDefinition* FindCoreDefinition ( ArchSpec::Core  core)
inlinestatic

Definition at line 473 of file ArchSpec.cpp.

References g_core_definitions.

◆ FindCoreDefinition() [2/2]

static const CoreDefinition* FindCoreDefinition ( llvm::StringRef  name)
static

◆ IsCompatibleEnvironment()

static bool IsCompatibleEnvironment ( llvm::Triple::EnvironmentType  lhs,
llvm::Triple::EnvironmentType  rhs 
)
static

Definition at line 938 of file ArchSpec.cpp.

Referenced by lldb_private::ArchSpec::IsEqualTo().

Variable Documentation

◆ g_arch_definitions

const ArchDefinition* g_arch_definitions[]
static
Initial value:

Definition at line 445 of file ArchSpec.cpp.

Referenced by FindArchDefinition().

◆ g_coff_arch_def

const ArchDefinition g_coff_arch_def
static
Initial value:
= {
llvm::array_lengthof(g_coff_arch_entries),
"pe-coff",
}

Definition at line 436 of file ArchSpec.cpp.

◆ g_coff_arch_entries

const ArchDefinitionEntry g_coff_arch_entries[]
static
Initial value:
= {
{ArchSpec::eCore_x86_32_i386, llvm::COFF::IMAGE_FILE_MACHINE_I386,
LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu},
{ArchSpec::eCore_ppc_generic, llvm::COFF::IMAGE_FILE_MACHINE_POWERPC,
LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu},
{ArchSpec::eCore_ppc_generic, llvm::COFF::IMAGE_FILE_MACHINE_POWERPCFP,
LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu},
{ArchSpec::eCore_arm_generic, llvm::COFF::IMAGE_FILE_MACHINE_ARM,
LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu},
{ArchSpec::eCore_arm_armv7, llvm::COFF::IMAGE_FILE_MACHINE_ARMNT,
LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu},
{ArchSpec::eCore_thumb, llvm::COFF::IMAGE_FILE_MACHINE_THUMB,
LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu},
{ArchSpec::eCore_x86_64_x86_64, llvm::COFF::IMAGE_FILE_MACHINE_AMD64,
LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu},
{ArchSpec::eCore_arm_arm64, llvm::COFF::IMAGE_FILE_MACHINE_ARM64,
LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}
}

Definition at line 417 of file ArchSpec.cpp.

◆ g_core_definitions

const CoreDefinition g_core_definitions[]
static

◆ g_elf_arch_def

const ArchDefinition g_elf_arch_def
static
Initial value:
= {
llvm::array_lengthof(g_elf_arch_entries),
"elf",
}

Definition at line 410 of file ArchSpec.cpp.

◆ g_elf_arch_entries

const ArchDefinitionEntry g_elf_arch_entries[]
static

Definition at line 351 of file ArchSpec.cpp.

◆ g_macho_arch_def

const ArchDefinition g_macho_arch_def
static
Initial value:
= {
eArchTypeMachO, llvm::array_lengthof(g_macho_arch_entries),

Definition at line 342 of file ArchSpec.cpp.

Referenced by lldb_private::ArchSpec::GetMachOCPUSubType(), and lldb_private::ArchSpec::GetMachOCPUType().

◆ g_macho_arch_entries

const ArchDefinitionEntry g_macho_arch_entries[]
static

Definition at line 276 of file ArchSpec.cpp.

◆ k_num_arch_definitions

const size_t k_num_arch_definitions
static
Initial value:
=
llvm::array_lengthof(g_arch_definitions)

Definition at line 448 of file ArchSpec.cpp.

Referenced by FindArchDefinition().

g_arch_definitions
static const ArchDefinition * g_arch_definitions[]
Definition: ArchSpec.cpp:445
lldb_private::eArchTypeCOFF
@ eArchTypeCOFF
Definition: lldb-private-enumerations.h:65
LLDB_INVALID_CPUTYPE
#define LLDB_INVALID_CPUTYPE
Definition: lldb-defines.h:106
lldb_private::eArchTypeMachO
@ eArchTypeMachO
Definition: lldb-private-enumerations.h:63
g_elf_arch_def
static const ArchDefinition g_elf_arch_def
Definition: ArchSpec.cpp:410
g_macho_arch_entries
static const ArchDefinitionEntry g_macho_arch_entries[]
Definition: ArchSpec.cpp:276
g_coff_arch_def
static const ArchDefinition g_coff_arch_def
Definition: ArchSpec.cpp:436
g_macho_arch_def
static const ArchDefinition g_macho_arch_def
Definition: ArchSpec.cpp:342
g_coff_arch_entries
static const ArchDefinitionEntry g_coff_arch_entries[]
Definition: ArchSpec.cpp:417
lldb_private::eArchTypeELF
@ eArchTypeELF
Definition: lldb-private-enumerations.h:64
g_elf_arch_entries
static const ArchDefinitionEntry g_elf_arch_entries[]
Definition: ArchSpec.cpp:351