diff options
author | Parshintsev Anatoly <anatoly.parshintsev@syntacore.com> | 2023-07-30 15:35:45 +0300 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2023-10-14 12:06:40 +0000 |
commit | c7d1f0ddabb301e00738686671b939bb92a06ed9 (patch) | |
tree | da2c7af4fa9335e43a4869d2b4b36a595f26f5f9 /src/target | |
parent | 14b1b35e4247091f1e90311f9b61805ae1f6f34d (diff) | |
download | riscv-openocd-c7d1f0ddabb301e00738686671b939bb92a06ed9.zip riscv-openocd-c7d1f0ddabb301e00738686671b939bb92a06ed9.tar.gz riscv-openocd-c7d1f0ddabb301e00738686671b939bb92a06ed9.tar.bz2 |
target: check if target is not examined on reg command
Change-Id: I46093c85374986a36d10eaac38b98bd5e05835ca
Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7841
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Marek Vrbka <marek.vrbka@codasip.com>
Diffstat (limited to 'src/target')
-rw-r--r-- | src/target/target.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/target/target.c b/src/target/target.c index dfa86fd..10d0088 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -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 */ |