target/loongarch: Extract set_pc() helper

Signed-off-by: Jiajie Chen <c@jia.je>
Co-authored-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230822032724.1353391-6-gaosong@loongson.cn>
[PMD: Extract helper from bigger patch]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230822071405.35386-9-philmd@linaro.org>
This commit is contained in:
Jiajie Chen 2023-08-22 09:13:54 +02:00 committed by Song Gao
parent 5a7ce25d0d
commit 2f6478ffad
No known key found for this signature in database
GPG key ID: 40A2FFF239263EDF
4 changed files with 16 additions and 11 deletions

View file

@ -77,7 +77,7 @@ int loongarch_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
env->gpr[n] = tmp;
length = read_length;
} else if (n == 33) {
env->pc = tmp;
set_pc(env, tmp);
length = read_length;
}
return length;