Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@@ -0,0 +1,2 @@
add_subdirectory(InstEmulation)
add_subdirectory(x86)

View File

@@ -0,0 +1,8 @@
add_lldb_library(lldbPluginUnwindAssemblyInstEmulation PLUGIN
UnwindAssemblyInstEmulation.cpp
LINK_LIBS
lldbCore
lldbSymbol
lldbTarget
)

View File

@@ -0,0 +1,161 @@
//===-- UnwindAssemblyInstEmulation.h ---------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_UnwindAssemblyInstEmulation_h_
#define liblldb_UnwindAssemblyInstEmulation_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Core/EmulateInstruction.h"
#include "lldb/Core/RegisterValue.h"
#include "lldb/Symbol/UnwindPlan.h"
#include "lldb/Target/UnwindAssembly.h"
#include "lldb/lldb-private.h"
class UnwindAssemblyInstEmulation : public lldb_private::UnwindAssembly {
public:
~UnwindAssemblyInstEmulation() override = default;
bool GetNonCallSiteUnwindPlanFromAssembly(
lldb_private::AddressRange &func, lldb_private::Thread &thread,
lldb_private::UnwindPlan &unwind_plan) override;
bool
GetNonCallSiteUnwindPlanFromAssembly(lldb_private::AddressRange &func,
uint8_t *opcode_data, size_t opcode_size,
lldb_private::UnwindPlan &unwind_plan);
bool
AugmentUnwindPlanFromCallSite(lldb_private::AddressRange &func,
lldb_private::Thread &thread,
lldb_private::UnwindPlan &unwind_plan) override;
bool GetFastUnwindPlan(lldb_private::AddressRange &func,
lldb_private::Thread &thread,
lldb_private::UnwindPlan &unwind_plan) override;
// thread may be NULL in which case we only use the Target (e.g. if this is
// called pre-process-launch).
bool
FirstNonPrologueInsn(lldb_private::AddressRange &func,
const lldb_private::ExecutionContext &exe_ctx,
lldb_private::Address &first_non_prologue_insn) override;
static lldb_private::UnwindAssembly *
CreateInstance(const lldb_private::ArchSpec &arch);
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
static void Initialize();
static void Terminate();
static lldb_private::ConstString GetPluginNameStatic();
static const char *GetPluginDescriptionStatic();
lldb_private::ConstString GetPluginName() override;
uint32_t GetPluginVersion() override;
private:
// Call CreateInstance to get an instance of this class
UnwindAssemblyInstEmulation(const lldb_private::ArchSpec &arch,
lldb_private::EmulateInstruction *inst_emulator)
: UnwindAssembly(arch), m_inst_emulator_ap(inst_emulator),
m_range_ptr(NULL), m_unwind_plan_ptr(NULL), m_curr_row(),
m_cfa_reg_info(), m_fp_is_cfa(false), m_register_values(),
m_pushed_regs(), m_curr_row_modified(false),
m_forward_branch_offset(0) {
if (m_inst_emulator_ap.get()) {
m_inst_emulator_ap->SetBaton(this);
m_inst_emulator_ap->SetCallbacks(ReadMemory, WriteMemory, ReadRegister,
WriteRegister);
}
}
static size_t
ReadMemory(lldb_private::EmulateInstruction *instruction, void *baton,
const lldb_private::EmulateInstruction::Context &context,
lldb::addr_t addr, void *dst, size_t length);
static size_t
WriteMemory(lldb_private::EmulateInstruction *instruction, void *baton,
const lldb_private::EmulateInstruction::Context &context,
lldb::addr_t addr, const void *dst, size_t length);
static bool ReadRegister(lldb_private::EmulateInstruction *instruction,
void *baton,
const lldb_private::RegisterInfo *reg_info,
lldb_private::RegisterValue &reg_value);
static bool
WriteRegister(lldb_private::EmulateInstruction *instruction, void *baton,
const lldb_private::EmulateInstruction::Context &context,
const lldb_private::RegisterInfo *reg_info,
const lldb_private::RegisterValue &reg_value);
// size_t
// ReadMemory (lldb_private::EmulateInstruction *instruction,
// const lldb_private::EmulateInstruction::Context &context,
// lldb::addr_t addr,
// void *dst,
// size_t length);
size_t WriteMemory(lldb_private::EmulateInstruction *instruction,
const lldb_private::EmulateInstruction::Context &context,
lldb::addr_t addr, const void *dst, size_t length);
bool ReadRegister(lldb_private::EmulateInstruction *instruction,
const lldb_private::RegisterInfo *reg_info,
lldb_private::RegisterValue &reg_value);
bool WriteRegister(lldb_private::EmulateInstruction *instruction,
const lldb_private::EmulateInstruction::Context &context,
const lldb_private::RegisterInfo *reg_info,
const lldb_private::RegisterValue &reg_value);
static uint64_t
MakeRegisterKindValuePair(const lldb_private::RegisterInfo &reg_info);
void SetRegisterValue(const lldb_private::RegisterInfo &reg_info,
const lldb_private::RegisterValue &reg_value);
bool GetRegisterValue(const lldb_private::RegisterInfo &reg_info,
lldb_private::RegisterValue &reg_value);
std::unique_ptr<lldb_private::EmulateInstruction> m_inst_emulator_ap;
lldb_private::AddressRange *m_range_ptr;
lldb_private::UnwindPlan *m_unwind_plan_ptr;
lldb_private::UnwindPlan::RowSP m_curr_row;
typedef std::map<uint64_t, uint64_t> PushedRegisterToAddrMap;
uint64_t m_initial_sp;
lldb_private::RegisterInfo m_cfa_reg_info;
bool m_fp_is_cfa;
typedef std::map<uint64_t, lldb_private::RegisterValue> RegisterValueMap;
RegisterValueMap m_register_values;
PushedRegisterToAddrMap m_pushed_regs;
// While processing the instruction stream, we need to communicate some state
// change
// information up to the higher level loop that makes decisions about how to
// push
// the unwind instructions for the UnwindPlan we're constructing.
// The instruction we're processing updated the UnwindPlan::Row contents
bool m_curr_row_modified;
// The instruction is branching forward with the given offset. 0 value means
// no branching.
uint32_t m_forward_branch_offset;
};
#endif // liblldb_UnwindAssemblyInstEmulation_h_

