This is an automated email from Gerrit.

"Anatoly Parshintsev <kupokupokup...@gmail.com>" just uploaded a new patch set 
to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/7886

-- gerrit

commit 731c3ae94af9b104d2a7d0003a401888f6b9e4b1
Author: Parshintsev Anatoly <anatoly.parshint...@syntacore.com>
Date:   Tue Sep 5 21:08:02 2023 +0300

    target: return error if attempting to access non-existing registers
    
    Change-Id: Ic22edcab46d21dbc71f78275a78bdea9c2bcc394
    Signed-off-by: Parshintsev Anatoly <anatoly.parshint...@syntacore.com>

diff --git a/src/target/target.c b/src/target/target.c
index 96f4ae7d3e..630b21caaa 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -3116,7 +3116,7 @@ COMMAND_HANDLER(handle_reg_command)
                if (!reg) {
                        command_print(CMD, "%i is out of bounds, the current 
target "
                                        "has only %i registers (0 - %i)", num, 
count, count - 1);
-                       return ERROR_OK;
+                       return ERROR_FAIL;
                }
        } else {
                /* access a single register by its name */
@@ -3175,7 +3175,7 @@ COMMAND_HANDLER(handle_reg_command)
 
 not_found:
        command_print(CMD, "register %s not found in current target", 
CMD_ARGV[0]);
-       return ERROR_OK;
+       return ERROR_FAIL;
 }
 
 COMMAND_HANDLER(handle_poll_command)

-- 

Reply via email to