diff mbox

[4/5] : Enhancements to "flags": i386 cleanup

Message ID 047d7b5dbb865204bd052cf0bc2b@google.com
State New
Headers show

Commit Message

Doug Evans Feb. 29, 2016, 11:09 p.m. UTC
Hi.

This patch just simplifies things by removing the "end" spec in
i386 eflags definitions, and is otherwise a nop.

I removed them because they're redundant.

2016-02-29  Doug Evans  <dje@google.com>

	* features/i386/32bit-core.xml (i386_eflags): Remove "end" spec.
	* features/i386/32bit-sse.xml (i386_eflags): Ditto.
	* features/i386/64bit-core.xml (i386_eflags): Ditto.
	* features/i386/64bit-sse.xml (i386_eflags): Ditto.
	* features/i386/x32-core.xml (i386_eflags): Ditto.

Comments

Pedro Alves July 20, 2016, 6:17 p.m. UTC | #1
Hi Doug,

On 02/29/2016 11:09 PM, Doug Evans wrote:
> Hi.
> 
> This patch just simplifies things by removing the "end" spec in
> i386 eflags definitions, and is otherwise a nop.
> 
> I removed them because they're redundant.
> 

I noticed that this makes older gdbs reject the new target descriptions.
E.g., gdb 7.11.1 against master gdbserver:

 Remote debugging using :9999
 warning: while parsing target description (at line 24): Field "CF" has neither type nor bit position
 warning: Could not load XML target description; ignoring

Reverting the patch makes old gdb grok the tdesc again (git revert 49b7ae7bb8f2).

Since it was meant as a cleanup, I think we should revert
it on grounds of avoiding a back compatibility break.  WDYT?

Thanks,
Pedro Alves

