diff options
author | David Hildenbrand <dahi@linux.vnet.ibm.com> | 2014-08-29 15:52:14 +0200 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2014-09-01 09:45:19 +0200 |
commit | 97fa52f0971bf503c424d69f9d5db89ce9c3b717 (patch) | |
tree | f355d67172c2658a77862ac850747b1939ee3a18 /target-s390x | |
parent | 1def6656b61c65757a02beb0318249e0b1c4e634 (diff) |
s390x/gdb: don't touch the cc if tcg is not enabled
When reading/writing the psw mask, the condition code may only be touched if
running on tcg.
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'target-s390x')
-rw-r--r-- | target-s390x/gdbstub.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/target-s390x/gdbstub.c b/target-s390x/gdbstub.c index a129742e2f..8d55006706 100644 --- a/target-s390x/gdbstub.c +++ b/target-s390x/gdbstub.c @@ -31,9 +31,13 @@ int s390_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n) switch (n) { case S390_PSWM_REGNUM: - cc_op = calc_cc(env, env->cc_op, env->cc_src, env->cc_dst, env->cc_vr); - val = deposit64(env->psw.mask, 44, 2, cc_op); - return gdb_get_regl(mem_buf, val); + if (tcg_enabled()) { + cc_op = calc_cc(env, env->cc_op, env->cc_src, env->cc_dst, + env->cc_vr); + val = deposit64(env->psw.mask, 44, 2, cc_op); + return gdb_get_regl(mem_buf, val); + } + return gdb_get_regl(mem_buf, env->psw.mask); case S390_PSWA_REGNUM: return gdb_get_regl(mem_buf, env->psw.addr); case S390_R0_REGNUM ... S390_R15_REGNUM: @@ -62,7 +66,9 @@ int s390_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) switch (n) { case S390_PSWM_REGNUM: env->psw.mask = tmpl; - env->cc_op = extract64(tmpl, 44, 2); + if (tcg_enabled()) { + env->cc_op = extract64(tmpl, 44, 2); + } break; case S390_PSWA_REGNUM: env->psw.addr = tmpl; |