ARMv7-A: tweak arch_state()
authorDavid Brownell <dbrownell@users.sourceforge.net>
Fri, 4 Dec 2009 00:18:24 +0000 (16:18 -0800)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Fri, 4 Dec 2009 00:18:24 +0000 (16:18 -0800)
Punt to the armv4_5_arch_state() for all the common stuff, to
shrink code and so we will get any improvements it provides.

Don't hide watchpoint status if we happen to be in "abort" mode.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
src/target/armv7a.c

index 5d3976f57522ca111aa657a77003103aee57be0e..e889a8a130003e00b773846d52871103f78fcc59 100644 (file)
@@ -98,22 +98,16 @@ int armv7a_arch_state(struct target *target)
                return ERROR_INVALID_ARGUMENTS;
        }
 
-       LOG_USER("target halted in %s state due to %s, current mode: %s\n"
-                        "cpsr: 0x%8.8" PRIx32 " pc: 0x%8.8" PRIx32 "\n"
-                        "MMU: %s, D-Cache: %s, I-Cache: %s",
-                armv4_5_state_strings[armv4_5->core_state],
-                Jim_Nvp_value2name_simple(nvp_target_debug_reason,
-                               target->debug_reason)->name,
-                arm_mode_name(armv4_5->core_mode),
-                buf_get_u32(armv4_5->cpsr->value, 0, 32),
-                buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32),
+       armv4_5_arch_state(target);
+
+       LOG_USER("MMU: %s, D-Cache: %s, I-Cache: %s",
                 state[armv7a->armv4_5_mmu.mmu_enabled],
                 state[armv7a->armv4_5_mmu.armv4_5_cache.d_u_cache_enabled],
                 state[armv7a->armv4_5_mmu.armv4_5_cache.i_cache_enabled]);
 
        if (armv4_5->core_mode == ARMV4_5_MODE_ABT)
                armv7a_show_fault_registers(target);
-       else if (target->debug_reason == DBG_REASON_WATCHPOINT)
+       if (target->debug_reason == DBG_REASON_WATCHPOINT)
                LOG_USER("Watchpoint triggered at PC %#08x",
                                (unsigned) armv7a->dpm.wp_pc);