> 2016-02-29  Doug Evans  <dje@google.com>
> 
>     * features/i386/32bit-core.xml (i386_eflags): Remove "end" spec.
>     * features/i386/32bit-sse.xml (i386_eflags): Ditto.
>     * features/i386/64bit-core.xml (i386_eflags): Ditto.
>     * features/i386/64bit-sse.xml (i386_eflags): Ditto.
>     * features/i386/x32-core.xml (i386_eflags): Ditto.
> 
> diff --git a/gdb/features/i386/32bit-core.xml
> b/gdb/features/i386/32bit-core.xml
> index a27863f..b00d913 100644
> --- a/gdb/features/i386/32bit-core.xml
> +++ b/gdb/features/i386/32bit-core.xml
> @@ -8,23 +8,23 @@
>  <!DOCTYPE feature SYSTEM "gdb-target.dtd">
>  <feature name="org.gnu.gdb.i386.core">
>    <flags id="i386_eflags" size="4">
> -    <field name="CF" start="0" end="0"/>
> -    <field name="" start="1" end="1"/>
> -    <field name="PF" start="2" end="2"/>
> -    <field name="AF" start="4" end="4"/>
> -    <field name="ZF" start="6" end="6"/>
> -    <field name="SF" start="7" end="7"/>
> -    <field name="TF" start="8" end="8"/>
> -    <field name="IF" start="9" end="9"/>
> -    <field name="DF" start="10" end="10"/>
> -    <field name="OF" start="11" end="11"/>
> -    <field name="NT" start="14" end="14"/>
> -    <field name="RF" start="16" end="16"/>
> -    <field name="VM" start="17" end="17"/>
> -    <field name="AC" start="18" end="18"/>
> -    <field name="VIF" start="19" end="19"/>
> -    <field name="VIP" start="20" end="20"/>
> -    <field name="ID" start="21" end="21"/>
> +    <field name="CF" start="0"/>
> +    <field name="" start="1"/>
> +    <field name="PF" start="2"/>
> +    <field name="AF" start="4"/>
> +    <field name="ZF" start="6"/>
> +    <field name="SF" start="7"/>
> +    <field name="TF" start="8"/>
> +    <field name="IF" start="9"/>
> +    <field name="DF" start="10"/>
> +    <field name="OF" start="11"/>
> +    <field name="NT" start="14"/>
> +    <field name="RF" start="16"/>
> +    <field name="VM" start="17"/>
> +    <field name="AC" start="18"/>
> +    <field name="VIF" start="19"/>
> +    <field name="VIP" start="20"/>
> +    <field name="ID" start="21"/>
>    </flags>
> 
>    <reg name="eax" bitsize="32" type="int32"/>
> diff --git a/gdb/features/i386/32bit-sse.xml
> b/gdb/features/i386/32bit-sse.xml
> index 5a44d1e..4448a7e 100644
> --- a/gdb/features/i386/32bit-sse.xml
> +++ b/gdb/features/i386/32bit-sse.xml
> @@ -23,20 +23,20 @@
>      <field name="uint128" type="uint128"/>
>    </union>
>    <flags id="i386_mxcsr" size="4">
> -    <field name="IE" start="0" end="0"/>
> -    <field name="DE" start="1" end="1"/>
> -    <field name="ZE" start="2" end="2"/>
> -    <field name="OE" start="3" end="3"/>
> -    <field name="UE" start="4" end="4"/>
> -    <field name="PE" start="5" end="5"/>
> -    <field name="DAZ" start="6" end="6"/>
> -    <field name="IM" start="7" end="7"/>
> -    <field name="DM" start="8" end="8"/>
> -    <field name="ZM" start="9" end="9"/>
> -    <field name="OM" start="10" end="10"/>
> -    <field name="UM" start="11" end="11"/>
> -    <field name="PM" start="12" end="12"/>
> -    <field name="FZ" start="15" end="15"/>
> +    <field name="IE" start="0"/>
> +    <field name="DE" start="1"/>
> +    <field name="ZE" start="2"/>
> +    <field name="OE" start="3"/>
> +    <field name="UE" start="4"/>
> +    <field name="PE" start="5"/>
> +    <field name="DAZ" start="6"/>
> +    <field name="IM" start="7"/>
> +    <field name="DM" start="8"/>
> +    <field name="ZM" start="9"/>
> +    <field name="OM" start="10"/>
> +    <field name="UM" start="11"/>
> +    <field name="PM" start="12"/>
> +    <field name="FZ" start="15"/>
>    </flags>
> 
>    <reg name="xmm0" bitsize="128" type="vec128" regnum="32"/>
> diff --git a/gdb/features/i386/64bit-core.xml
> b/gdb/features/i386/64bit-core.xml
> index 92f4e87..6e847c1 100644
> --- a/gdb/features/i386/64bit-core.xml
> +++ b/gdb/features/i386/64bit-core.xml
> @@ -8,23 +8,23 @@
>  <!DOCTYPE feature SYSTEM "gdb-target.dtd">
>  <feature name="org.gnu.gdb.i386.core">
>    <flags id="i386_eflags" size="4">
> -    <field name="CF" start="0" end="0"/>
> -    <field name="" start="1" end="1"/>
> -    <field name="PF" start="2" end="2"/>
> -    <field name="AF" start="4" end="4"/>
> -    <field name="ZF" start="6" end="6"/>
> -    <field name="SF" start="7" end="7"/>
> -    <field name="TF" start="8" end="8"/>
> -    <field name="IF" start="9" end="9"/>
> -    <field name="DF" start="10" end="10"/>
> -    <field name="OF" start="11" end="11"/>
> -    <field name="NT" start="14" end="14"/>
> -    <field name="RF" start="16" end="16"/>
> -    <field name="VM" start="17" end="17"/>
> -    <field name="AC" start="18" end="18"/>
> -    <field name="VIF" start="19" end="19"/>
> -    <field name="VIP" start="20" end="20"/>
> -    <field name="ID" start="21" end="21"/>
> +    <field name="CF" start="0"/>
> +    <field name="" start="1"/>
> +    <field name="PF" start="2"/>
> +    <field name="AF" start="4"/>
> +    <field name="ZF" start="6"/>
> +    <field name="SF" start="7"/>
> +    <field name="TF" start="8"/>
> +    <field name="IF" start="9"/>
> +    <field name="DF" start="10"/>
> +    <field name="OF" start="11"/>
> +    <field name="NT" start="14"/>
> +    <field name="RF" start="16"/>
> +    <field name="VM" start="17"/>
> +    <field name="AC" start="18"/>
> +    <field name="VIF" start="19"/>
> +    <field name="VIP" start="20"/>
> +    <field name="ID" start="21"/>
>    </flags>
> 
>    <reg name="rax" bitsize="64" type="int64"/>
> diff --git a/gdb/features/i386/64bit-sse.xml
> b/gdb/features/i386/64bit-sse.xml
> index 2a5271e..dd6a850 100644
> --- a/gdb/features/i386/64bit-sse.xml
> +++ b/gdb/features/i386/64bit-sse.xml
> @@ -23,20 +23,20 @@
>      <field name="uint128" type="uint128"/>
>    </union>
>    <flags id="i386_mxcsr" size="4">
> -    <field name="IE" start="0" end="0"/>
> -    <field name="DE" start="1" end="1"/>
> -    <field name="ZE" start="2" end="2"/>
> -    <field name="OE" start="3" end="3"/>
> -    <field name="UE" start="4" end="4"/>
> -    <field name="PE" start="5" end="5"/>
> -    <field name="DAZ" start="6" end="6"/>
> -    <field name="IM" start="7" end="7"/>
> -    <field name="DM" start="8" end="8"/>
> -    <field name="ZM" start="9" end="9"/>
> -    <field name="OM" start="10" end="10"/>
> -    <field name="UM" start="11" end="11"/>
> -    <field name="PM" start="12" end="12"/>
> -    <field name="FZ" start="15" end="15"/>
> +    <field name="IE" start="0"/>
> +    <field name="DE" start="1"/>
> +    <field name="ZE" start="2"/>
> +    <field name="OE" start="3"/>
> +    <field name="UE" start="4"/>
> +    <field name="PE" start="5"/>
> +    <field name="DAZ" start="6"/>
> +    <field name="IM" start="7"/>
> +    <field name="DM" start="8"/>
> +    <field name="ZM" start="9"/>
> +    <field name="OM" start="10"/>
> +    <field name="UM" start="11"/>
> +    <field name="PM" start="12"/>
> +    <field name="FZ" start="15"/>
>    </flags>
> 
>    <reg name="xmm0" bitsize="128" type="vec128" regnum="40"/>
> diff --git a/gdb/features/i386/x32-core.xml
> b/gdb/features/i386/x32-core.xml
> index ab51ffc..c03cdea 100644
> --- a/gdb/features/i386/x32-core.xml
> +++ b/gdb/features/i386/x32-core.xml
> @@ -8,23 +8,23 @@
>  <!DOCTYPE feature SYSTEM "gdb-target.dtd">
>  <feature name="org.gnu.gdb.i386.core">
>    <flags id="i386_eflags" size="4">
> -    <field name="CF" start="0" end="0"/>
> -    <field name="" start="1" end="1"/>
> -    <field name="PF" start="2" end="2"/>
> -    <field name="AF" start="4" end="4"/>
> -    <field name="ZF" start="6" end="6"/>
> -    <field name="SF" start="7" end="7"/>
> -    <field name="TF" start="8" end="8"/>
> -    <field name="IF" start="9" end="9"/>
> -    <field name="DF" start="10" end="10"/>
> -    <field name="OF" start="11" end="11"/>
> -    <field name="NT" start="14" end="14"/>
> -    <field name="RF" start="16" end="16"/>
> -    <field name="VM" start="17" end="17"/>
> -    <field name="AC" start="18" end="18"/>
> -    <field name="VIF" start="19" end="19"/>
> -    <field name="VIP" start="20" end="20"/>
> -    <field name="ID" start="21" end="21"/>
> +    <field name="CF" start="0"/>
> +    <field name="" start="1"/>
> +    <field name="PF" start="2"/>
> +    <field name="AF" start="4"/>
> +    <field name="ZF" start="6"/>
> +    <field name="SF" start="7"/>
> +    <field name="TF" start="8"/>
> +    <field name="IF" start="9"/>
> +    <field name="DF" start="10"/>
> +    <field name="OF" start="11"/>
> +    <field name="NT" start="14"/>
> +    <field name="RF" start="16"/>
> +    <field name="VM" start="17"/>
> +    <field name="AC" start="18"/>
> +    <field name="VIF" start="19"/>
> +    <field name="VIP" start="20"/>
> +    <field name="ID" start="21"/>
>    </flags>
> 
>    <reg name="rax" bitsize="64" type="int64"/>
Doug Evans July 22, 2016, 7:16 p.m. UTC | #2
On Wed, Jul 20, 2016 at 11:17 AM, Pedro Alves <palves@redhat.com> wrote:
> Hi Doug,
>
> On 02/29/2016 11:09 PM, Doug Evans wrote:
>> Hi.
>>
>> This patch just simplifies things by removing the "end" spec in
>> i386 eflags definitions, and is otherwise a nop.
>>
>> I removed them because they're redundant.
>>
>
> I noticed that this makes older gdbs reject the new target descriptions.
> E.g., gdb 7.11.1 against master gdbserver:
>
>  Remote debugging using :9999
>  warning: while parsing target description (at line 24): Field "CF" has neither type nor bit position
>  warning: Could not load XML target description; ignoring
>
> Reverting the patch makes old gdb grok the tdesc again (git revert 49b7ae7bb8f2).
>
> Since it was meant as a cleanup, I think we should revert
> it on grounds of avoiding a back compatibility break.  WDYT?

