diff options
author | Marc Schink <dev@zapb.de> | 2024-06-02 14:39:36 +0100 |
---|---|---|
committer | Tomas Vanek <vanekt@fbl.cz> | 2024-06-17 14:05:25 +0000 |
commit | c5358c84ad0d3e7497498e0457cec7785f72910a (patch) | |
tree | 56a788edd8fdfbff030919dafcadea9dd6ea763e | |
parent | 4892e32294c6ea4cf53251adb81dee4e85aee0b0 (diff) | |
download | riscv-openocd-c5358c84ad0d3e7497498e0457cec7785f72910a.zip riscv-openocd-c5358c84ad0d3e7497498e0457cec7785f72910a.tar.gz riscv-openocd-c5358c84ad0d3e7497498e0457cec7785f72910a.tar.bz2 |
target: Do not use LOG_USER() for error messages
Use LOG_TARGET_ERROR() to print the error messages and additionally add
a reference to the related target.
Change-Id: I06722f3911ef4034fdd05dc9b0e2571b01b657a4
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8314
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
-rw-r--r-- | src/target/target.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/target/target.c b/src/target/target.c index 7d4947a..1f4817d 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -2997,14 +2997,14 @@ static int handle_target(void *priv) target_call_event_callbacks(target, TARGET_EVENT_GDB_HALT); } if (target->backoff.times > 0) { - LOG_USER("Polling target %s failed, trying to reexamine", target_name(target)); + LOG_TARGET_ERROR(target, "Polling failed, trying to reexamine"); target_reset_examined(target); retval = target_examine_one(target); /* Target examination could have failed due to unstable connection, * but we set the examined flag anyway to repoll it later */ if (retval != ERROR_OK) { target_set_examined(target); - LOG_USER("Examination failed, GDB will be halted. Polling again in %dms", + LOG_TARGET_ERROR(target, "Examination failed, GDB will be halted. Polling again in %dms", target->backoff.times * polling_interval); return retval; } @@ -4691,9 +4691,8 @@ void target_handle_event(struct target *target, enum target_event e) if (retval != JIM_OK) { Jim_MakeErrorMessage(teap->interp); - LOG_USER("Error executing event %s on target %s:\n%s", + LOG_TARGET_ERROR(target, "Execution of event %s failed:\n%s", target_event_name(e), - target_name(target), Jim_GetString(Jim_GetResult(teap->interp), NULL)); /* clean both error code and stacktrace before return */ Jim_Eval(teap->interp, "error \"\" \"\""); |