mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-04 19:47:31 +00:00
Set refptr for Xtensa l32r opcode for better disassembly output ##anal
* Cherry-picked from ca3c77e981
* Patch done by @bucienator
This commit is contained in:
parent
5d5a7fb6e3
commit
80012aff7b
@ -171,6 +171,7 @@ static void xtensa_shr_op(RArchSession *anal, RAnalOp *op, ut64 addr, const ut8
|
||||
static void xtensa_l32r_op(RArchSession *anal, RAnalOp *op, ut64 addr, const ut8 *buf) {
|
||||
op->type = R_ANAL_OP_TYPE_LOAD;
|
||||
op->ptr = ((addr + 3) & ~3) + ((buf[2] << 8 | buf[1]) << 2) - 0x40000;
|
||||
op->refptr = 4;
|
||||
}
|
||||
|
||||
static void xtensa_snm0_op(RArchSession *anal, RAnalOp *op, ut64 addr, const ut8 *buf) {
|
||||
|
@ -27,3 +27,17 @@ var int32_t var_8h @ a1+0x8
|
||||
var int32_t var_4h @ a1+0xc
|
||||
EOF
|
||||
RUN
|
||||
|
||||
NAME=xtensa l32r refptr
|
||||
FILE=malloc://512
|
||||
CMDS=<<EOF
|
||||
e asm.arch=xtensa
|
||||
e asm.bits=32
|
||||
wx 00000000ff11ff1121ffff0df0ff
|
||||
pD 3 @ 8
|
||||
EOF
|
||||
EXPECT=<<EOF
|
||||
0x00000008 21ffff l32r a2, 0x00000004 ; [0x4:4]=0x11ff11ff
|
||||
EOF
|
||||
RUN
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user