diff options
author | 2009-09-17 18:38:49 +0200 | |
---|---|---|
committer | 2009-09-18 13:02:38 -0300 | |
commit | 8acf636ec57d0cc83c50f5540de19f7a184d0eae (patch) | |
tree | 145dbdf4ffb145c17288827b735155227390b31f /target-i386/cpu.h | |
parent | qemu-kvm: fix -daemonize (diff) | |
download | qemu-kvm-8acf636ec57d0cc83c50f5540de19f7a184d0eae.tar.gz qemu-kvm-8acf636ec57d0cc83c50f5540de19f7a184d0eae.tar.bz2 qemu-kvm-8acf636ec57d0cc83c50f5540de19f7a184d0eae.zip |
gdbstub: x86: Switch 64/32 bit registers dynamically
Commit 56aebc891674cd2d07b3f64183415697be200084 changed gdbstub in way
that debugging 32 or 16-bit guest code is no longer possible with qemu
for x86_64 guest CPUs. Since that commit, qemu only provides registers
sets for 64-bit, forcing current and foreseeable gdb to also switch its
architecture to 64-bit. And this breaks if the inferior is 32 or 16 bit.
No question, this is a gdb issue. But, as it was confirmed in several
discusssions with gdb people, it is a non-trivial thing to fix. So until
qemu finds a gdb version attach with a rework x86 support, we have to
work around it by switching the register layout as the guest switches
its execution mode between 16/32 and 64 bit.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-i386/cpu.h')
-rw-r--r-- | target-i386/cpu.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/target-i386/cpu.h b/target-i386/cpu.h index b9a6392cf..4506d7377 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -555,10 +555,13 @@ typedef union { #endif #define MMX_Q(n) q +#define CPU_NB_REGS64 16 +#define CPU_NB_REGS32 8 + #ifdef TARGET_X86_64 -#define CPU_NB_REGS 16 +#define CPU_NB_REGS CPU_NB_REGS64 #else -#define CPU_NB_REGS 8 +#define CPU_NB_REGS CPU_NB_REGS32 #endif #define NB_MMU_MODES 2 |