Fine by me.
diff mbox

Patch

diff --git a/gdb/features/i386/32bit-core.xml  
b/gdb/features/i386/32bit-core.xml
index a27863f..b00d913 100644
--- a/gdb/features/i386/32bit-core.xml
+++ b/gdb/features/i386/32bit-core.xml
@@ -8,23 +8,23 @@ 
  <!DOCTYPE feature SYSTEM "gdb-target.dtd">
  <feature name="org.gnu.gdb.i386.core">
    <flags id="i386_eflags" size="4">
-    <field name="CF" start="0" end="0"/>
-    <field name="" start="1" end="1"/>
-    <field name="PF" start="2" end="2"/>
-    <field name="AF" start="4" end="4"/>
-    <field name="ZF" start="6" end="6"/>
-    <field name="SF" start="7" end="7"/>
-    <field name="TF" start="8" end="8"/>
-    <field name="IF" start="9" end="9"/>
-    <field name="DF" start="10" end="10"/>
-    <field name="OF" start="11" end="11"/>
-    <field name="NT" start="14" end="14"/>
-    <field name="RF" start="16" end="16"/>
-    <field name="VM" start="17" end="17"/>
-    <field name="AC" start="18" end="18"/>
-    <field name="VIF" start="19" end="19"/>
-    <field name="VIP" start="20" end="20"/>
-    <field name="ID" start="21" end="21"/>
+    <field name="CF" start="0"/>
+    <field name="" start="1"/>
+    <field name="PF" start="2"/>
+    <field name="AF" start="4"/>
+    <field name="ZF" start="6"/>
+    <field name="SF" start="7"/>
+    <field name="TF" start="8"/>
+    <field name="IF" start="9"/>
+    <field name="DF" start="10"/>
+    <field name="OF" start="11"/>
+    <field name="NT" start="14"/>
+    <field name="RF" start="16"/>
+    <field name="VM" start="17"/>
+    <field name="AC" start="18"/>
+    <field name="VIF" start="19"/>
+    <field name="VIP" start="20"/>
+    <field name="ID" start="21"/>
    </flags>

    <reg name="eax" bitsize="32" type="int32"/>
