mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-03 02:41:08 +00:00
Automatic asm.bits depending on CPSR's Thumb bit
This commit is contained in:
parent
9bd4e213b2
commit
6c931a091f
@ -89,11 +89,23 @@ R_API int r_debug_reg_list(RDebug *dbg, int type, int size, int rad, const char
|
||||
from = type;
|
||||
to = from +1;
|
||||
}
|
||||
bool is_arm = dbg->arch && strstr (dbg->arch, "arm");
|
||||
for (i = from; i < to; i++) {
|
||||
head = r_reg_get_list (dbg->reg, i);
|
||||
if (!head) continue;
|
||||
r_list_foreach (head, iter, item) {
|
||||
ut64 value;
|
||||
|
||||
if (is_arm && (rad == 1 || rad == '*') && item->size == 1) {
|
||||
if (!strcmp (item->name, "tf")) {
|
||||
bool is_thumb = r_reg_get_value (dbg->reg, item);
|
||||
int new_bits = is_thumb? 16: 32;
|
||||
if (dbg->bits != new_bits)
|
||||
dbg->cb_printf ("e asm.bits=%d\n", new_bits);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (type != -1) {
|
||||
if (type != item->type) continue;
|
||||
if (size != 0 && size != item->size) continue;
|
||||
|
@ -25,6 +25,12 @@ R_API ut64 r_reg_get_value(RReg *reg, RRegItem *item) {
|
||||
1 :
|
||||
0;
|
||||
break;
|
||||
case 4:
|
||||
if (regset->arena->size - off - 1 >= 0) {
|
||||
memcpy (&v8, regset->arena->bytes + off, 1);
|
||||
ret = v8 & 0xF;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
if (regset->arena->size - off - 1 >= 0) {
|
||||
memcpy (&v8, regset->arena->bytes + off, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user