Problem
Latest capstone next-branch fails ARM Cortex-M disassembly for ARM Cortex-M double precision instructions
cstool command line:
cstool -d -s cortexm "80 b4 00 af 0a 4b d3 ed 00 7a b7 ee e7 6a 9f ed 06 5b 85 ee 06 7b f7 ee c7 7b b0 ee 67 0a bd 46 5d f8 04 7b 70 47"
cstool output:
0 80 b4 push {r7}
ID: 128 (push)
op_count: 1
operands[0].type: REG = r7
operands[0].access: READ
Registers read: sp r7
Registers modified: sp
Groups: thumb thumb1only
2 00 af add r7, sp, #0
ID: 2 (add)
op_count: 3
operands[0].type: REG = r7
operands[0].access: WRITE
operands[1].type: REG = sp
operands[1].access: READ
operands[2].type: IMM = 0x0
Registers read: sp
Registers modified: r7
Groups: thumb thumb1only
4 0a 4b ldr r3, [pc, #0x28]
ID: 83 (ldr)
op_count: 2
operands[0].type: REG = r3
operands[0].access: WRITE
operands[1].type: MEM
operands[1].mem.base: REG = pc
operands[1].mem.disp: 0x28
operands[1].access: READ
Registers read: pc
Registers modified: r3
Groups: thumb thumb1only
6 d3 ed 00 7a vldr s15, [r3]
ID: 363 (vldr)
op_count: 2
operands[0].type: REG = s15
operands[0].access: WRITE
operands[1].type: MEM
operands[1].mem.base: REG = r3
operands[1].access: READ
Registers read: r3
Registers modified: s15
Groups: vfp2
a b7 ee .byte 0xb7, 0xee
ID: 0 ((null))
cstool then halts with exception thrown in cstool.c at line 340 "if (ins->detail->groups_count) {"
ins->detail was nullptr
The correct disassembly:
0x080032c0: push {r7}
0x080032c2: add r7, sp, #0
0x080032c4: ldr r3, [pc, #0x28]
0x080032c6: vldr s15, [r3]
0x080032ca: vcvt.f64.f32 d6, s15
0x080032ce: vldr d5, [pc, #0x18]
0x080032d2: vdiv.f64 d7, d5, d6
0x080032d6: vcvt.f32.f64 s15, d7
0x080032da: vmov.f32 s0, s15
0x080032de: mov sp, r7
0x080032e0: ldr r7, [sp], #4
0x080032e4: bx lr
Problem
Latest capstone next-branch fails ARM Cortex-M disassembly for ARM Cortex-M double precision instructions
cstool command line:
cstool -d -s cortexm "80 b4 00 af 0a 4b d3 ed 00 7a b7 ee e7 6a 9f ed 06 5b 85 ee 06 7b f7 ee c7 7b b0 ee 67 0a bd 46 5d f8 04 7b 70 47"
cstool output:
0 80 b4 push {r7}
ID: 128 (push)
op_count: 1
operands[0].type: REG = r7
operands[0].access: READ
Registers read: sp r7
Registers modified: sp
Groups: thumb thumb1only
2 00 af add r7, sp, #0
ID: 2 (add)
op_count: 3
operands[0].type: REG = r7
operands[0].access: WRITE
operands[1].type: REG = sp
operands[1].access: READ
operands[2].type: IMM = 0x0
Registers read: sp
Registers modified: r7
Groups: thumb thumb1only
4 0a 4b ldr r3, [pc, #0x28]
ID: 83 (ldr)
op_count: 2
operands[0].type: REG = r3
operands[0].access: WRITE
operands[1].type: MEM
operands[1].mem.base: REG = pc
operands[1].mem.disp: 0x28
operands[1].access: READ
Registers read: pc
Registers modified: r3
Groups: thumb thumb1only
6 d3 ed 00 7a vldr s15, [r3]
ID: 363 (vldr)
op_count: 2
operands[0].type: REG = s15
operands[0].access: WRITE
operands[1].type: MEM
operands[1].mem.base: REG = r3
operands[1].access: READ
Registers read: r3
Registers modified: s15
Groups: vfp2
a b7 ee .byte 0xb7, 0xee
ID: 0 ((null))
cstool then halts with exception thrown in cstool.c at line 340 "if (ins->detail->groups_count) {"
ins->detail was nullptr
The correct disassembly:
0x080032c0: push {r7}
0x080032c2: add r7, sp, #0
0x080032c4: ldr r3, [pc, #0x28]
0x080032c6: vldr s15, [r3]
0x080032ca: vcvt.f64.f32 d6, s15
0x080032ce: vldr d5, [pc, #0x18]
0x080032d2: vdiv.f64 d7, d5, d6
0x080032d6: vcvt.f32.f64 s15, d7
0x080032da: vmov.f32 s0, s15
0x080032de: mov sp, r7
0x080032e0: ldr r7, [sp], #4
0x080032e4: bx lr