summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-01-28 00:32:27 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-01-28 00:32:27 +0000
commite5b28a9e6a318143a3e1459e1240383a764fb76d (patch)
tree89aa6a5d03c2cf2042321b46aef275bff081e8e4 /lldb/source
parentba8df270e6bcf07c098927aa955ac05bcba64a6e (diff)
downloadbcm5719-llvm-e5b28a9e6a318143a3e1459e1240383a764fb76d.tar.gz
bcm5719-llvm-e5b28a9e6a318143a3e1459e1240383a764fb76d.zip
Should provide more useful context info for the emulate_ldr_rd_pc_rel() impl.
The context being that it's a PC relative load. llvm-svn: 124460
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Plugins/Process/Utility/EmulateInstructionARM.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/lldb/source/Plugins/Process/Utility/EmulateInstructionARM.cpp b/lldb/source/Plugins/Process/Utility/EmulateInstructionARM.cpp
index 3938e642729..b350e07fde8 100644
--- a/lldb/source/Plugins/Process/Utility/EmulateInstructionARM.cpp
+++ b/lldb/source/Plugins/Process/Utility/EmulateInstructionARM.cpp
@@ -288,6 +288,12 @@ emulate_ldr_rd_pc_rel (EmulateInstructionARM *emulator, ARMEncoding encoding)
const uint32_t pc = emulator->ReadRegisterUnsigned(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC, 0, &success);
if (!success)
return false;
+
+ // PC relative immediate load context
+ EmulateInstruction::Context context = {EmulateInstruction::eContextRegisterPlusOffset,
+ eRegisterKindGeneric,
+ LLDB_REGNUM_GENERIC_PC,
+ 0};
uint32_t Rd; // the destination register
uint32_t imm32; // immediate offset from the PC
addr_t addr; // the PC relative address
@@ -297,21 +303,14 @@ emulate_ldr_rd_pc_rel (EmulateInstructionARM *emulator, ARMEncoding encoding)
Rd = Bits32(opcode, 10, 8);
imm32 = Bits32(opcode, 7, 0) << 2; // imm32 = ZeroExtend(imm8:'00', 32);
addr = pc + 4 + imm32;
+ context.arg2 = 4 + imm32;
break;
default:
return false;
}
- EmulateInstruction::Context read_data_context = {EmulateInstruction::eContextReadMemory, 0, 0, 0};
- success = false;
- data = emulator->ReadMemoryUnsigned(read_data_context, addr, 4, 0, &success);
+ data = emulator->ReadMemoryUnsigned(context, addr, 4, 0, &success);
if (!success)
- return false;
-
- EmulateInstruction::Context context = { EmulateInstruction::eContextImmediate,
- eRegisterKindDWARF,
- dwarf_r0 + Rd,
- data };
-
+ return false;
if (!emulator->WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_r0 + Rd, data))
return false;
}
OpenPOWER on IntegriCloud