target: use target_event_name()
We have the API target_event_name(). Use it to improve code readability. Change-Id: Ic48d2227bdefe9af05aff99a871a45e0612e5254 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6790 Tested-by: jenkins
This commit is contained in:
parent
492ac453ab
commit
e3bda57982
|
@ -1834,7 +1834,7 @@ int target_call_event_callbacks(struct target *target, enum target_event event)
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DEBUG("target event %i (%s) for core %s", event,
|
LOG_DEBUG("target event %i (%s) for core %s", event,
|
||||||
jim_nvp_value2name_simple(nvp_target_event, event)->name,
|
target_event_name(event),
|
||||||
target_name(target));
|
target_name(target));
|
||||||
|
|
||||||
target_handle_event(target, event);
|
target_handle_event(target, event);
|
||||||
|
@ -4816,7 +4816,7 @@ void target_handle_event(struct target *target, enum target_event e)
|
||||||
target_name(target),
|
target_name(target),
|
||||||
target_type_name(target),
|
target_type_name(target),
|
||||||
e,
|
e,
|
||||||
jim_nvp_value2name_simple(nvp_target_event, e)->name,
|
target_event_name(e),
|
||||||
Jim_GetString(teap->body, NULL));
|
Jim_GetString(teap->body, NULL));
|
||||||
|
|
||||||
/* Override current target by the target an event
|
/* Override current target by the target an event
|
||||||
|
@ -4840,7 +4840,7 @@ void target_handle_event(struct target *target, enum target_event e)
|
||||||
if (retval != JIM_OK) {
|
if (retval != JIM_OK) {
|
||||||
Jim_MakeErrorMessage(teap->interp);
|
Jim_MakeErrorMessage(teap->interp);
|
||||||
LOG_USER("Error executing event %s on target %s:\n%s",
|
LOG_USER("Error executing event %s on target %s:\n%s",
|
||||||
jim_nvp_value2name_simple(nvp_target_event, e)->name,
|
target_event_name(e),
|
||||||
target_name(target),
|
target_name(target),
|
||||||
Jim_GetString(Jim_GetResult(teap->interp), NULL));
|
Jim_GetString(Jim_GetResult(teap->interp), NULL));
|
||||||
/* clean both error code and stacktrace before return */
|
/* clean both error code and stacktrace before return */
|
||||||
|
@ -5503,9 +5503,9 @@ COMMAND_HANDLER(handle_target_event_list)
|
||||||
command_print(CMD, "------------------------- | "
|
command_print(CMD, "------------------------- | "
|
||||||
"----------------------------------------");
|
"----------------------------------------");
|
||||||
while (teap) {
|
while (teap) {
|
||||||
struct jim_nvp *opt = jim_nvp_value2name_simple(nvp_target_event, teap->event);
|
|
||||||
command_print(CMD, "%-25s | %s",
|
command_print(CMD, "%-25s | %s",
|
||||||
opt->name, Jim_GetString(teap->body, NULL));
|
target_event_name(teap->event),
|
||||||
|
Jim_GetString(teap->body, NULL));
|
||||||
teap = teap->next;
|
teap = teap->next;
|
||||||
}
|
}
|
||||||
command_print(CMD, "***END***");
|
command_print(CMD, "***END***");
|
||||||
|
|
Loading…
Reference in New Issue