diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c index 8bfe3d5a7..87d23f98a 100644 --- a/src/rtos/rtos.c +++ b/src/rtos/rtos.c @@ -591,7 +591,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. */ diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 41a47bf3c..3d7a47af8 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -1397,8 +1397,13 @@ static int gdb_get_register_packet(struct connection *connection, LOG_DEBUG("-"); #endif - if ((target->rtos) && (rtos_get_gdb_reg(connection, reg_num) == ERROR_OK)) - return ERROR_OK; + if (target->rtos) { + retval = rtos_get_gdb_reg(connection, reg_num); + if (retval == ERROR_OK) + return ERROR_OK; + if (retval != ERROR_NOT_IMPLEMENTED) + return gdb_error(connection, retval); + } retval = target_get_gdb_reg_list_noread(target, ®_list, ®_list_size, REG_CLASS_ALL);