diff --git a/gdb/features/i386/32bit-sse.xml  
b/gdb/features/i386/32bit-sse.xml
index 5a44d1e..4448a7e 100644
--- a/gdb/features/i386/32bit-sse.xml
+++ b/gdb/features/i386/32bit-sse.xml
@@ -23,20 +23,20 @@ 
      <field name="uint128" type="uint128"/>
    </union>
    <flags id="i386_mxcsr" size="4">
-    <field name="IE" start="0" end="0"/>
-    <field name="DE" start="1" end="1"/>
-    <field name="ZE" start="2" end="2"/>
-    <field name="OE" start="3" end="3"/>
-    <field name="UE" start="4" end="4"/>
-    <field name="PE" start="5" end="5"/>
-    <field name="DAZ" start="6" end="6"/>
-    <field name="IM" start="7" end="7"/>
-    <field name="DM" start="8" end="8"/>
-    <field name="ZM" start="9" end="9"/>
-    <field name="OM" start="10" end="10"/>
-    <field name="UM" start="11" end="11"/>
-    <field name="PM" start="12" end="12"/>
-    <field name="FZ" start="15" end="15"/>
+    <field name="IE" start="0"/>
+    <field name="DE" start="1"/>
+    <field name="ZE" start="2"/>
+    <field name="OE" start="3"/>
+    <field name="UE" start="4"/>
+    <field name="PE" start="5"/>
+    <field name="DAZ" start="6"/>
+    <field name="IM" start="7"/>
+    <field name="DM" start="8"/>
+    <field name="ZM" start="9"/>
+    <field name="OM" start="10"/>
+    <field name="UM" start="11"/>
+    <field name="PM" start="12"/>
+    <field name="FZ" start="15"/>
    </flags>

    <reg name="xmm0" bitsize="128" type="vec128" regnum="32"/>
