This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Add x32 XML files


On Mon, Apr 2, 2012 at 9:50 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Hi,
>
> This patch adds x32 XML files as well as files generated from them.
> The main difference 64bit-core.xml and x32-core.xml is RSP/RBP/RIP
> use 64bit type explicitly, instead of data_ptr and code_ptr, since
> x32 is really running in 64bit mode in hardware. ?OK for trunk?
>
> Thanks.

Mark raised the issue of rip/rbp/rsp registers.  They have 64bit integer
types in x32.  pc/sp/eip/ebp/esp have code_ptr and data_ptr types
in x32.  Are any objections to x32 XML files?

Thanks.

H.J.
---
>
> H.J.
> ---
> From a92a8c59835fb7debb942cdc59eab2de23a729e2 Mon Sep 17 00:00:00 2001
> From: "H.J. Lu" <hjl.tools@gmail.com>
> Date: Mon, 2 Apr 2012 09:38:37 -0700
> Subject: [PATCH] Add x32 XML files
>
> 2012-04-02 ?H.J. Lu ?<hongjiu.lu@intel.com>
>
> ? ? ? ?* features/Makefile (WHICH): Add i386/x32, i386/x32-linux,
> ? ? ? ?i386/x32-avx and i386/x32-avx-linux.
> ? ? ? ?(i386/x32-expedite): New.
> ? ? ? ?(i386/x32-linux-expedite): Likewise.
> ? ? ? ?(i386/x32-avx-expedite): Likewise.
> ? ? ? ?(i386/x32-avx-linux-expedite): Likewise.
> ? ? ? ?($(outdir)/i386/x32.dat): Likewise.
> ? ? ? ?($(outdir)/i386/x32-linux.dat): Likewise.
> ? ? ? ?($(outdir)/i386/x32-avx.dat): Likewise.
> ? ? ? ?($(outdir)/i386/x32-avx-linux.dat): Likewise.
>
> ? ? ? ?* features/i386/x32-avx-linux.xml: New file.
> ? ? ? ?* features/i386/x32-avx.xml: Likewise.
> ? ? ? ?* features/i386/x32-core.xml: Likewise.
> ? ? ? ?* features/i386/x32-linux.xml: Likewise.
> ? ? ? ?* features/i386/x32.xml: Likewise.
>
> ? ? ? ?* features/i386/x32-avx-linux.c: New. ?Generated.
> ? ? ? ?* features/i386/x32-avx.c: Likewise.
> ? ? ? ?* features/i386/x32-linux.c: Likewise.
> ? ? ? ?* features/i386/x32.c: Likewise.
> ? ? ? ?* regformats/i386/x32-avx-linux.dat: Likewise.
> ? ? ? ?* regformats/i386/x32-avx.dat: Likewise.
> ? ? ? ?* regformats/i386/x32-linux.dat: Likewise.
> ? ? ? ?* regformats/i386/x32.dat: Likewise.
>
> diff --git a/gdb/features/Makefile b/gdb/features/Makefile
> index eedc33e..873ed85 100644
> --- a/gdb/features/Makefile
> +++ b/gdb/features/Makefile
> @@ -36,6 +36,8 @@ WHICH = arm-with-iwmmxt arm-with-vfpv2 arm-with-vfpv3 arm-with-neon \
> ? ? ? ?i386/amd64 i386/amd64-linux \
> ? ? ? ?i386/i386-avx i386/i386-avx-linux \
> ? ? ? ?i386/amd64-avx i386/amd64-avx-linux \
> + ? ? ? i386/x32 i386/x32-linux \
> + ? ? ? i386/x32-avx i386/x32-avx-linux \
> ? ? ? ?mips-linux mips-dsp-linux \
> ? ? ? ?mips64-linux mips64-dsp-linux \
> ? ? ? ?rs6000/powerpc-32 \
> @@ -60,6 +62,10 @@ i386/i386-mmx-expedite = ebp,esp,eip
> ?i386/i386-mmx-linux-expedite = ebp,esp,eip
> ?i386/amd64-avx-expedite = rbp,rsp,rip
> ?i386/amd64-avx-linux-expedite = rbp,rsp,rip
> +i386/x32-expedite = rbp,rsp,rip
> +i386/x32-linux-expedite = rbp,rsp,rip
> +i386/x32-avx-expedite = rbp,rsp,rip
> +i386/x32-avx-linux-expedite = rbp,rsp,rip
> ?mips-expedite = r29,pc
> ?mips-dsp-expedite = r29,pc
> ?mips64-expedite = r29,pc
> @@ -127,3 +133,9 @@ $(outdir)/i386/i386-mmx-linux.dat: i386/32bit-core.xml i386/32bit-linux.xml
> ?$(outdir)/i386/amd64-avx.dat: i386/64bit-core.xml i386/64bit-avx.xml
> ?$(outdir)/i386/amd64-avx-linux.dat: i386/64bit-core.xml i386/64bit-avx.xml \
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?i386/64bit-linux.xml
> +$(outdir)/i386/x32.dat: i386/x32-core.xml i386/64bit-sse.xml
> +$(outdir)/i386/x32-linux.dat: i386/x32-core.xml i386/64bit-sse.xml \
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? i386/64bit-linux.xml
> +$(outdir)/i386/x32-avx.dat: i386/x32-core.xml i386/64bit-avx.xml
> +$(outdir)/i386/x32-avx-linux.dat: i386/x32-core.xml i386/64bit-avx.xml \
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? i386/64bit-linux.xml
> diff --git a/gdb/features/i386/x32-avx-linux.xml b/gdb/features/i386/x32-avx-linux.xml
> new file mode 100644
> index 0000000..9ce4b2a
> --- /dev/null
> +++ b/gdb/features/i386/x32-avx-linux.xml
> @@ -0,0 +1,18 @@
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2012 Free Software Foundation, Inc.
> +
> + ? ? Copying and distribution of this file, with or without modification,
> + ? ? are permitted in any medium without royalty provided the copyright
> + ? ? notice and this notice are preserved. ?-->
> +
> +<!-- X32 with AVX - Includes Linux-only special "register". ?-->
> +
> +<!DOCTYPE target SYSTEM "gdb-target.dtd">
> +<target>
> + ?<architecture>i386:x64-32</architecture>
> + ?<osabi>GNU/Linux</osabi>
> + ?<xi:include href="x32-core.xml"/>
> + ?<xi:include href="64bit-sse.xml"/>
> + ?<xi:include href="64bit-linux.xml"/>
> + ?<xi:include href="64bit-avx.xml"/>
> +</target>
> diff --git a/gdb/features/i386/x32-avx.xml b/gdb/features/i386/x32-avx.xml
> new file mode 100644
> index 0000000..57a32c9
> --- /dev/null
> +++ b/gdb/features/i386/x32-avx.xml
> @@ -0,0 +1,16 @@
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2012 Free Software Foundation, Inc.
> +
> + ? ? Copying and distribution of this file, with or without modification,
> + ? ? are permitted in any medium without royalty provided the copyright
> + ? ? notice and this notice are preserved. ?-->
> +
> +<!-- X32 with AVX -->
> +
> +<!DOCTYPE target SYSTEM "gdb-target.dtd">
> +<target>
> + ?<architecture>i386:x64-32</architecture>
> + ?<xi:include href="x32-core.xml"/>
> + ?<xi:include href="64bit-sse.xml"/>
> + ?<xi:include href="64bit-avx.xml"/>
> +</target>
> diff --git a/gdb/features/i386/x32-core.xml b/gdb/features/i386/x32-core.xml
> new file mode 100644
> index 0000000..1e41417
> --- /dev/null
> +++ b/gdb/features/i386/x32-core.xml
> @@ -0,0 +1,73 @@
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2012 Free Software Foundation, Inc.
> +
> + ? ? Copying and distribution of this file, with or without modification,
> + ? ? are permitted in any medium without royalty provided the copyright
> + ? ? notice and this notice are preserved. ?-->
> +
> +<!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"/>
> + ?</flags>
> +
> + ?<reg name="rax" bitsize="64" type="int64"/>
> + ?<reg name="rbx" bitsize="64" type="int64"/>
> + ?<reg name="rcx" bitsize="64" type="int64"/>
> + ?<reg name="rdx" bitsize="64" type="int64"/>
> + ?<reg name="rsi" bitsize="64" type="int64"/>
> + ?<reg name="rdi" bitsize="64" type="int64"/>
> + ?<reg name="rbp" bitsize="64" type="int64"/>
> + ?<reg name="rsp" bitsize="64" type="int64"/>
> + ?<reg name="r8" bitsize="64" type="int64"/>
> + ?<reg name="r9" bitsize="64" type="int64"/>
> + ?<reg name="r10" bitsize="64" type="int64"/>
> + ?<reg name="r11" bitsize="64" type="int64"/>
> + ?<reg name="r12" bitsize="64" type="int64"/>
> + ?<reg name="r13" bitsize="64" type="int64"/>
> + ?<reg name="r14" bitsize="64" type="int64"/>
> + ?<reg name="r15" bitsize="64" type="int64"/>
> +
> + ?<reg name="rip" bitsize="64" type="uint64"/>
> + ?<reg name="eflags" bitsize="32" type="i386_eflags"/>
> + ?<reg name="cs" bitsize="32" type="int32"/>
> + ?<reg name="ss" bitsize="32" type="int32"/>
> + ?<reg name="ds" bitsize="32" type="int32"/>
> + ?<reg name="es" bitsize="32" type="int32"/>
> + ?<reg name="fs" bitsize="32" type="int32"/>
> + ?<reg name="gs" bitsize="32" type="int32"/>
> +
> + ?<reg name="st0" bitsize="80" type="i387_ext"/>
> + ?<reg name="st1" bitsize="80" type="i387_ext"/>
> + ?<reg name="st2" bitsize="80" type="i387_ext"/>
> + ?<reg name="st3" bitsize="80" type="i387_ext"/>
> + ?<reg name="st4" bitsize="80" type="i387_ext"/>
> + ?<reg name="st5" bitsize="80" type="i387_ext"/>
> + ?<reg name="st6" bitsize="80" type="i387_ext"/>
> + ?<reg name="st7" bitsize="80" type="i387_ext"/>
> +
> + ?<reg name="fctrl" bitsize="32" type="int" group="float"/>
> + ?<reg name="fstat" bitsize="32" type="int" group="float"/>
> + ?<reg name="ftag" bitsize="32" type="int" group="float"/>
> + ?<reg name="fiseg" bitsize="32" type="int" group="float"/>
> + ?<reg name="fioff" bitsize="32" type="int" group="float"/>
> + ?<reg name="foseg" bitsize="32" type="int" group="float"/>
> + ?<reg name="fooff" bitsize="32" type="int" group="float"/>
> + ?<reg name="fop" bitsize="32" type="int" group="float"/>
> +</feature>
> diff --git a/gdb/features/i386/x32-linux.xml b/gdb/features/i386/x32-linux.xml
> new file mode 100644
> index 0000000..6a1bc7f
> --- /dev/null
> +++ b/gdb/features/i386/x32-linux.xml
> @@ -0,0 +1,17 @@
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2012 Free Software Foundation, Inc.
> +
> + ? ? Copying and distribution of this file, with or without modification,
> + ? ? are permitted in any medium without royalty provided the copyright
> + ? ? notice and this notice are preserved. ?-->
> +
> +<!-- X32 - Includes Linux-only special "register". ?-->
> +
> +<!DOCTYPE target SYSTEM "gdb-target.dtd">
> +<target>
> + ?<architecture>i386:x64-32</architecture>
> + ?<osabi>GNU/Linux</osabi>
> + ?<xi:include href="x32-core.xml"/>
> + ?<xi:include href="64bit-sse.xml"/>
> + ?<xi:include href="64bit-linux.xml"/>
> +</target>
> diff --git a/gdb/features/i386/x32.xml b/gdb/features/i386/x32.xml
> new file mode 100644
> index 0000000..f950f4e
> --- /dev/null
> +++ b/gdb/features/i386/x32.xml
> @@ -0,0 +1,15 @@
> +<?xml version="1.0"?>
> +<!-- Copyright (C) 2012 Free Software Foundation, Inc.
> +
> + ? ? Copying and distribution of this file, with or without modification,
> + ? ? are permitted in any medium without royalty provided the copyright
> + ? ? notice and this notice are preserved. ?-->
> +
> +<!-- X32 -->
> +
> +<!DOCTYPE target SYSTEM "gdb-target.dtd">
> +<target>
> + ?<architecture>i386:x64-32</architecture>
> + ?<xi:include href="x32-core.xml"/>
> + ?<xi:include href="64bit-sse.xml"/>
> +</target>



-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]