[Lldb-commits] [lldb] r125209 - /lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
Johnny Chen
johnny.chen at apple.com
Wed Feb 9 11:11:32 PST 2011
Author: johnny
Date: Wed Feb 9 13:11:32 2011
New Revision: 125209
URL: http://llvm.org/viewvc/llvm-project?rev=125209&view=rev
Log:
If the CPSR is changed due to switching between ARM and Thumb ISETSTATE,
we want to record it and issue a WriteRegister callback so the clients
can track the mode changes accordingly.
Modified:
lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=125209&r1=125208&r2=125209&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original)
+++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Wed Feb 9 13:11:32 2011
@@ -2251,22 +2251,39 @@
EmulateInstructionARM::BXWritePC (Context &context, uint32_t addr)
{
addr_t target;
+ // If the CPSR is changed due to switching between ARM and Thumb ISETSTATE,
+ // we want to record it and issue a WriteRegister callback so the clients
+ // can track the mode changes accordingly.
+ bool cpsr_changed = false;
if (BitIsSet(addr, 0))
{
- SelectInstrSet(eModeThumb);
+ if (CurrentInstrSet() != eModeThumb)
+ {
+ SelectInstrSet(eModeThumb);
+ cpsr_changed = true;
+ }
target = addr & 0xfffffffe;
context.arg2 = eModeThumb;
}
else if (BitIsClear(addr, 1))
{
- SelectInstrSet(eModeARM);
+ if (CurrentInstrSet() != eModeARM)
+ {
+ SelectInstrSet(eModeARM);
+ cpsr_changed = true;
+ }
target = addr & 0xfffffffc;
context.arg2 = eModeARM;
}
else
return false; // address<1:0> == '10' => UNPREDICTABLE
+ if (cpsr_changed)
+ {
+ if (!WriteRegisterUnsigned (context, eRegisterKindGeneric, LLDB_REGNUM_GENERIC_FLAGS, m_inst_cpsr))
+ return false;
+ }
if (!WriteRegisterUnsigned (context, eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC, target))
return false;
More information about the lldb-commits
mailing list