* [Qemu-devel] [PATCH] gdb-xml: fix hacks in powerpc register numbering
@ 2009-06-05 2:02 Nathan Froyd
2009-06-23 15:35 ` Nathan Froyd
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Nathan Froyd @ 2009-06-05 2:02 UTC (permalink / raw)
To: qemu-devel
The powerpc xml files contained a hack--an empty, non-existent
register--for getting the register numbers to line up for
newer (XML-aware) and older (non-XML-aware) GDB. While this hack worked
in some cases, it didn't work in all cases, notably when the user used
`finish' or `continue': GDB would attempt to read the non-existent
register and QEMU would complain.
This patch fixes things up properly. Instead of inserting a fake
register, we explicitly declare the floating-point and SPE registers to
start at 71. This action accomplishes the same thing as the nasty hack,
except that now GDB never tries to fetch the non-existant register 70.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
---
gdb-xml/power-core.xml | 9 ---------
gdb-xml/power-fpu.xml | 2 +-
gdb-xml/power-spe.xml | 2 +-
gdb-xml/power64-core.xml | 9 ---------
4 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/gdb-xml/power-core.xml b/gdb-xml/power-core.xml
index dae13a6..0c69e8c 100644
--- a/gdb-xml/power-core.xml
+++ b/gdb-xml/power-core.xml
@@ -46,13 +46,4 @@
<reg name="lr" bitsize="32" type="code_ptr"/>
<reg name="ctr" bitsize="32" type="uint32"/>
<reg name="xer" bitsize="32" type="uint32"/>
- <!-- HACK: The way the QEMU GDB stub code is currently written requires
- the "integer" registers from the XML file to span the entirety of
- NUM_CORE_REGS that non-XML-aware GDB requires. Otherwise, XML-aware
- GDB thinks that "coprocessor" registers from XML, such as the
- floating-point registers, have register numbers less than
- NUM_CORE_REGS. This can lead to problems. Work around it by using
- an unnamed register as padding; NUM_CORE_REGS on Power is 71 and
- this register is 70. It would be fpscr for non-XML-aware GDB. -->
- <reg name="" bitsize="32" type="uint32"/>
</feature>
diff --git a/gdb-xml/power-fpu.xml b/gdb-xml/power-fpu.xml
index d1ca3a3..3870551 100644
--- a/gdb-xml/power-fpu.xml
+++ b/gdb-xml/power-fpu.xml
@@ -7,7 +7,7 @@
<!DOCTYPE feature SYSTEM "gdb-target.dtd">
<feature name="org.gnu.gdb.power.fpu">
- <reg name="f0" bitsize="64" type="ieee_double"/>
+ <reg name="f0" bitsize="64" type="ieee_double" regnum="71"/>
<reg name="f1" bitsize="64" type="ieee_double"/>
<reg name="f2" bitsize="64" type="ieee_double"/>
<reg name="f3" bitsize="64" type="ieee_double"/>
diff --git a/gdb-xml/power-spe.xml b/gdb-xml/power-spe.xml
index 1ec15d6..57740cc 100644
--- a/gdb-xml/power-spe.xml
+++ b/gdb-xml/power-spe.xml
@@ -7,7 +7,7 @@
<!DOCTYPE feature SYSTEM "gdb-target.dtd">
<feature name="org.gnu.gdb.power.spe">
- <reg name="ev0h" bitsize="32"/>
+ <reg name="ev0h" bitsize="32" regnum="71"/>
<reg name="ev1h" bitsize="32"/>
<reg name="ev2h" bitsize="32"/>
<reg name="ev3h" bitsize="32"/>
diff --git a/gdb-xml/power64-core.xml b/gdb-xml/power64-core.xml
index fef42e4..6cc1531 100644
--- a/gdb-xml/power64-core.xml
+++ b/gdb-xml/power64-core.xml
@@ -46,13 +46,4 @@
<reg name="lr" bitsize="64" type="code_ptr"/>
<reg name="ctr" bitsize="64" type="uint64"/>
<reg name="xer" bitsize="32" type="uint32"/>
- <!-- HACK: The way the QEMU GDB stub code is currently written requires
- the "integer" registers from the XML file to span the entirety of
- NUM_CORE_REGS that non-XML-aware GDB requires. Otherwise, XML-aware
- GDB thinks that "coprocessor" registers from XML, such as the
- floating-point registers, have register numbers less than
- NUM_CORE_REGS. This can lead to problems. Work around it by using
- an unnamed register as padding; NUM_CORE_REGS on Power is 71 and
- this register is 70. It would be fpscr for non-XML-aware GDB. -->
- <reg name="" bitsize="32" type="uint32"/>
</feature>
--
1.6.3.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] gdb-xml: fix hacks in powerpc register numbering
2009-06-05 2:02 [Qemu-devel] [PATCH] gdb-xml: fix hacks in powerpc register numbering Nathan Froyd
@ 2009-06-23 15:35 ` Nathan Froyd
2009-07-07 16:04 ` Nathan Froyd
2009-07-12 21:42 ` Aurelien Jarno
2 siblings, 0 replies; 4+ messages in thread
From: Nathan Froyd @ 2009-06-23 15:35 UTC (permalink / raw)
To: qemu-devel
On Thu, Jun 04, 2009 at 07:02:28PM -0700, Nathan Froyd wrote:
> The powerpc xml files contained a hack--an empty, non-existent
> register--for getting the register numbers to line up for
> newer (XML-aware) and older (non-XML-aware) GDB. While this hack worked
> in some cases, it didn't work in all cases, notably when the user used
> `finish' or `continue': GDB would attempt to read the non-existent
> register and QEMU would complain.
>
> This patch fixes things up properly. Instead of inserting a fake
> register, we explicitly declare the floating-point and SPE registers to
> start at 71. This action accomplishes the same thing as the nasty hack,
> except that now GDB never tries to fetch the non-existant register 70.
Ping. It would be nice to get this in prior to the stable 0.11.0
release.
-Nathan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] gdb-xml: fix hacks in powerpc register numbering
2009-06-05 2:02 [Qemu-devel] [PATCH] gdb-xml: fix hacks in powerpc register numbering Nathan Froyd
2009-06-23 15:35 ` Nathan Froyd
@ 2009-07-07 16:04 ` Nathan Froyd
2009-07-12 21:42 ` Aurelien Jarno
2 siblings, 0 replies; 4+ messages in thread
From: Nathan Froyd @ 2009-07-07 16:04 UTC (permalink / raw)
To: qemu-devel
On Thu, Jun 04, 2009 at 07:02:28PM -0700, Nathan Froyd wrote:
> The powerpc xml files contained a hack--an empty, non-existent
> register--for getting the register numbers to line up for
> newer (XML-aware) and older (non-XML-aware) GDB. While this hack worked
> in some cases, it didn't work in all cases, notably when the user used
> `finish' or `continue': GDB would attempt to read the non-existent
> register and QEMU would complain.
>
> This patch fixes things up properly. Instead of inserting a fake
> register, we explicitly declare the floating-point and SPE registers to
> start at 71. This action accomplishes the same thing as the nasty hack,
> except that now GDB never tries to fetch the non-existant register 70.
Ping again. It would be nice to get this in prior to the stable 0.11.0
release.
-Nathan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] gdb-xml: fix hacks in powerpc register numbering
2009-06-05 2:02 [Qemu-devel] [PATCH] gdb-xml: fix hacks in powerpc register numbering Nathan Froyd
2009-06-23 15:35 ` Nathan Froyd
2009-07-07 16:04 ` Nathan Froyd
@ 2009-07-12 21:42 ` Aurelien Jarno
2 siblings, 0 replies; 4+ messages in thread
From: Aurelien Jarno @ 2009-07-12 21:42 UTC (permalink / raw)
To: Nathan Froyd; +Cc: qemu-devel
On Thu, Jun 04, 2009 at 07:02:28PM -0700, Nathan Froyd wrote:
> The powerpc xml files contained a hack--an empty, non-existent
> register--for getting the register numbers to line up for
> newer (XML-aware) and older (non-XML-aware) GDB. While this hack worked
> in some cases, it didn't work in all cases, notably when the user used
> `finish' or `continue': GDB would attempt to read the non-existent
> register and QEMU would complain.
>
> This patch fixes things up properly. Instead of inserting a fake
> register, we explicitly declare the floating-point and SPE registers to
> start at 71. This action accomplishes the same thing as the nasty hack,
> except that now GDB never tries to fetch the non-existant register 70.
Thanks, applied.
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-07-12 21:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-05 2:02 [Qemu-devel] [PATCH] gdb-xml: fix hacks in powerpc register numbering Nathan Froyd
2009-06-23 15:35 ` Nathan Froyd
2009-07-07 16:04 ` Nathan Froyd
2009-07-12 21:42 ` Aurelien Jarno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).