Set refptr for Xtensa l32r opcode for better disassembly output ##anal

* Cherry-picked from ca3c77e981
* Patch done by @bucienator
This commit is contained in:
pancake 2023-02-03 10:38:04 +01:00
parent 5d5a7fb6e3
commit 80012aff7b
2 changed files with 15 additions and 0 deletions

View File

@ -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) {

View File

@ -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