mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-17 22:00:41 +00:00

are defined as enumerations. Current bits include: eEmulateInstructionOptionAutoAdvancePC eEmulateInstructionOptionIgnoreConditions Modified the EmulateInstruction class to have a few more pure virtuals that can help clients understand how many instructions the emulator can handle: virtual bool SupportsEmulatingIntructionsOfType (InstructionType inst_type) = 0; Where instruction types are defined as: //------------------------------------------------------------------ /// Instruction types //------------------------------------------------------------------ typedef enum InstructionType { eInstructionTypeAny, // Support for any instructions at all (at least one) eInstructionTypePrologueEpilogue, // All prologue and epilogue instructons that push and pop register values and modify sp/fp eInstructionTypePCModifying, // Any instruction that modifies the program counter/instruction pointer eInstructionTypeAll // All instructions of any kind } InstructionType; This allows use to tell what an emulator can do and also allows us to request these abilities when we are finding the plug-in interface. Added the ability for an EmulateInstruction class to get the register names for any registers that are part of the emulation. This helps with being able to dump and log effectively. The UnwindAssembly class now stores the architecture it was created with in case it is needed later in the unwinding process. Added a function that can tell us DWARF register names for ARM that goes along with the source/Utility/ARM_DWARF_Registers.h file: source/Utility/ARM_DWARF_Registers.c Took some of plug-ins out of the lldb_private namespace. llvm-svn: 130189
42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
//===-- UnwindAssembly.cpp ------------------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "lldb/lldb-private.h"
|
|
#include "lldb/Core/PluginManager.h"
|
|
#include "lldb/Core/PluginInterface.h"
|
|
#include "lldb/Target/UnwindAssembly.h"
|
|
|
|
using namespace lldb;
|
|
using namespace lldb_private;
|
|
|
|
UnwindAssembly*
|
|
UnwindAssembly::FindPlugin (const ArchSpec &arch)
|
|
{
|
|
UnwindAssemblyCreateInstance create_callback;
|
|
|
|
for (uint32_t idx = 0;
|
|
(create_callback = PluginManager::GetUnwindAssemblyCreateCallbackAtIndex(idx)) != NULL;
|
|
++idx)
|
|
{
|
|
std::auto_ptr<UnwindAssembly> assembly_profiler_ap (create_callback (arch));
|
|
if (assembly_profiler_ap.get ())
|
|
return assembly_profiler_ap.release ();
|
|
}
|
|
return NULL;
|
|
}
|
|
|
|
UnwindAssembly::UnwindAssembly (const ArchSpec &arch) :
|
|
m_arch (arch)
|
|
{
|
|
}
|
|
|
|
UnwindAssembly::~UnwindAssembly ()
|
|
{
|
|
}
|