This is an automated email from Gerrit.

"zapb <d...@zapb.de>" just uploaded a new patch set to Gerrit, which you can 
find at https://review.openocd.org/c/openocd/+/8314

-- gerrit

commit 7e3516410337f54a822e38be30bb2ca02350bbe3
Author: Marc Schink <d...@zapb.de>
Date:   Sun Jun 2 14:39:36 2024 +0100

    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 <d...@zapb.de>

diff --git a/src/target/target.c b/src/target/target.c
index efc168903b..8ef4bf2cc6 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 \"\" \"\"");

-- 

Reply via email to