summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Disassembler.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-05-09 20:18:18 +0000
committerGreg Clayton <gclayton@apple.com>2011-05-09 20:18:18 +0000
commit7349bd90786bb6f738d775a5044181f6111eb614 (patch)
treecac83b5e20bfe6cf8053948566c567fd9daf5d69 /lldb/source/Core/Disassembler.cpp
parent112a2de78cfa8a32965f1c87243fe601941809f0 (diff)
downloadbcm5719-llvm-7349bd90786bb6f738d775a5044181f6111eb614.tar.gz
bcm5719-llvm-7349bd90786bb6f738d775a5044181f6111eb614.zip
While implementing unwind information using UnwindAssemblyInstEmulation I ran
into some cleanup I have been wanting to do when reading/writing registers. Previously all RegisterContext subclasses would need to implement: virtual bool ReadRegisterBytes (uint32_t reg, DataExtractor &data); virtual bool WriteRegisterBytes (uint32_t reg, DataExtractor &data, uint32_t data_offset = 0); There is now a new class specifically designed to hold register values: lldb_private::RegisterValue The new register context calls that subclasses must implement are: virtual bool ReadRegister (const RegisterInfo *reg_info, RegisterValue &reg_value) = 0; virtual bool WriteRegister (const RegisterInfo *reg_info, const RegisterValue &reg_value) = 0; The RegisterValue class must be big enough to handle any register value. The class contains an enumeration for the value type, and then a union for the data value. Any integer/float values are stored directly in an appropriate host integer/float. Anything bigger is stored in a byte buffer that has a length and byte order. The RegisterValue class also knows how to copy register value bytes into in a buffer with a specified byte order which can be used to write the register value down into memory, and this does the right thing when not all bytes from the register values are needed (getting a uint8 from a uint32 register value..). All RegiterContext and other sources have been switched over to using the new regiter value class. llvm-svn: 131096
Diffstat (limited to 'lldb/source/Core/Disassembler.cpp')
-rw-r--r--lldb/source/Core/Disassembler.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp
index 7c28a5be6a3..995a82c30d4 100644
--- a/lldb/source/Core/Disassembler.cpp
+++ b/lldb/source/Core/Disassembler.cpp
@@ -782,10 +782,10 @@ bool
Instruction::Emulate (const ArchSpec &arch,
uint32_t evaluate_options,
void *baton,
- EmulateInstruction::ReadMemory read_mem_callback,
- EmulateInstruction::WriteMemory write_mem_callback,
- EmulateInstruction::ReadRegister read_reg_callback,
- EmulateInstruction::WriteRegister write_reg_callback)
+ EmulateInstruction::ReadMemoryCallback read_mem_callback,
+ EmulateInstruction::WriteMemoryCallback write_mem_callback,
+ EmulateInstruction::ReadRegisterCallback read_reg_callback,
+ EmulateInstruction::WriteRegisterCallback write_reg_callback)
{
std::auto_ptr<EmulateInstruction> insn_emulator_ap (EmulateInstruction::FindPlugin (arch, eInstructionTypeAny, NULL));
if (insn_emulator_ap.get())
OpenPOWER on IntegriCloud