gdb_server,rtos: Differentiate rtos_get_gdb_reg failing and not implemented

If it fails, then pass that failure on. If it's simply not implemented,
then we can fall through and try target_get_gdb_reg_list_noread().

This difference matters when the target representing the current
hwthread is unavailable, but the target that is linked to the gdb
connection is available. In that case we want the operation to return an
error to gdb, instead of reading the register from the target that is
available.

Change-Id: I9c84ca556f818c5580e25ab349a34a226fcf0f43
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9138
Tested-by: jenkins
Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
Tim Newsome
2023-09-14 13:04:39 -07:00
committed by Tomas Vanek
parent 31b2660152
commit 4447fa4c98
2 changed files with 8 additions and 3 deletions

View File

@@ -600,7 +600,7 @@ int rtos_get_gdb_reg(struct connection *connection, int reg_num)
free(reg_list);
}
return ERROR_FAIL;
return ERROR_NOT_IMPLEMENTED;
}
/** Return a list of general registers. */