target/aarch64: fix watchpoint management
[fw/openocd] / src / target / armv8.c
index e47f6599a7d9abfe885925278b070a79b9648cae..0c5cf346e566e02724438973f6682ffa583c06b1 100644 (file)
@@ -1054,7 +1054,7 @@ COMMAND_HANDLER(armv8_handle_exception_catch_command)
                        nsec = n->name;
 
                if (sec == NULL || nsec == NULL) {
-                       LOG_WARNING("Exception Catch: unknown exception catch configuration: EDECCR = %02x", edeccr & 0xff);
+                       LOG_WARNING("Exception Catch: unknown exception catch configuration: EDECCR = %02" PRIx32, edeccr & 0xff);
                        return ERROR_FAIL;
                }
 
@@ -1098,13 +1098,6 @@ int armv8_handle_cache_info_command(struct command_invocation *cmd,
 
 static int armv8_setup_semihosting(struct target *target, int enable)
 {
-       struct arm *arm = target_to_arm(target);
-
-       if (arm->core_state != ARM_STATE_AARCH64) {
-               LOG_ERROR("semihosting only supported in AArch64 state\n");
-               return ERROR_FAIL;
-       }
-
        return ERROR_OK;
 }
 
@@ -1126,7 +1119,7 @@ int armv8_init_arch_info(struct target *target, struct armv8_common *armv8)
        return ERROR_OK;
 }
 
-int armv8_aarch64_state(struct target *target)
+static int armv8_aarch64_state(struct target *target)
 {
        struct arm *arm = target_to_arm(target);
 
@@ -1176,8 +1169,7 @@ int armv8_arch_state(struct target *target)
                armv8_show_fault_registers(target);
 
        if (target->debug_reason == DBG_REASON_WATCHPOINT)
-               LOG_USER("Watchpoint triggered at PC %#08x",
-                       (unsigned) armv8->dpm.wp_pc);
+               LOG_USER("Watchpoint triggered at " TARGET_ADDR_FMT, armv8->dpm.wp_addr);
 
        return ERROR_OK;
 }