Merge pull request #924 from riscv/unavailable_step

server/gdb_server: Step unavailable targets.
This commit is contained in:
Tim Newsome 2023-10-05 12:12:16 -07:00 committed by GitHub
commit 28f630d245
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -3176,9 +3176,15 @@ static bool gdb_handle_vcont_packet(struct connection *connection, const char *p
return true; return true;
} }
if (ct->state == TARGET_UNAVAILABLE) {
LOG_TARGET_ERROR(ct, "Target is unavailable, so cannot be stepped. "
"Pretending to gdb that it is running until it's available again.");
retval = ERROR_FAIL;
} else {
retval = target_step(ct, current_pc, 0, 0); retval = target_step(ct, current_pc, 0, 0);
if (retval == ERROR_TARGET_NOT_HALTED) if (retval == ERROR_TARGET_NOT_HALTED)
LOG_INFO("target %s was not halted when step was requested", target_name(ct)); LOG_INFO("target %s was not halted when step was requested", target_name(ct));
}
/* if step was successful send a reply back to gdb */ /* if step was successful send a reply back to gdb */
if (retval == ERROR_OK) { if (retval == ERROR_OK) {