aboutsummaryrefslogtreecommitdiff
path: root/src/target/target.c
diff options
context:
space:
mode:
authorSpencer Oliver <spen@spen-soft.co.uk>2013-02-25 16:52:00 +0000
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>2013-03-06 19:04:31 +0000
commitdcfa3ac7c7e116d5ff70f7c69d4eff80b3495443 (patch)
tree6803712a6ce49bcced7e10cfe0078af7018cc8b4 /src/target/target.c
parentef83a9ee9371f330075a5cb57b0dd515d75df8c2 (diff)
target: use common target_name to access target::cmd_name member
Change-Id: I203b89ef25a072c3b00b504483d5f2a83477fad6 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1182 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Diffstat (limited to 'src/target/target.c')
-rw-r--r--src/target/target.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/target/target.c b/src/target/target.c
index d768fda7..e964f522 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -379,9 +379,9 @@ struct target *get_target(const char *id)
/* try as tcltarget name */
for (target = all_targets; target; target = target->next) {
- if (target->cmd_name == NULL)
+ if (target_name(target) == NULL)
continue;
- if (strcmp(id, target->cmd_name) == 0)
+ if (strcmp(id, target_name(target)) == 0)
return target;
}
@@ -395,7 +395,7 @@ struct target *get_target(const char *id)
for (target = all_targets; target; target = target->next) {
if (target->target_number == (int)num) {
LOG_WARNING("use '%s' as target identifier, not '%u'",
- target->cmd_name, num);
+ target_name(target), num);
return target;
}
}
@@ -982,7 +982,7 @@ int target_add_breakpoint(struct target *target,
struct breakpoint *breakpoint)
{
if ((target->state != TARGET_HALTED) && (breakpoint->type != BKPT_HARD)) {
- LOG_WARNING("target %s is not halted", target->cmd_name);
+ LOG_WARNING("target %s is not halted", target_name(target));
return ERROR_TARGET_NOT_HALTED;
}
return target->type->add_breakpoint(target, breakpoint);
@@ -992,7 +992,7 @@ int target_add_context_breakpoint(struct target *target,
struct breakpoint *breakpoint)
{
if (target->state != TARGET_HALTED) {
- LOG_WARNING("target %s is not halted", target->cmd_name);
+ LOG_WARNING("target %s is not halted", target_name(target));
return ERROR_TARGET_NOT_HALTED;
}
return target->type->add_context_breakpoint(target, breakpoint);
@@ -1002,7 +1002,7 @@ int target_add_hybrid_breakpoint(struct target *target,
struct breakpoint *breakpoint)
{
if (target->state != TARGET_HALTED) {
- LOG_WARNING("target %s is not halted", target->cmd_name);
+ LOG_WARNING("target %s is not halted", target_name(target));
return ERROR_TARGET_NOT_HALTED;
}
return target->type->add_hybrid_breakpoint(target, breakpoint);
@@ -1018,7 +1018,7 @@ int target_add_watchpoint(struct target *target,
struct watchpoint *watchpoint)
{
if (target->state != TARGET_HALTED) {
- LOG_WARNING("target %s is not halted", target->cmd_name);
+ LOG_WARNING("target %s is not halted", target_name(target));
return ERROR_TARGET_NOT_HALTED;
}
return target->type->add_watchpoint(target, watchpoint);
@@ -5071,7 +5071,7 @@ static int jim_target_current(Jim_Interp *interp, int argc, Jim_Obj *const *argv
struct command_context *cmd_ctx = current_command_context(interp);
assert(cmd_ctx != NULL);
- Jim_SetResultString(interp, get_current_target(cmd_ctx)->cmd_name, -1);
+ Jim_SetResultString(interp, target_name(get_current_target(cmd_ctx)), -1);
return JIM_OK;
}