From 8b61811a75d9ee2a8a53be28f8bcfa29f756d286 Mon Sep 17 00:00:00 2001 From: pancake Date: Wed, 11 May 2016 15:38:26 +0200 Subject: [PATCH] Do not set asm.bits depending on CPSR to give more freedom to the user --- libr/core/cmd_anal.c | 10 +++++++--- libr/debug/reg.c | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libr/core/cmd_anal.c b/libr/core/cmd_anal.c index 25f5153f8e..cc01b82080 100644 --- a/libr/core/cmd_anal.c +++ b/libr/core/cmd_anal.c @@ -1343,10 +1343,12 @@ static void __anal_reg_list(RCore *core, int type, int size, char mode) { int pcbits = 0; const char *pcname = r_reg_get_name (core->anal->reg, R_REG_NAME_PC); RRegItem *reg = r_reg_get (core->anal->reg, pcname, 0); - if (bits != reg->size) + if (bits != reg->size) { pcbits = reg->size; - if (pcbits) + } + if (pcbits) { r_debug_reg_list (core->dbg, R_REG_TYPE_GPR, pcbits, 2, use_color); // XXX detect which one is current usage + } } r_debug_reg_list (core->dbg, type, bits, mode, use_color); core->dbg->reg = hack; @@ -2063,7 +2065,9 @@ static bool cmd_aea(RCore* core, int mode, ut64 addr, int length) { if (!core) return false; maxopsize = r_anal_archinfo (core->anal, R_ANAL_ARCHINFO_MAX_OP_SIZE); - if (maxopsize < 1) maxopsize = 16; + if (maxopsize < 1) { + maxopsize = 16; + } if (mode & 1) { // number of bytes / length buf_sz = length; diff --git a/libr/debug/reg.c b/libr/debug/reg.c index 6b72c4bdf1..1a430e6139 100644 --- a/libr/debug/reg.c +++ b/libr/debug/reg.c @@ -108,7 +108,9 @@ R_API int r_debug_reg_list(RDebug *dbg, int type, int size, int rad, const char if (!head) continue; r_list_foreach (head, iter, item) { ut64 value; - +#if 0 + /* the thumb flag in the cpsr register shouldnt forbid us to switch between arm or thumb */ + /* this code must run only after a step maybe ... need some discussion, disabling for now */ if (is_arm && (rad == 1 || rad == '*') && item->size == 1) { if (!strcmp (item->name, "tf")) { bool is_thumb = r_reg_get_value (dbg->reg, item); @@ -118,6 +120,7 @@ R_API int r_debug_reg_list(RDebug *dbg, int type, int size, int rad, const char } continue; } +#endif if (type != -1) { if (type != item->type) continue;