diff --git a/gdb/features/i386/64bit-core.xml  
b/gdb/features/i386/64bit-core.xml
index 92f4e87..6e847c1 100644
--- a/gdb/features/i386/64bit-core.xml
+++ b/gdb/features/i386/64bit-core.xml
@@ -8,23 +8,23 @@ 
  <!DOCTYPE feature SYSTEM "gdb-target.dtd">
  <feature name="org.gnu.gdb.i386.core">
    <flags id="i386_eflags" size="4">
-    <field name="CF" start="0" end="0"/>
-    <field name="" start="1" end="1"/>
-    <field name="PF" start="2" end="2"/>
-    <field name="AF" start="4" end="4"/>
-    <field name="ZF" start="6" end="6"/>
-    <field name="SF" start="7" end="7"/>
-    <field name="TF" start="8" end="8"/>
-    <field name="IF" start="9" end="9"/>
-    <field name="DF" start="10" end="10"/>
-    <field name="OF" start="11" end="11"/>
-    <field name="NT" start="14" end="14"/>
-    <field name="RF" start="16" end="16"/>
-    <field name="VM" start="17" end="17"/>
-    <field name="AC" start="18" end="18"/>
-    <field name="VIF" start="19" end="19"/>
-    <field name="VIP" start="20" end="20"/>
-    <field name="ID" start="21" end="21"/>
+    <field name="CF" start="0"/>
+    <field name="" start="1"/>
+    <field name="PF" start="2"/>
+    <field name="AF" start="4"/>
+    <field name="ZF" start="6"/>
+    <field name="SF" start="7"/>
+    <field name="TF" start="8"/>
+    <field name="IF" start="9"/>
+    <field name="DF" start="10"/>
+    <field name="OF" start="11"/>
+    <field name="NT" start="14"/>
+    <field name="RF" start="16"/>
+    <field name="VM" start="17"/>
+    <field name="AC" start="18"/>
+    <field name="VIF" start="19"/>
+    <field name="VIP" start="20"/>
+    <field name="ID" start="21"/>
    </flags>

    <reg name="rax" bitsize="64" type="int64"/>
