swim: abstract the transport in stm8 target
[fw/openocd] / src / target / armv8.c
index e271c1a9242c973fc2ae022740a3d13798aae39c..61f11f24a150f2d753f321fa7b1bdc5f622b274d 100644 (file)
@@ -1054,7 +1054,7 @@ COMMAND_HANDLER(armv8_handle_exception_catch_command)
                        return ERROR_FAIL;
                }
 
-               command_print(CMD_CTX, "Exception Catch: Secure: %s, Non-Secure: %s", sec, nsec);
+               command_print(CMD, "Exception Catch: Secure: %s, Non-Secure: %s", sec, nsec);
                return ERROR_OK;
        }
 
@@ -1079,16 +1079,16 @@ COMMAND_HANDLER(armv8_handle_exception_catch_command)
        return ERROR_OK;
 }
 
-int armv8_handle_cache_info_command(struct command_context *cmd_ctx,
+int armv8_handle_cache_info_command(struct command_invocation *cmd,
        struct armv8_cache_common *armv8_cache)
 {
        if (armv8_cache->info == -1) {
-               command_print(cmd_ctx, "cache not yet identified");
+               command_print(cmd, "cache not yet identified");
                return ERROR_OK;
        }
 
        if (armv8_cache->display_cache_info)
-               armv8_cache->display_cache_info(cmd_ctx, armv8_cache);
+               armv8_cache->display_cache_info(cmd, armv8_cache);
        return ERROR_OK;
 }
 
@@ -1131,8 +1131,9 @@ int armv8_aarch64_state(struct target *target)
                return ERROR_FAIL;
        }
 
-       LOG_USER("target halted in %s state due to %s, current mode: %s\n"
+       LOG_USER("%s halted in %s state due to %s, current mode: %s\n"
                "cpsr: 0x%8.8" PRIx32 " pc: 0x%" PRIx64 "%s",
+               target_name(target),
                armv8_state_strings[arm->core_state],
                debug_reason_name(target),
                armv8_mode_name(arm->core_mode),
@@ -1753,7 +1754,8 @@ const struct command_registration armv8_command_handlers[] = {
 
 const char *armv8_get_gdb_arch(struct target *target)
 {
-       return "aarch64";
+       struct arm *arm = target_to_arm(target);
+       return arm->core_state == ARM_STATE_AARCH64 ? "aarch64" : "arm";
 }
 
 int armv8_get_gdb_reg_list(struct target *target,