View File

@@ -0,0 +1,14 @@
add_lldb_library(lldbPluginUnwindAssemblyX86 PLUGIN
UnwindAssembly-x86.cpp
x86AssemblyInspectionEngine.cpp
LINK_LIBS
lldbCore
lldbSymbol
lldbTarget
lldbUtility
LINK_COMPONENTS
Support
MC
MCDisassembler
)

View File

@@ -0,0 +1,279 @@
//===-- UnwindAssembly-x86.cpp ----------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "UnwindAssembly-x86.h"
#include "x86AssemblyInspectionEngine.h"
#include "llvm-c/Disassembler.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/TargetSelect.h"
#include "lldb/Core/Address.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Symbol/UnwindPlan.h"
#include "lldb/Target/ABI.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/RegisterNumber.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/UnwindAssembly.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/Status.h"
using namespace lldb;
using namespace lldb_private;
//-----------------------------------------------------------------------------------------------
// UnwindAssemblyParser_x86 method definitions
//-----------------------------------------------------------------------------------------------
UnwindAssembly_x86::UnwindAssembly_x86(const ArchSpec &arch)
: lldb_private::UnwindAssembly(arch),
m_assembly_inspection_engine(new x86AssemblyInspectionEngine(arch)) {}
UnwindAssembly_x86::~UnwindAssembly_x86() {
delete m_assembly_inspection_engine;
}
bool UnwindAssembly_x86::GetNonCallSiteUnwindPlanFromAssembly(
AddressRange &func, Thread &thread, UnwindPlan &unwind_plan) {
if (!func.GetBaseAddress().IsValid() || func.GetByteSize() == 0)
return false;
if (m_assembly_inspection_engine == nullptr)
return false;
ProcessSP process_sp(thread.GetProcess());
if (process_sp.get() == nullptr)
return false;
const bool prefer_file_cache = true;
std::vector<uint8_t> function_text(func.GetByteSize());
Status error;
if (process_sp->GetTarget().ReadMemory(
func.GetBaseAddress(), prefer_file_cache, function_text.data(),
func.GetByteSize(), error) == func.GetByteSize()) {
RegisterContextSP reg_ctx(thread.GetRegisterContext());
m_assembly_inspection_engine->Initialize(reg_ctx);
return m_assembly_inspection_engine->GetNonCallSiteUnwindPlanFromAssembly(
function_text.data(), func.GetByteSize(), func, unwind_plan);
}
return false;
}
bool UnwindAssembly_x86::AugmentUnwindPlanFromCallSite(
AddressRange &func, Thread &thread, UnwindPlan &unwind_plan) {
bool do_augment_unwindplan = true;
UnwindPlan::RowSP first_row = unwind_plan.GetRowForFunctionOffset(0);
UnwindPlan::RowSP last_row = unwind_plan.GetRowForFunctionOffset(-1);
int wordsize = 8;
ProcessSP process_sp(thread.GetProcess());
if (process_sp.get() == nullptr)
return false;
wordsize = process_sp->GetTarget().GetArchitecture().GetAddressByteSize();
RegisterNumber sp_regnum(thread, eRegisterKindGeneric,
LLDB_REGNUM_GENERIC_SP);
RegisterNumber pc_regnum(thread, eRegisterKindGeneric,
LLDB_REGNUM_GENERIC_PC);
// Does this UnwindPlan describe the prologue? I want to see that the CFA is
// set
// in terms of the stack pointer plus an offset, and I want to see that rip is
// retrieved at the CFA-wordsize.
// If there is no description of the prologue, don't try to augment this
// eh_frame
// unwinder code, fall back to assembly parsing instead.
if (first_row->GetCFAValue().GetValueType() !=
UnwindPlan::Row::CFAValue::isRegisterPlusOffset ||
RegisterNumber(thread, unwind_plan.GetRegisterKind(),
first_row->GetCFAValue().GetRegisterNumber()) !=
sp_regnum ||
first_row->GetCFAValue().GetOffset() != wordsize) {
return false;
}
UnwindPlan::Row::RegisterLocation first_row_pc_loc;
if (first_row->GetRegisterInfo(
pc_regnum.GetAsKind(unwind_plan.GetRegisterKind()),
first_row_pc_loc) == false ||
first_row_pc_loc.IsAtCFAPlusOffset() == false ||
first_row_pc_loc.GetOffset() != -wordsize) {
return false;
}
// It looks like the prologue is described.
// Is the epilogue described? If it is, no need to do any augmentation.
if (first_row != last_row &&
first_row->GetOffset() != last_row->GetOffset()) {
// The first & last row have the same CFA register
// and the same CFA offset value
// and the CFA register is esp/rsp (the stack pointer).
// We're checking that both of them have an unwind rule like "CFA=esp+4" or
// CFA+rsp+8".
if (first_row->GetCFAValue().GetValueType() ==
last_row->GetCFAValue().GetValueType() &&
first_row->GetCFAValue().GetRegisterNumber() ==
last_row->GetCFAValue().GetRegisterNumber() &&
first_row->GetCFAValue().GetOffset() ==
last_row->GetCFAValue().GetOffset()) {
// Get the register locations for eip/rip from the first & last rows.
// Are they both CFA plus an offset? Is it the same offset?
UnwindPlan::Row::RegisterLocation last_row_pc_loc;
if (last_row->GetRegisterInfo(
pc_regnum.GetAsKind(unwind_plan.GetRegisterKind()),
last_row_pc_loc)) {
if (last_row_pc_loc.IsAtCFAPlusOffset() &&
first_row_pc_loc.GetOffset() == last_row_pc_loc.GetOffset()) {
// One last sanity check: Is the unwind rule for getting the caller
// pc value
// "deref the CFA-4" or "deref the CFA-8"?
// If so, we have an UnwindPlan that already describes the epilogue
// and we don't need
// to modify it at all.
if (first_row_pc_loc.GetOffset() == -wordsize) {
do_augment_unwindplan = false;
}
}
}
}
}
if (do_augment_unwindplan) {
if (!func.GetBaseAddress().IsValid() || func.GetByteSize() == 0)
return false;
if (m_assembly_inspection_engine == nullptr)
return false;
const bool prefer_file_cache = true;
std::vector<uint8_t> function_text(func.GetByteSize());
Status error;
if (process_sp->GetTarget().ReadMemory(
func.GetBaseAddress(), prefer_file_cache, function_text.data(),
func.GetByteSize(), error) == func.GetByteSize()) {
RegisterContextSP reg_ctx(thread.GetRegisterContext());
m_assembly_inspection_engine->Initialize(reg_ctx);
return m_assembly_inspection_engine->AugmentUnwindPlanFromCallSite(
function_text.data(), func.GetByteSize(), func, unwind_plan, reg_ctx);
}
}
return false;
}
bool UnwindAssembly_x86::GetFastUnwindPlan(AddressRange &func, Thread &thread,
UnwindPlan &unwind_plan) {
// if prologue is
// 55 pushl %ebp
// 89 e5 movl %esp, %ebp
// or
// 55 pushq %rbp
// 48 89 e5 movq %rsp, %rbp
// We should pull in the ABI architecture default unwind plan and return that
llvm::SmallVector<uint8_t, 4> opcode_data;
ProcessSP process_sp = thread.GetProcess();
if (process_sp) {
Target &target(process_sp->GetTarget());
const bool prefer_file_cache = true;
Status error;
if (target.ReadMemory(func.GetBaseAddress(), prefer_file_cache,
opcode_data.data(), 4, error) == 4) {
uint8_t i386_push_mov[] = {0x55, 0x89, 0xe5};
uint8_t x86_64_push_mov[] = {0x55, 0x48, 0x89, 0xe5};
if (memcmp(opcode_data.data(), i386_push_mov, sizeof(i386_push_mov)) ==
0 ||
memcmp(opcode_data.data(), x86_64_push_mov,
sizeof(x86_64_push_mov)) == 0) {
ABISP abi_sp = process_sp->GetABI();
if (abi_sp) {
return abi_sp->CreateDefaultUnwindPlan(unwind_plan);
}
}
}
}
return false;
}
bool UnwindAssembly_x86::FirstNonPrologueInsn(
AddressRange &func, const ExecutionContext &exe_ctx,
Address &first_non_prologue_insn) {
if (!func.GetBaseAddress().IsValid())
return false;
Target *target = exe_ctx.GetTargetPtr();
if (target == nullptr)
return false;
if (m_assembly_inspection_engine == nullptr)
return false;
const bool prefer_file_cache = true;
std::vector<uint8_t> function_text(func.GetByteSize());
Status error;
if (target->ReadMemory(func.GetBaseAddress(), prefer_file_cache,
function_text.data(), func.GetByteSize(),
error) == func.GetByteSize()) {
size_t offset;
if (m_assembly_inspection_engine->FindFirstNonPrologueInstruction(
function_text.data(), func.GetByteSize(), offset)) {
first_non_prologue_insn = func.GetBaseAddress();
first_non_prologue_insn.Slide(offset);
}
return true;
}
return false;
}
UnwindAssembly *UnwindAssembly_x86::CreateInstance(const ArchSpec &arch) {
const llvm::Triple::ArchType cpu = arch.GetMachine();
if (cpu == llvm::Triple::x86 || cpu == llvm::Triple::x86_64)
return new UnwindAssembly_x86(arch);
return NULL;
}
//------------------------------------------------------------------
// PluginInterface protocol in UnwindAssemblyParser_x86
//------------------------------------------------------------------
ConstString UnwindAssembly_x86::GetPluginName() {
return GetPluginNameStatic();
}
uint32_t UnwindAssembly_x86::GetPluginVersion() { return 1; }
void UnwindAssembly_x86::Initialize() {
PluginManager::RegisterPlugin(GetPluginNameStatic(),
GetPluginDescriptionStatic(), CreateInstance);
}
void UnwindAssembly_x86::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
lldb_private::ConstString UnwindAssembly_x86::GetPluginNameStatic() {
static ConstString g_name("x86");
return g_name;
}
const char *UnwindAssembly_x86::GetPluginDescriptionStatic() {
return "i386 and x86_64 assembly language profiler plugin.";
}

