Fix comment about saving the temporary register in examine procedure.

This commit is contained in:
Dmitry Ryzhov 2017-07-01 15:09:23 +03:00
parent 7d451e00f5
commit 99a3673507
1 changed files with 6 additions and 2 deletions

View File

@ -1177,8 +1177,12 @@ static int examine(struct target *target)
/* This program uses a temporary register. If the core can not /* This program uses a temporary register. If the core can not
* execute 64 bit instruction, the original value of temporary * execute 64 bit instruction, the original value of temporary
* register will not be restored due to an exception. So we have to * register (s0) will not be restored due to an exception.
* restore it manually in that case. */ * So we have to save it and restore manually in that case.
* If the core can execute 64 bit instruction, the saved value
* is wrong, because it was read with 32 bit lw instruction,
* but the value of s0 will be restored by the reverse swap
* of s0 and dscratch registers. */
uint64_t s0 = riscv_get_register(target, GDB_REGNO_S0); uint64_t s0 = riscv_get_register(target, GDB_REGNO_S0);
struct riscv_program program64; struct riscv_program program64;