From 9d4df3420c51e75bcc1d6162fc9cc680d6fd2481 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Wed, 26 Apr 2017 15:09:24 -0700 Subject: [PATCH] Initialize all registers in examine I'm not sure why this is necessary, but for some reason GDB is asking for registers before OpenOCD thinks there's been a halt. This is really just a workaround, but I need to refactor the v0.11 stuff anyway so I don't want to figure it out. --- src/target/riscv/riscv-011.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/target/riscv/riscv-011.c b/src/target/riscv/riscv-011.c index 10612e22c..8663082b2 100644 --- a/src/target/riscv/riscv-011.c +++ b/src/target/riscv/riscv-011.c @@ -1910,6 +1910,9 @@ static int examine(struct target *target) } target_set_examined(target); + riscv_set_current_hartid(target, 0); + for (size_t i = 0; i < 32; ++i) + reg_cache_set(target, i, -1); LOG_INFO("Examined RISCV core; XLEN=%d, misa=0x%" PRIx64, riscv_xlen(target), info->misa); return ERROR_OK;