gdb_actual_connections++;
LOG_DEBUG("New GDB Connection: %d, Target %s, state: %s",
gdb_actual_connections,
- gdb_service->target->cmd_name,
+ target_name(gdb_service->target),
target_state_name(gdb_service->target));
return ERROR_OK;
gdb_actual_connections--;
LOG_DEBUG("GDB Close, Target: %s, state: %s, gdb_actual_connections=%d",
- gdb_service->target->cmd_name,
+ target_name(gdb_service->target),
target_state_name(gdb_service->target),
gdb_actual_connections);
watchpoint_clear_target(gdb_service->target);
command_run_linef(connection->cmd_ctx,
"ocd_gdb_restart %s",
- target->cmd_name);
+ target_name(target));
break;
default:
/* ignore unkown packets */
add_service("gdb", CONNECTION_PIPE, 0, 1, gdb_new_connection, gdb_input, gdb_connection_closed, gdb_service);
LOG_DEBUG("gdb service for target %s using pipes",
- target_type_name(target));
+ target_name(target));
}
else
{
gdb_connection_closed, gdb_service);
LOG_DEBUG("gdb service for target %s at TCP port %i",
- target_type_name(target),
+ target_name(target),
port);
target = target->next;
port++;
}
if (!target->type->soft_reset_halt_imp) {
LOG_ERROR("Target %s does not support soft_reset_halt",
- target->cmd_name);
+ target_name(target));
return ERROR_FAIL;
}
return target->type->soft_reset_halt_imp(target);
if ((retval = target->type->init_target(cmd_ctx, target)) != ERROR_OK)
{
- LOG_ERROR("target '%s' init failed", target_type_name(target));
+ LOG_ERROR("target '%s' init failed", target_name(target));
return retval;
}
command_print(CMD_CTX, "%2d%c %-18s %-10s %-6s %-18s %s",
target->target_number,
marker,
- target->cmd_name,
+ target_name(target),
target_type_name(target),
Jim_Nvp_value2name_simple(nvp_target_endian,
target->endianness)->name,
if (teap->event == e) {
LOG_DEBUG("target: (%d) %s (%s) event: %d (%s) action: %s",
target->target_number,
- target->cmd_name,
+ target_name(target),
target_type_name(target),
e,
Jim_Nvp_value2name_simple(nvp_target_event, e)->name,
|| !target->type->deassert_reset) {
Jim_SetResult_sprintf(interp,
"No target-specific reset for %s",
- target->cmd_name);
+ target_name(target));
return JIM_ERR;
}
/* determine if we should halt or not. */
e = target_wait_state(target, n->value, a);
if (e != ERROR_OK) {
Jim_SetResult_sprintf(goi.interp,
- "target: %s wait %s fails (%d) %s",
- target->cmd_name,
- n->name,
- e, target_strerror_safe(e));
+ "target: %s wait %s fails (%d) %s",
+ target_name(target), n->name,
+ e, target_strerror_safe(e));
return JIM_ERR;
} else {
return JIM_OK;
{
struct target_event_action *teap;
teap = target->event_action;
- command_print(cmd_ctx, "Event actions for target (%d) %s\n",
- target->target_number,
- target->cmd_name);
+ command_print(cmd_ctx,
+ "Event actions for target (%d) %s\n",
+ target->target_number,
+ target_name(target));
command_print(cmd_ctx, "%-25s | Body", "Event");
command_print(cmd_ctx, "------------------------- | ----------------------------------------");
while (teap) {
Jim_WrongNumArgs(goi.interp, 1, goi.argv, "Too many parameters");
return JIM_ERR;
}
- Jim_SetResultString(goi.interp, get_current_target(cmd_ctx)->cmd_name, -1);
+ Jim_SetResultString(goi.interp,
+ target_name(get_current_target(cmd_ctx)),
+ -1);
return JIM_OK;
case TG_CMD_TYPES:
if (goi.argc != 0) {
target = all_targets;
while (target) {
Jim_ListAppendElement(goi.interp,
- Jim_GetResult(goi.interp),
- Jim_NewStringObj(goi.interp, target->cmd_name, -1));
+ Jim_GetResult(goi.interp),
+ Jim_NewStringObj(goi.interp,
+ target_name(target), -1));
target = target->next;
}
return JIM_OK;
"Target: number %d does not exist", (int)(w));
return JIM_ERR;
}
- Jim_SetResultString(goi.interp, target->cmd_name, -1);
+ Jim_SetResultString(goi.interp, target_name(target), -1);
return JIM_OK;
case TG_CMD_COUNT:
if (goi.argc != 0) {