Fix order of b and blx instrction in EmulateInstructionARM
authorTamas Berghammer <tberghammer@google.com>
Fri, 24 Apr 2015 12:13:41 +0000 (12:13 +0000)
committerTamas Berghammer <tberghammer@google.com>
Fri, 24 Apr 2015 12:13:41 +0000 (12:13 +0000)
In the previous ordering some "blx <label>" instruction was recognised
as "b #imm24" instructions causing a failure in the instruction
emulator.

Differential revision: http://reviews.llvm.org/D9218

llvm-svn: 235714

lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp

index 965c02a..7761946 100644 (file)
@@ -12349,9 +12349,9 @@ EmulateInstructionARM::GetARMOpcodeForInstruction (const uint32_t opcode, uint32
         //----------------------------------------------------------------------
         // Branch instructions
         //----------------------------------------------------------------------
-        { 0x0f000000, 0x0a000000, ARMvAll,       eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateB, "b #imm24"},
-        // To resolve ambiguity, "blx <label>" should come before "bl <label>".
+        // To resolve ambiguity, "blx <label>" should come before "b #imm24" and "bl <label>".
         { 0xfe000000, 0xfa000000, ARMV5_ABOVE,   eEncodingA2, No_VFP, eSize32, &EmulateInstructionARM::EmulateBLXImmediate, "blx <label>"},
+        { 0x0f000000, 0x0a000000, ARMvAll,       eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateB, "b #imm24"},
         { 0x0f000000, 0x0b000000, ARMvAll,       eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateBLXImmediate, "bl <label>"},
         { 0x0ffffff0, 0x012fff30, ARMV5_ABOVE,   eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateBLXRm, "blx <Rm>"},
         // for example, "bx lr"