Skip to content

Commit

Permalink
target: check if target is not examined on reg command
Browse files Browse the repository at this point in the history
Change-Id: I46093c85374986a36d10eaac38b98bd5e05835ca
Signed-off-by: Parshintsev Anatoly <[email protected]>
Reviewed-on: https://review.openocd.org/c/openocd/+/7841
Reviewed-by: Jan Matyas <[email protected]>
Reviewed-by: Antonio Borneo <[email protected]>
Tested-by: jenkins
Reviewed-by: Marek Vrbka <[email protected]>
  • Loading branch information
aap-sc authored and borneoa committed Oct 14, 2023
1 parent 14b1b35 commit c7d1f0d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/target/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -3052,6 +3052,10 @@ COMMAND_HANDLER(handle_reg_command)
LOG_DEBUG("-");

struct target *target = get_current_target(CMD_CTX);
if (!target_was_examined(target)) {
LOG_ERROR("Target not examined yet");
return ERROR_TARGET_NOT_EXAMINED;
}
struct reg *reg = NULL;

/* list all available registers for the current target */
Expand Down

0 comments on commit c7d1f0d

Please sign in to comment.