diff --git a/gdb/features/i386/64bit-sse.xml  
b/gdb/features/i386/64bit-sse.xml
index 2a5271e..dd6a850 100644
--- a/gdb/features/i386/64bit-sse.xml
+++ b/gdb/features/i386/64bit-sse.xml
@@ -23,20 +23,20 @@ 
      <field name="uint128" type="uint128"/>
    </union>
    <flags id="i386_mxcsr" size="4">
-    <field name="IE" start="0" end="0"/>
-    <field name="DE" start="1" end="1"/>
-    <field name="ZE" start="2" end="2"/>
-    <field name="OE" start="3" end="3"/>
-    <field name="UE" start="4" end="4"/>
-    <field name="PE" start="5" end="5"/>
-    <field name="DAZ" start="6" end="6"/>
-    <field name="IM" start="7" end="7"/>
-    <field name="DM" start="8" end="8"/>
-    <field name="ZM" start="9" end="9"/>
-    <field name="OM" start="10" end="10"/>
-    <field name="UM" start="11" end="11"/>
-    <field name="PM" start="12" end="12"/>
-    <field name="FZ" start="15" end="15"/>
+    <field name="IE" start="0"/>
+    <field name="DE" start="1"/>
+    <field name="ZE" start="2"/>
+    <field name="OE" start="3"/>
+    <field name="UE" start="4"/>
+    <field name="PE" start="5"/>
+    <field name="DAZ" start="6"/>
+    <field name="IM" start="7"/>
+    <field name="DM" start="8"/>
+    <field name="ZM" start="9"/>
+    <field name="OM" start="10"/>
+    <field name="UM" start="11"/>
+    <field name="PM" start="12"/>
+    <field name="FZ" start="15"/>
    </flags>

    <reg name="xmm0" bitsize="128" type="vec128" regnum="40"/>
diff --git a/gdb/features/i386/x32-core.xml b/gdb/features/i386/x32-core.xml
index ab51ffc..c03cdea 100644
--- a/gdb/features/i386/x32-core.xml
+++ b/gdb/features/i386/x32-core.xml
@@ -8,23 +8,23 @@ 
  <!DOCTYPE feature SYSTEM "gdb-target.dtd">
  <feature name="org.gnu.gdb.i386.core">
    <flags id="i386_eflags" size="4">
-    <field name="CF" start="0" end="0"/>
-    <field name="" start="1" end="1"/>
-    <field name="PF" start="2" end="2"/>
-    <field name="AF" start="4" end="4"/>
-    <field name="ZF" start="6" end="6"/>
-    <field name="SF" start="7" end="7"/>
-    <field name="TF" start="8" end="8"/>
-    <field name="IF" start="9" end="9"/>
-    <field name="DF" start="10" end="10"/>
-    <field name="OF" start="11" end="11"/>
-    <field name="NT" start="14" end="14"/>
-    <field name="RF" start="16" end="16"/>
-    <field name="VM" start="17" end="17"/>
-    <field name="AC" start="18" end="18"/>
-    <field name="VIF" start="19" end="19"/>
-    <field name="VIP" start="20" end="20"/>
-    <field name="ID" start="21" end="21"/>
+    <field name="CF" start="0"/>
+    <field name="" start="1"/>
+    <field name="PF" start="2"/>
+    <field name="AF" start="4"/>
+    <field name="ZF" start="6"/>
+    <field name="SF" start="7"/>
+    <field name="TF" start="8"/>
+    <field name="IF" start="9"/>
+    <field name="DF" start="10"/>
+    <field name="OF" start="11"/>
+    <field name="NT" start="14"/>
+    <field name="RF" start="16"/>
+    <field name="VM" start="17"/>
+    <field name="AC" start="18"/>
+    <field name="VIF" start="19"/>
+    <field name="VIP" start="20"/>
+    <field name="ID" start="21"/>
    </flags>

    <reg name="rax" bitsize="64" type="int64"/>