gdbstub: Fix gdb_register_coprocessor() register counting
authorAndreas Färber <afaerber@suse.de>
Mon, 12 Aug 2013 16:09:47 +0000 (18:09 +0200)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 7 Nov 2013 04:48:34 +0000 (13:48 +0900)
commitf7c6c062eef1d4011b9c7e93982af316396763cd
tree67959b3aac035ebd9d86d45698f06de90de09b50
parent3f27cde49ba42f14b6e95ebd0695e414f3adabc3
gdbstub: Fix gdb_register_coprocessor() register counting

Commit a0e372f0c49ac01faeaeb73a6e8f50e8ac615f34 reorganized the register
counting for GDB. While it seems correct not to let the total number of
registers skyrocket in an SMP scenario through a static variable, the
distinction between total register count and 'g' packet register count
(last_reg vs. num_g_regs) got lost among the way.

Fix this by introducing CPUState::gdb_num_g_regs and using that in
gdb_handle_packet().

Reported-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: qemu-stable@nongnu.org (stable-1.6)
Tested-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Tested-by: Max Filippov <jcmvbkbc@gmail.com>
Tested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
(cherry picked from commit 35143f0164e6933a85c7c2b8a89a040d881a9151)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
gdbstub.c
include/qom/cpu.h
qom/cpu.c