]> Git Repo - qemu.git/commitdiff
gdb-xml: fix hacks in powerpc register numbering
authorNathan Froyd <[email protected]>
Fri, 5 Jun 2009 02:02:28 +0000 (19:02 -0700)
committerAurelien Jarno <[email protected]>
Sun, 12 Jul 2009 21:42:05 +0000 (23:42 +0200)
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 <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
gdb-xml/power-core.xml
gdb-xml/power-fpu.xml
gdb-xml/power-spe.xml
gdb-xml/power64-core.xml

index dae13a67ef3fdd31cf33a7500caa92c6816a9f63..0c69e8c8a791e284e9792ab7b77ba5401c3b3ab8 100644 (file)
   <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>
index d1ca3a3d5c1401c7024a3d3541b74201942daa07..38705515d452a3936deeb9d9cefafb7ee0a61aa3 100644 (file)
@@ -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"/>
index 1ec15d66a1fdc2f9d94f294b3f715230ac2e7944..57740cc5cb7c7587d9e237e81638ec07e773cbe9 100644 (file)
@@ -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"/>
index fef42e416679553d7d071cb42c7f95f6b84e62ae..6cc153120185d91584ff1dc3a0f345023bcbab4b 100644 (file)
   <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>
This page took 0.030063 seconds and 4 git commands to generate.