View File

@@ -0,0 +1,72 @@
//===-- UnwindAssembly-x86.h ------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_UnwindAssembly_x86_h_
#define liblldb_UnwindAssembly_x86_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
#include "x86AssemblyInspectionEngine.h"
// Project includes
#include "lldb/Target/UnwindAssembly.h"
#include "lldb/lldb-private.h"
class UnwindAssembly_x86 : public lldb_private::UnwindAssembly {
public:
~UnwindAssembly_x86() override;
bool GetNonCallSiteUnwindPlanFromAssembly(
lldb_private::AddressRange &func, lldb_private::Thread &thread,
lldb_private::UnwindPlan &unwind_plan) override;
bool
AugmentUnwindPlanFromCallSite(lldb_private::AddressRange &func,
lldb_private::Thread &thread,
lldb_private::UnwindPlan &unwind_plan) override;
bool GetFastUnwindPlan(lldb_private::AddressRange &func,
lldb_private::Thread &thread,
lldb_private::UnwindPlan &unwind_plan) override;
// thread may be NULL in which case we only use the Target (e.g. if this is
// called pre-process-launch).
bool
FirstNonPrologueInsn(lldb_private::AddressRange &func,
const lldb_private::ExecutionContext &exe_ctx,
lldb_private::Address &first_non_prologue_insn) override;
static lldb_private::UnwindAssembly *
CreateInstance(const lldb_private::ArchSpec &arch);
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
static void Initialize();
static void Terminate();
static lldb_private::ConstString GetPluginNameStatic();
static const char *GetPluginDescriptionStatic();
lldb_private::ConstString GetPluginName() override;
uint32_t GetPluginVersion() override;
private:
UnwindAssembly_x86(const lldb_private::ArchSpec &arch);
lldb_private::ArchSpec m_arch;
lldb_private::x86AssemblyInspectionEngine *m_assembly_inspection_engine;
};
#endif // liblldb_UnwindAssembly_x86_h_

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,181 @@
//===-- x86AssemblyInspectionEngine.h ---------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_x86AssemblyInspectionEngine_h_
#define liblldb_x86AssemblyInspectionEngine_h_
#include "llvm-c/Disassembler.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/lldb-enumerations.h"
#include "lldb/lldb-forward.h"
#include "lldb/lldb-private.h"
#include <map>
#include <vector>
namespace lldb_private {
// x86AssemblyInspectionEngine - a class which will take a buffer of bytes
// of i386/x86_64 instructions and create an UnwindPlan based on those
// assembly instructions.
class x86AssemblyInspectionEngine {
public:
/// default ctor
x86AssemblyInspectionEngine(const lldb_private::ArchSpec &arch);
/// default dtor
~x86AssemblyInspectionEngine();
/// One of the two initialize methods that can be called on this object;
/// they must be called before any of the assembly inspection methods
/// are called. This one should be used if the caller has access to a
/// valid RegisterContext.
void Initialize(lldb::RegisterContextSP &reg_ctx);
/// One of the two initialize methods that can be called on this object;
/// they must be called before any of the assembly inspection methods
/// are called. This one takes a vector of register name and lldb
/// register numbers.
struct lldb_reg_info {
const char *name;
uint32_t lldb_regnum;
lldb_reg_info() : name(nullptr), lldb_regnum(LLDB_INVALID_REGNUM) {}
};
void Initialize(std::vector<lldb_reg_info> &reg_info);
/// Create an UnwindPlan for a "non-call site" stack frame situation.
/// This is usually when this function/method is currently executing, and may
/// be at
/// a location where exception-handling style unwind information (eh_frame,
/// compact unwind info, arm unwind info)
/// are not valid.
/// \p data is a pointer to the instructions for the function
/// \p size is the size of the instruction buffer above
/// \p func_range is the start Address and size of the function, to be
/// included in the UnwindPlan
/// \p unwind_plan is the unwind plan that this method creates
/// \returns true if it was able to create an UnwindPlan; false if not.
bool
GetNonCallSiteUnwindPlanFromAssembly(uint8_t *data, size_t size,
lldb_private::AddressRange &func_range,
lldb_private::UnwindPlan &unwind_plan);
/// Take an existing UnwindPlan, probably from eh_frame which may be missing
/// description
/// of the epilogue instructions, and add the epilogue description to it based
/// on the
/// instructions in the function.
///
/// The \p unwind_plan 's register numbers must be converted into the lldb
/// register numbering
/// scheme OR a RegisterContext must be provided in \p reg_ctx. If the \p
/// unwind_plan
/// register numbers are already in lldb register numbering, \p reg_ctx may be
/// null.
/// \returns true if the \p unwind_plan was updated, false if it was not.
bool AugmentUnwindPlanFromCallSite(uint8_t *data, size_t size,
lldb_private::AddressRange &func_range,
lldb_private::UnwindPlan &unwind_plan,
lldb::RegisterContextSP &reg_ctx);
bool FindFirstNonPrologueInstruction(uint8_t *data, size_t size,
size_t &offset);
private:
bool nonvolatile_reg_p(int machine_regno);
bool push_rbp_pattern_p();
bool push_0_pattern_p();
bool push_imm_pattern_p();
bool push_extended_pattern_p();
bool push_misc_reg_p();
bool mov_rsp_rbp_pattern_p();
bool sub_rsp_pattern_p(int &amount);
bool add_rsp_pattern_p(int &amount);
bool lea_rsp_pattern_p(int &amount);
bool lea_rbp_rsp_pattern_p(int &amount);
bool push_reg_p(int &regno);
bool pop_reg_p(int &regno);
bool pop_rbp_pattern_p();
bool pop_misc_reg_p();
bool leave_pattern_p();
bool call_next_insn_pattern_p();
bool mov_reg_to_local_stack_frame_p(int &regno, int &rbp_offset);
bool ret_pattern_p();
uint32_t extract_4(uint8_t *b);
bool instruction_length(uint8_t *insn, int &length, uint32_t buffer_remaining_bytes);
bool machine_regno_to_lldb_regno(int machine_regno, uint32_t &lldb_regno);
enum CPU { k_i386, k_x86_64, k_cpu_unspecified };
enum i386_register_numbers {
k_machine_eax = 0,
k_machine_ecx = 1,
k_machine_edx = 2,
k_machine_ebx = 3,
k_machine_esp = 4,
k_machine_ebp = 5,
k_machine_esi = 6,
k_machine_edi = 7,
k_machine_eip = 8
};
enum x86_64_register_numbers {
k_machine_rax = 0,
k_machine_rcx = 1,
k_machine_rdx = 2,
k_machine_rbx = 3,
k_machine_rsp = 4,
k_machine_rbp = 5,
k_machine_rsi = 6,
k_machine_rdi = 7,
k_machine_r8 = 8,
k_machine_r9 = 9,
k_machine_r10 = 10,
k_machine_r11 = 11,
k_machine_r12 = 12,
k_machine_r13 = 13,
k_machine_r14 = 14,
k_machine_r15 = 15,
k_machine_rip = 16
};
enum { kMaxInstructionByteSize = 32 };
uint8_t *m_cur_insn;
uint32_t m_machine_ip_regnum;
uint32_t m_machine_sp_regnum;
uint32_t m_machine_fp_regnum;
uint32_t m_lldb_ip_regnum;
uint32_t m_lldb_sp_regnum;
uint32_t m_lldb_fp_regnum;
typedef std::map<uint32_t, lldb_reg_info> MachineRegnumToNameAndLLDBRegnum;
MachineRegnumToNameAndLLDBRegnum m_reg_map;
lldb_private::ArchSpec m_arch;
CPU m_cpu;
int m_wordsize;
bool m_register_map_initialized;
::LLVMDisasmContextRef m_disasm_context;
DISALLOW_COPY_AND_ASSIGN(x86AssemblyInspectionEngine);
};
} // namespace lldb_private
#endif // liblldb_x86AssemblyInspectionEngine_h_