Commit Graph

29 Commits

Author SHA1 Message Date
Michael Sturm 51547df62c Add support for Intel PKRU register to GDB and GDBserver.
This patch adds support for the registers added by the
Memory Protection Keys for Userspace (PKU aka PKEYs) feature.
Native and remote debugging are covered by this patch.

The XSAVE area is extended with a new state containing
the 32-bit wide PKRU register. The new register is added to
amd64-avx-mpx_avx512-* tdesc, thus it is renamed accordingly. Also,
respective xstate mask X86_XSTATE_AVX_MPX_AVX512_MASK is renamed to
X86_XSTATE_AVX_MPX_AVX512_PKU_MASK to reflect the new feature set
it supports.

For more information, please refer to the
Intel(R) 64 and IA-32 Architectures Software Developer's
Manual - Septemper 2015
http://www.intel.com/content/dam/www/public/us/en/documents/
manuals/64-ia-32-architectures-software-developer-manual-325462.pdf

gdb/Changelog:
2015-12-08  Michael Sturm  <michael.sturm@intel.com>

     * NEWS: Mention addition of PKU feature.
     * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add PKRU register.
     * amd64-linux-tdep.c (features/i386/amd64-avx-mpx-avx512-linux.c): Rename
       to...
     (features/i386/amd64-avx-mpx-avx512-pku-linux.c): ...this.
     (amd64_linux_gregset_reg_offset): Add PKRU register.
     (amd64_linux_core_read_description): Rename
     X86_XSTATE_AVX_MPX_AVX512_MASK,
     rename tdesc_amd64_avx_mpx_avx512_pku_linux.
     (_initialize_amd64_linux_tdep): Rename
     initialize_tdesc_amd64_avx_mpx_avx512_linux.
     * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum
     calculation.
     (tdesc_amd64_avx_mpx_avx512_linux): Rename to...
     (tdesc_amd64_avx_mpx_avx512_pku_linux): ...this.
     * amd64-tdep.c (features/i386/amd64-avx-mpx-avx512-pku.c): Rename to...
     (features/i386/amd64-avx-mpx-avx512-pku.c): ...this.
     (amd64_pkeys_names): New register name for raw register PKRU.
     (amd64_init_abi): Add code to initialize PKRU tdep variables if feature
     is present.
     (amd64_target_description): Rename X86_XSTATE_AVX_MPX_AVX512_MASK,
     rename tdesc_amd64_avx_mpx_avx512.
     (_initialize_amd64_tdep): Rename initialize_tdesc_amd64_avx_mpx_avx512.
     * amd64-tdep.h (enum amd64_regnum): Add PKRU register.
     (AMD64_NUM_REGS): Adjust regnum calculation.
     * i386-linux.nat.c (GETXSTATEREGS_SUPPLIES): Extend range of
     registers supplied via XSTATE by PKRU register.
     * common/x86-xstate.h (X86_XSTATE_PKRU): New macro.
     (X86_XSTATE_AVX_MPX_AVX512_MASK): Add PKRU and renamed mask.
     (X86_XSTATE_ALL_MASK): Rename X86_XSTATE_AVX_MPX_AVX512_MASK.
     (X86_XSTATE_PKRU_SIZE): New macro.
     (X86_XSTATE_MAX_SIZE): Adjust size.
     (HAS_PKRU(XCR0)): New macro.
     (X86_XSTATE_SIZE): Add checkfor PKRU.
     * features/Makefile (WHICH): Rename i386/i386-avx-mpx-avx512,
     i386/i386-avx-mpx-avx512-linux, i386/amd64-avx-mpx-avx512,
     i386/amd64-avx-mpx-avx512-linux.
     (i386/i386-avx-mpx-avx512-expedite): Rename expedite.
     (i386/i386-avx-mpx-avx512-linux-expedite): Likewise.
     (i386/amd64-avx-mpx-avx512-expedite): Likewise.
     (i386/amd64-avx-mpx-avx512-linux-expedite): Likewise.
     (XMLTOC): Rename i386/amd64-avx-mpx-avx512-linux.xml,
     i386/amd64-avx-mpx-avx512.xml, i386/i386-avx-mpx-avx512-linux.xml,
     i386/i386-avx-mpx-avx512.xml.
     ((outdir)/i386/i386-avx-mpx-avx512.dat): Rename rule, add
     i386/32bit-pkeys.xml.
     ((outdir)/i386/i386-avx-mpx-avx512-pku-linux.dat): Likewise.
     ((outdir)/i386/amd64-avx-mpx-avx512.dat): Rename rule, add
     i386/64bit-pkeys.xml.
     ((outdir)/i386/amd64-avx-mpx-avx512-linux.dat): Likewise.
     * features/i386/32bit-pkeys.xml: New file.
     * features/i386/64bit-pkeys.xml: Likewise.
     * features/i386/amd64-avx-mpx-avx512-linux-pku.c: Regenerate from
     renamed XML file.
     * features/i386/amd64-avx-mpx-avx512-linux.xml: Rename to
     amd64-avx-mpx-avx512-pku-linux.xml, add 64bit-pkeys.xml
     * features/i386/amd64-avx-mpx-avx512.c: Regenerate from
     renamed XML file.
     * features/i386/amd64-avx-mpx-avx512.xml: Rename to
     amd64-avx-mpx-avx512-pku.xml, add 64bit-pkeys.xml.
     * features/i386/i386-avx-mpx-avx512-linux.c: Regenerate from
     renamed XML file.
     * features/i386/i386-avx-mpx-avx512-linux.xml: Rename to
     i386-avx-mpx-avx512-pku-linux.xml, add 32bit-pkeys.xml.
     * features/i386/i386-avx-mpx-avx512.c: Regenerate from
     renamed XML file.
     * features/i386/i386-avx-mpx-avx512.xml: Rename to
     i386-avx-mpx-avx512-pku.xml, add 32bit-pkeys.xml.
     * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Change to use
     I386_PKEYS_NUM_REGS.
     * i386-linux-tdep.c (features/i386/i386-avx-mpx-avx512-linux.c): Rename
     include.
     (i386_linux_gregset_reg_offset): Add PKRU register.
     (i386_linux_core_read_description): Rename xstate mask and returned
     tdesc for X86_XSTATE_AVX_MPX_AVX512_PKU_MASK.
     (_initialize_i386_linux_tdep): Rename
     initialize_tdesc_i386_avx_mpx_avx512_linux.
     * i386-linux-tdep.h (I386_LINUX_ORIG_EAX_REGNUM): Adjuste regnum
     calculation.
     (tdesc_i386_avx_mpx_avx512_linux): Rename prototype.
     (/* Format of XSAVE...): Add pkru register.
     * i386-tdep.c (i386-avx-mpx-avx512.c): Rename include.
     (i386_pkeys_names): New register name for raw register PKRU.
     (i386_pkru_regnum_p): Add function to look up register number of
     PKRU raw register.
     (i386_register_reggroup_p): Add code to exclude PKRU from general
     register group.
     (i386_validate_tdesc_p): Add code to handle PKRU feature, add PKRU
     registers if feature is present in xcr0.
     (i386_gdbarch_init): Adjust number of registers in architecture. Add code
     to initialize PKRU feature variables in tdep structure.
     (i386_target_description): Rename xstate mask and returned
     tdesc for X86_XSTATE_AVX_MPX_AVX512_PKU_MASK.
     (_initialize_i386_tdep): Rename initialize_tdesc_i386_avx_mpx_avx512.
     * i386-tdep.h (struct gdbarch_tdep): Add feature variables to tdep
     structure.
     (enum i386_regnum): Add PKRU register.
     (I386_PKEYS_NUM_REGS): New define for number of registers in PKRU feature.
     (i386_pkru_regnum_p): New prototype.
     * i387-tdep.c (xsave_pkeys_offset): New table for PKRU offsets in
     XSAVE buffer.
     (XSAVE_PKEYS_ADDR): New macro.
     (i387_supply_xsave): Add code to handle PKRU register.
     (i387_collect_xsave): Likewise.
     * i387-tdep.h (I387_NUM_PKEYS_REGS): New define for number of registers
     in PKRU feature.
     (I387_PKRU_REGNUM): New macro.
     (I387_PKEYSEND_REGNUM): Likewise.
     * regformats/i386/amd64_avx_mpx_avx512_pku_linux.dat: Regenerate from
     renamed XML file.
     * regformats/i386/amd64_avx_mpx_avx512_pku.dat: Likewise.
     * regformats/i386/i386/amd64-avx-mpx-avx512-pku.dat: Likewise.
     * regformats/i386/i386_avx_mpx_avx512_pku_linux.dat: Likewise.

testsuite/Changelog:
2016-04-18  Michael Sturm  <michael.sturm@intel.com>

     * gdb.arch/i386-pkru.c: New file.
     * gdb.arch/i386-pkru.exp: Likewise.

gdbserver/Changelog:
2016-04-18  Michael Sturm  <michael.sturm@intel.com>

     * Makefile.in (clean): Rename i386-avx-mpx-avx512.c,
     i386-avx-mpx-avx512-linux.c, amd64-avx-mpx-avx512.c,
     amd64-avx-mpx-avx512-linux.c.
     (i386-avx-mpx-avx512-linux-ipa.o:): Rename rule and source file.
     (amd64-avx-mpx-avx512-linux-ipa.o:): Likewise.
     (i386-avx-mpx-avx512.c :): Rename rule, source files and dat files.
     (i386-avx-mpx-avx512-linux.c :): Likewise.
     (amd64-avx-mpx-avx512.c :): Likewise.
     (amd64-avx-mpx-avx512-linux.c :): Likewise.
     * configure.srv (srv_i386_regobj): Rename i386-avx-mpx-avx512.o.
     (srv_i386_linux_regobj): Rename i386-avx-mpx-avx512-linux.o.
     (srv_amd64_regobj): Rename amd64-avx-mpx-avx512.o.
     (srv_amd64_linux_regobj): Rename amd64-avx-mpx-avx512-linux.o.
     (ipa_i386_linux_regobj): Rename i386-avx-mpx-avx512-linux-ipa.o.
     (ipa_amd64_linux_regobj): Rename amd64-avx-mpx-avx512-pku-linux-ipa.o.
     (srv_i386_32bit_xmlfiles): Add 32bit-pkeys.xml.
     (srv_i386_64bit_xmlfiles): Add 64bit-pkeys.xml.
     (srv_i386_xmlfiles): Rename i386/i386-avx-mpx-avx512.xml.
     (srv_amd64_xmlfiles): Rename i386/amd64-avx-mpx-avx512.xml.
     (srv_i386_linux_xmlfiles): Rename i386/i386-avx-mpx-avx512-linux.xml.
     (srv_amd64_linux_xmlfiles): Rename di386/amd64-avx-mpx-avx512-linux.xml.
     * i387-fp.c (num_pkeys_registers): New variable.
     (struct i387_xsave): Add space for pkru values.
     (i387_cache_to_fsave): Add code to handle PKRU register.
     (i387_xsave_to_cache): Likewise.
     * linux-amd64-ipa.c (get_ipa_tdesc): Rename
     tdesc_amd64_avx_mpx_avx512_linux.
     (initialize_low_tracepoint): Rename
     init_registers_amd64_avx_mpx_avx512_linux.
     * linux-i386-ipa.c (get_ipa_desc): Rename
     tdesc_i386_avx_mpx_avx512_linux.
     (initialize_low_tracepoint): Rename
     init_registers_i386_avx_mpx_avx512_linux.
     * linux-x86-low.c (x86_64_regmap[]): Add PKRU register.
     (x86_linux_read_description): Rename X86_XSTATE_AVX_MPX_AVX512_MASK,
     rename tdesc_amd64_avx_mpx_avx512_linux, rename
     tdesc_i386_avx_mpx_avx512_linux.
     (x86_get_ipa_tdesc_idx): Rename tdesc_amd64_avx_mpx_avx512_linux,
     rename tdesc_i386_avx_mpx_avx512_linux.
     (initialize_low_arch): Rename init_registers_amd64_avx_mpx_avx512_linux,
     rename init_registers_i386_avx_mpx_avx512_linux.
     * linux-x86-tdesc.h (init_registers_amd64_avx_mpx_avx512_linux): Renamed
     prototype.
     (tdesc_amd64_avx_mpx_avx512_linux): Likewise.
     (init_registers_i386_avx_mpx_avx512_linux): Likewise.
     (tdesc_i386_avx_mpx_avx512_linux): Likewise.

doc/Changelog:
2016-04-18  Michael Sturm  <michael.sturm@intel.com>

     * gdb.texinfo (i386 Features): Add description of PKRU register.

Change-Id: If75ce5aba7dfd33fdbe3d8b47f04ef3f550c52be
Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2017-02-17 11:44:48 +01:00
Michael Sturm a1fa17ee15 Add target description for avx-avx512.
Add a dedicated target description for the feature combination
avx-avx512 as implemented by certain IA CPU models.

The corresponding X86_XSTATE_AVX_AVX512_MASK already exists, but shared
the tdesc with X86_XSTATE_AVX_MPX_AVX512_MASK. This caused MPX registers
displayed as undefined on CPUs that only implemented
X86_XSTATE_AVX_AVX512_MASK, which is undesired. This patch solves this issue.

This patch also corrects the wrong usage of x32-avx-mpx-avx512, which is
replaced by x32-avx-avx512. The MPX feature is not implemented in x32 mode.

gdb/Changelog:
2016-04-18  Michael Sturm  <michael.sturm@intel.com>

     * amd64-linux-tdep.c (features/i386/amd64-avx-avx512-linux.c):
     New include.
     (features/i386/x32-avx-mpx-avx512-linux.c): Rename to...
     (features/i386/x32-avx-avx512-linux.c): ...this.
     (amd64_linux_core_read_description): Add dedicated cases for
     X86_XSTATE_AVX_AVX512_MASK and return appropriate tdesc.
     (_initialize_amd64_linux_tdep): Add calls to
     initialize_tdesc_amd64_avx_avx512_linux and
     initialize_tdesc_x32_avx_avx512_linux.
     * amd64-linux.tdep.h (tdesc_amd64_avx_avx512_linux): New prototype.
     (tdesc_x32_avx_mpx_avx512_linux): Rename to...
     (tdesc_x32_avx_avx512_linu): ...this.
     * amd64-tdep.c (features/i386/amd64-avx-avx512.c): New include.
     (features/i386/x32-avx-mpx-avx512.c): Rename to...
     (features/i386/x32-avx-avx512.c): ...this.
     (amd64_target_description): Add dedicated case for
     X86_XSTATE_AVX_AVX512_MASK and return appropriate tdesc.
     (_initialize_amd64_tdep): Add call to
     initialize_tdesc_amd64_avx_avx512.
     (initialize_tdesc_x32_avx_mpx_avx512): Rename to...
     (initialize_tdesc_x32_avx_avx512): ...this.
     * features/Makefile (WHICH): New tdescs i386/i386-avx-avx512,
     i386/i386-avx-avx512-linux, i386/amd64-avx-avx512,
     i386/amd64-avx-avx512-linux.
     (i386/x32-avx-mpx-avx512): Rename to...
     (i386/x32-avx-avx512): ...this.
     (i386/x32-avx-mpx-avx512-linux): Rename to...
     (i386/x32-avx-avx512-linux): ...this.
     (i386/i386-avx-avx512-expedite, i386/i386-avx-avx512-linux-expedite,
     i386/amd64-avx-avx512-expedite, i386/amd64-avx-avx512-linux-expedite):
     New expedites.
     (i386/x32-avx-mpx-avx512-expedite): Rename to...
     (i386/x32-avx-avx512-expedite): ...this.
     (i386/x32-avx-mpx-avx512-linux-expedite): Rename to...
     (i386/x32-avx-avx512-linux-expedite): ...this.
     (XMLTOC): New XML files i386/amd64-avx-avx512-linux.xml,
     i386/amd64-avx-avx512.xml, i386/i386-avx-avx512-linux.xml,
     i386/i386-avx-avx512.xml.
     (i386/x32-avx-mpx-avx512-linux.xml): Rename to...
     (i386/x32-avx-avx512-linux.xml): ...this.
     (i386/x32-avx-mpx-avx512.xml): Rename to...
     (i386/x32-avx-avx512.xml): ...this.
     ($(outdir)/i386/i386-avx-avx512.dat): New rule.
     ($(outdir)/i386/i386-avx-avx512-linux.dat): Likewise.
     ($(outdir)/i386/amd64-avx-avx512.dat): Likewise.
     ($(outdir)/i386/amd64-avx-avx512-linux.dat): Likewise.
     ($(outdir)/i386/x32-avx-mpx-avx512.dat):  Rename to...
     ($(outdir)/i386/x32-avx-avx512.dat): ...this.
     ($(outdir)/i386/x32-avx-mpx-avx512-linux.dat): Rename to...
     ($(outdir)/i386/x32-avx-avx512-linux.dat): ...this.
     * features/i386/amd64-avx-avx512-linux.c: New file.
     * features/i386/amd64-avx-avx512-linux.xml: Likewise.
     * features/i386/amd64-avx-avx512.c: Likewise.
     * features/i386/amd64-avx-avx512.xml: Likewise.
     * features/i386/i386-avx-avx512-linux.c: Likewise.
     * features/i386/i386-avx-avx512-linux.xml: Likewise.
     * features/i386/i386-avx-avx512.c: Likewise.
     * features/i386/i386-avx-avx512.xml: Likewise.
     * features/i386/x32-avx-mpx-avx512-linux.c: Deleted.
     * features/i386/x32-avx-avx512-linux.c: New file.
     * features/i386/x32-avx-mpx-avx512-linux.xml: Deleted.
     * features/i386/x32-avx-avx512-linux.xml: New file.
     * features/i386/x32-avx-mpx-avx512.c: Deleted.
     * features/i386/x32-avx-avx512.c: New file.
     * features/i386/x32-avx-mpx-avx512.xml: Deleted.
     * features/i386/x32-avx-avx512.xml: New file.
     * i386-linux-tdep.c (features/i386/i386-avx-avx512-linux.c): New include.
     (i386_linux_core_read_description): Add dedicated case for
     X86_XSTATE_AVX_AVX512_MASK and return appropriate tdesc.
     (_initialize_i386_linux_tdep): Add call to
     initialize_tdesc_i386_avx_avx512_linux.
     * i386-linux-tdep.h (tdesc_i386_avx_avx512_linux): New prototype.
     * i386-tdep.c (features/i386/i386-avx-avx512.c): New include.
     (i386_validate_tdesc_p): Correct XSTATE mask used for feature_avx512.
     (i386_target_description): Add dedicated case for
     X86_XSTATE_AVX_AVX512_MASK and return appropriate tdesc.
     (_initialize_i386_tdep): Add call to initialize_tdesc_i386_avx_avx512.
     * regformats/i386/amd64-avx-avx512-linux.dat: New file
     * regformats/i386/amd64-avx-avx512.dat: Likewise.
     * regformats/i386/i386-avx-avx512-linux.dat: Likewise.
     * regformats/i386/i386-avx-avx512.dat: Likewise.
     * regformats/i386/x32-avx-mpx-avx512-linux.dat: Deleted.
     * regformats/i386/x32-avx-avx512-linux.dat: New file.
     * regformats/i386/x32-avx-mpx-avx512.dat: Deleted.
     * regformats/i386/x32-avx-avx512.dat: New file.
     * x86-linux-nat.c (x86_linux_read_description): Add dedidated case for
     X86_XSTATE_AVX_AVX512_MASK and return appropriate description.

gdbserver/Changelog:
2016-04-18  Michael Sturm  <michael.sturm@intel.com>

     * Makefile.in  (clean): Add handling of new source files
     i386-avx-avx512.c, i386-avx-avx512-linux.c, amd64-avx-avx512.c,
     amd64-avx-avx512-linux.c.
     (x32-avx-mpx-avx512.c): Rename to...
     (x32-avx-avx512.c): ...this.
     (x32-avx-mpx-avx512-linux.c): Rename to...
     (x32-avx-avx512-linux.c): ...this.
     (i386-avx-avx512-linux-ipa.o): New rule.
     (amd64-avx-avx512-linux-ipa.o): Likewise.
     (i386-avx-avx512.c): Likewise.
     (i386-avx-avx512-linux.c): Likewise.
     (amd64-avx-avx512.c): Likewise.
     (amd64-avx-avx512-linux.c): Likewise.
     (x32-avx-avx512.c): Rename rule, source files, dat files from
     x32-avx-mpx-avx512.*) to this.
     (x32-avx-avx512-linux.c): Rename rule, source files, dat files from
     x32-avx-mpx-avx512-linux.*) to this.
     * configure.srv (srv_i386_regobj): Add i386-avx-avx512.o.
     (srv_i386_linux_regobj): Add i386-avx-avx512-linux.o.
     (srv_amd64_regobj): Add amd64-avx-avx512.o, rename
     x32-avx-mpx-avx512.o to x32-avx-avx512.o.
     (srv_amd64_linux_regobj): Add amd64-avx-avx512-linux.o, rename
     x32-avx-mpx-avx512-linux.o to x32-avx-avx512-linux.o.
     (ipa_i386_linux_regobj): Add i386-avx-avx512-linux-ipa.o.
     (ipa_amd64_linux_regobj): Add amd64-avx-avx512-linux-ipa.o.
     (srv_i386_xmlfiles): Add i386/i386-avx-avx512.xml.
     (srv_amd64_xmlfiles): Add i386/amd64-avx-avx512.xml, rename
     x32-avx-mpx-avx512.xml to x32-avx-avx512.xml.
     (srv_i386_linux_xmlfiles): Add i386/i386-avx-avx512-linux.xml.
     (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-avx512-linux.xml,
     rename x32-avx-mpx-avx512-linux.xml to x32-avx-avx512-linux.xml.
     * linux-amd64-ipa.c (get_ipa_tdesc): Add dedicated case for
     X86_TDESC_AVX_AVX512 and return appropriate tdesc.
     (initialize_low_tracepoint): Add init_registers_amd64_avx_avx512_linux.
     * linux-i386-ipa.c (get_ipa_tdesc): Add dedicated case for
     X86_TDESC_AVX_AVX512 and return appropriate tdesc.
     (initialize_low_tracepoint): Add init_registers_i386_avx_avx512_linux.
     * linux-x86-low.c (x86_linux_read_description): Add dedicated cases for
     X86_XSTATE_AVX_AVX512_MASK and return appropriate tdesc.
     (x86_get_ipa_tdesc_idx): Rename tdesc_x32_avx_mpx_avx512_linux to
     tdesc_x32_avx_avx512_linux, add dedicated if-clause for
     tdesc_amd64_avx_avx512_linux and return appropriate mask.
     Add dedicated clause for tdesc_i386_avx_avx512_linux
     and return appropriate mask.
     (initialize_low_arch): Add init_registers_amd64_avx_avx512_linux,
     rename init_registers_x32_avx_mpx_avx512_linux, add
     init_registers_i386_avx_avx512_linux.
     * linux-x86-tdesc.h (enum x86_linux_tdesc): Add new value for
     X86_TDESC_AVX_AVX512.
     (init_registers_amd64_avx_avx512_linux): New prototype.
     (tdesc_amd64_avx_avx512_linux): Likewise.
     (init_registers_x32_avx_mpx_avx512_linux): Rename to...
     (init_registers_x32_avx_avx512_linux): ...this.
     (tdesc_x32_avx_mpx_avx512_linux): Rename to...
     (tdesc_x32_avx_avx512_linux): ...this.
     (init_registers_i386_avx_avx512_linux): New prototype.
     (tdesc_i386_avx_avx512_linux): Likewise.

Change-Id: I01359fab56c961a39568df50af39714ec7b31706
Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2017-02-17 11:44:36 +01:00
Michael Sturm 22049425ce Rename target descriptions to reflect actual content of description.
To better reflect the actual feature set covered by the IA target
descriptions, the existing descriptions are renamed. Each feature of
the extended state is added to the name of a description or xstate mask
starting from AVX.
For example, amd64-mpx-avx512-linux becomes amd64-avx-mpx-avx512-linux,
while amd64-avx-linux remains unchanged.
Likewise, the corresponding xstate masks are changed, e.g. from
X86_XSTATE_MPX_AVX512_MASK to X86_XSTATE_AVX_MPX_AVX512_MASK.

gdb/Changelog:
2016-04-18  Michael Sturm  <michael.sturm@intel.com>

     * amd64-linux-tdep.c (features/i386/amd64-avx512-linux.c): Rename
     include to...
     (features/i386/amd64-avx-mpx-avx512-linux.c): ...this.
     (features/i386/x32-avx512-linux.c): Rename include to...
     (features/i386/x32-avx-mpx-avx512-linux.c): ...this.
     (amd64_linux_core_read_description): Rename X86_XSTATE_MPX_AVX512_MASK,
     X86_XSTATE_AVX512_MASK, desc_x32_avx512_linux, tdesc_amd64_avx512_linux.
     (_initialize_amd64_linux_tdep): Rename
     initialize_tdesc_amd64_avx512_linux, initialize_tdesc_x32_avx512_linux.
     * amd64-linux-tdep.h (tdesc_amd64_avx512_linux): Rename to...
     (tdesc_amd64_avx_mpx_avx512_linux): ...this.
     (tdesc_x32_avx512_linux): Rename to...
     (tdesc_x32_avx_mpx_avx512_linux): ...this.
     * amd64-tdep.c (features/i386/amd64-avx512.c): Rename include to...
     (features/i386/amd64-avx-mpx-avx512.c): ...this.
     (features/i386/x32-avx512.c): Rename include to...
     (features/i386/x32-avx-mpx-avx512.c): ...this.
     (amd64_target_description): Rename X86_XSTATE_MPX_AVX512_MASK,
     X86_XSTATE_AVX512_MASK, tdesc_amd64_avx512.
     (_initialize_amd64_tdep): Rename initialize_tdesc_amd64_avx512. Rename
     initialize_tdesc_x32_avx512.
     * common/x86-xstate.h (X86_XSTATE_AVX512_MASK): Rename to...
     (X86_XSTATE_AVX_AVX512_MASK): ...this.
     (86_XSTATE_MPX_AVX512_MASK): Rename to...
     (X86_XSTATE_AVX_MPX_AVX512_MASK): ...this.
     (X86_XSTATE_ALL_MASK): Rename X86_XSTATE_MPX_AVX512_MASK to
     X86_XSTATE_AVX_MPX_AVX512_MASK.
     * features/Makefile (WHICH): Rename i386/i386-avx512,
     i386/i386-avx512-linux, i386/amd64-avx512, i386/amd64-avx512-linux,
     i386/x32-avx512, i386/x32-avx512-linux.
     (i386/i386-avx512-expedite, i386/i386-avx512-linux-expedite,
     i386/amd64-avx512-expedite, i386/amd64-avx512-linux-expedite,
     i386/x32-avx512-expedite, i386/x32-avx512-linux-expedite): Rename
     expedites.
     (XMLTOC): Rename i386/amd64-avx512-linux.xml, i386/amd64-avx512.xml,
     i386/i386-avx512-linux.xml, i386/i386-avx512.xml,
     i386/x32-avx512-linux.xml, i386/x32-avx512.xml.
     ($(outdir)/i386/i386-avx512.dat): Rename dat file in rule.
     ($(outdir)/i386/i386-avx512-linux.dat): Likewise.
     ($(outdir)/i386/amd64-avx512.dat): Likewise.
     ($(outdir)/i386/amd64-avx512-linux.dat): Likewise.
     ($(outdir)/i386/x32-avx512.dat): Likewise.
     ($(outdir)/i386/x32-avx512-linux.dat): Likewise.
     * features/i386/amd64-avx512-linux.c: Regenerate from renamed XML file.
     * features/i386/amd64-avx512-linux.xml: Rename XML file.
     * features/i386/amd64-avx512.c: Regenerate from renamed XML file.
     * features/i386/amd64-avx512.xml: Rename XML file.
     * features/i386/i386-avx512-linux.c: Regenerate from renamed XML file.
     * features/i386/i386-avx512-linux.xml: Rename XML file.
     * features/i386/i386-avx512.c: Regenerate from renamed XML file.
     * features/i386/i386-avx512.xml: Rename XML file.
     * features/i386/x32-avx512-linux.c: Regenerate from renamed XML file.
     * features/i386/x32-avx512-linux.xml: Rename XML file.
     * features/i386/x32-avx512.c: Regenerate from renamed XML file.
     * features/i386/x32-avx512.xml: Rename XML file.
     * i386-linux-tdep.c (features/i386/i386-avx512-linux.c): Rename to...
     (features/i386/i386-avx-mpx-avx512-linux.c): ...this.
     (i386_linux_core_read_description): Rename X86_XSTATE_MPX_AVX512_MASK,
     X86_XSTATE_AVX512_MASK, tdesc_i386_avx512_linux.
     (_initialize_i386_linux_tdep): Rename initialize_tdesc_i386_avx512_linux.
     * i386-linux-tdep.h (tdesc_i386_avx512_linux): Rename to...
     (tdesc_i386_avx_mpx_avx512_linux): ...this.
     * i386-tdep.c (features/i386/i386-avx512.c): Rename to...
     (features/i386/i386-avx-mpx-avx512.c): ...this.
     (i386_register_reggroup_p): Rename X86_XSTATE_AVX512_MASK.
     (i386_validate_tdesc_p): Likewise.
     (i386_target_description): Rename X86_XSTATE_MPX_AVX512_MASK,
     tdesc_i386_avx512.
     (_initialize_i386_tdep): Rename initialize_tdesc_i386_avx512.
     * regformats/i386/amd64-avx512-linux.dat: Regenerate from renamed XML
     file.
     * regformats/i386/amd64-avx512.dat: Likewise.
     * regformats/i386/i386-avx512-linux.dat: Likewise.
     * regformats/i386/i386-avx512.dat: Likewise.
     * regformats/i386/x32-avx512-linux.dat: Likewise.
     * regformats/i386/x32-avx512.dat: Likewise.
     * x86-Linux-nat.c (x86_linux_read_description): Rename
     X86_XSTATE_MPX_AVX512_MASK, X86_XSTATE_AVX512_MASK,
     tdesc_x32_avx512_linux, tdesc_amd64_avx512_linux, tdesc_i386_avx512_linux.

gdbserver/Changelog:
2016-04-18  Michael Sturm  <michael.sturm@intel.com>

     * Makefile.in (clean): Rename i386-avx512.c, i386-avx512-linux.c,
     amd64-avx512.c, amd64-avx512-linux.c, x32-avx512.c, x32-avx512-linux.c.
     (i386-avx512-linux-ipa.o): Rename rule and source files.
     (amd64-avx512-linux-ipa.o): Likewise.
     (i386-avx512.c): Rename rule, source fils and dat files.
     (i386-avx512-linux.c): Likewise.
     (amd64-avx512.c): Likewise.
     (amd64-avx512-linux.c): Likewise.
     (x32-avx512.c): Likewise.
     (x32-avx512-linux.c): Likewise.
     * configfure.srv (srv_i386_regobj): Rename i386-avx512.o.
     (i386_linux_regobj): Rename i386-avx512-linux.o.
     (srv_amd64_regobj): Rename amd64-avx512.o, x32-avx512.o.
     (srv_amd64_linux_regobj): Rename amd64-avx512-linux.o,
     x32-avx512-linux.o.
     (ipa_i386_linux_regobj): Rename i386-avx512-linux-ipa.o.
     (ipa_amd64_linux_regobj): Rename amd64-avx512-linux-ipa.o.
     (srv_i386_xmlfiles): Rename i386/i386-avx512.xml.
     (srv_amd64_xmlfiles): Rename i386/amd64-avx512.xml, i386/x32-avx512.xml.
     (srv_i386_linux_xmlfiles): Rename i386/i386-avx512-linux.xml.
     (srv_amd64_linux_xmlfiles): Rename i386/amd64-avx512-linux.xml,
     i386/x32-avx512-linux.xml).
     * linux-amd64-ipa.c (get_ipa_tdesc): Rename X86_TDESC_AVX512 and returned
     tdesc for that case.
     (initialize_low_tracepoint): Rename init_registers_amd64_avx512_linux.
     * linux-i386-ipa.c (get_ipa_tdesc): Rename X86_TDESC_AVX512 and tdesc
     returned for that case.
     (initialize_low_tracepoint): Rename init_registers_i386_avx512_linux.
     * linux-x86-low.c (x86_linux_read_description): Rename
     X86_XSTATE_AVX512_MASK and tdesc returned for that case.
     (x86_get_ipa_tdesc_idx): Rename tdesc_amd64_avx512_linux,
     tdesc_x32_avx512_linux and mask returned for these descriptions.
     Rename tdesc_i386_avx512_linux and mask returned for that description.
     (initialize_low_arch): Rename init_registers_amd64_avx512_linux,
     init_registers_x32_avx512_linux, init_registers_i386_avx512_linux.
     * linux-x86-tdesc.h (enum x86_linux_tdesc): Rename X86_TDESC_AVX512.
     (init_registers_amd64_avx512_linux): Rename to...
     (init_registers_amd64_avx_mpx_avx512_linux): ...this.
     (tdesc_amd64_avx512_linux): Rename to...
     (tdesc_amd64_avx_mpx_avx512_linux): ...this.
     (init_registers_x32_avx512_linux): Rename to...
     (init_registers_x32_avx_mpx_avx512_linux): ...this.
     (tdesc_x32_avx512_linux): Rename to...
     (tdesc_x32_avx_mpx_avx512_linux): ...this.
     (init_registers_i386_avx512_linux): Rename to...
     (init_registers_i386_avx_mpx_avx512_linux): ...this.
     (tdesc_i386_avx512_linux): Rename to...
     (tdesc_i386_avx_mpx_avx512_linux): ...this.

Change-Id: Idb83be3b3b72d5487542d4b568193df2777a3d9d
Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2017-02-17 11:44:24 +01:00
Joel Brobecker 61baf725ec update copyright year range in GDB files
This applies the second part of GDB's End of Year Procedure, which
updates the copyright year range in all of GDB's files.

gdb/ChangeLog:

        Update copyright year range in all GDB files.
2017-01-01 10:52:34 +04:00
Walfred Tedeschi 2b863f512d Add target descriptions for AVX + MPX
The current MPX target descriptions assume that MPX is always combined
with AVX, however that's not correct.  We can have machines with MPX
and without AVX; or machines with AVX and without MPX.

This patch adds new target descriptions for machines that support
both MPX and AVX, as duplicates of the existing MPX descriptions.

The following commit will remove AVX from the MPX-only descriptions.


2016-04-16  Walfred Tedeschi  <walfred.tedeschi@intel.com>

gdb/ChangeLog:

	* amd64-linux-tdep.c (features/i386/amd64-avx-mpx-linux.c):
	New include.
	(amd64_linux_core_read_description): Add case for
	 X86_XSTATE_AVX_MPX_MASK.
	(_initialize_amd64_linux_tdep): Call initialize_tdesc_amd64_avx_mpx_linux.
	* amd64-linux-tdep.h (tdesc_amd64_avx_mpx_linux): New definition.
	* amd64-tdep.c (features/i386/amd64-avx-mpx.c): New include.
	(amd64_target_description): Add case for  X86_XSTATE_AVX_MPX_MASK.
	(_initialize_amd64_tdep): Call initialize_tdesc_amd64_avx_mpx.
	* common/x86-xstate.h (X86_XSTATE_MPX_MASK): Remove AVX bits.
	(X86_XSTATE_AVX_MPX_MASK): New case.
	* features/Makefile (i386/i386-avx-mpx, i386/i386-avx-mpx-linux)
	(i386/amd64-avx-mpx, i386/amd64-avx-mpx-linux): New rules.
	(i386/i386-avx-mpx-expedite, i386/i386-avx-mpx-linux-expedite)
	(i386/amd64-avx-mpx-expedite, i386/amd64-avx-mpx-linux-expedite):
	New expedites.
	* i386-linux-tdep.c (features/i386/i386-avx-mpx-linux.c): New
	include.
	(i386_linux_core_read_description): Add case
	X86_XSTATE_AVX_MPX_MASK.
	(_initialize_i386_linux_tdep): Call
	initialize_tdesc_i386_avx_mpx_linux.
	* i386-linux-tdep.h (tdesc_i386_avx_mpx_linux): New include.
	* i386-tdep.c (features/i386/i386-avx-mpx.c): New include.
	(i386_target_description): Add case for X86_XSTATE_AVX_MPX_MASK.
	* x86-linux-nat.c (x86_linux_read_description): Add case for
	X86_XSTATE_AVX_MPX_MASK.
	* features/i386/amd64-avx-mpx-linux.xml: New file.
	* features/i386/i386-avx-mpx-linux.xml: New file.
	* features/i386/i386-avx-mpx.xml: New file.
	* features/i386/amd64-avx-mpx.xml: New file.
	* features/i386/amd64-avx-mpx-linux.c: Generated.
	* features/i386/amd64-avx-mpx.c: Generated.
	* features/i386/i386-avx-mpx-linux.c: Generated.
	* features/i386/i386-avx-mpx.c: Generated.
	* regformats/i386/amd64-avx-mpx-linux.dat: Generated.
	* regformats/i386/amd64-avx-mpx.dat: Generated.
	* regformats/i386/i386-avx-mpx-linux.dat: Generated.
	* regformats/i386/i386-avx-mpx.dat: Generated.

gdb/gdbserver/ChangeLog:

	* Makefile.in (clean): Add removal for i386-avx-mpx.c,
	i386-avx-mpx-linux.c, amd64-avx-mpx.c and amd64-avx-mpx-linux.c.
	(i386-avx-mpx.c, i386-avx-mpx-linux.c, amd64-avx-mpx.c)
	(amd64-avx-mpx-linux.c): New rules.
	(amd64-avx-mpx-linux-ipa.o, i386-avx-mpx-linux-ipa.o): New rule.
	* configure.srv (srv_i386_regobj): Add i386-avx-mpx.o.
	(srv_i386_linux_regobj): Add i386-avx-mpx-linux.o.
	(srv_amd64_regobj): Add amd64-avx-mpx.o.
	(srv_amd64_linux_regobj): Add amd64-avx-mpx-linux.o.
	(srv_i386_xmlfiles): Add i386/i386-avx-mpx.xml.
	(srv_amd64_xmlfiles): Add i386/amd64-avx-mpx.xml.
	(srv_i386_linux_xmlfiles): Add i386/i386-avx-mpx-linux.xml.
	(srv_amd64_linux_xmlfiles): Add i386/amd64-avx-mpx-linux.xml.
	(ipa_i386_linux_regobj): Add i386-avx-mpx-linux-ipa.o.
	(ipa_amd64_linux_regobj): Add amd64-avx-mpx-linux-ipa.o.
	* linux-x86-low.c (x86_linux_read_description): Add case for
	X86_XSTATE_AVX_MPX_MASK.
	(x86_get_ipa_tdesc_idx): Add cases for avx_mpx.
	(initialize_low_arch): Call init_registers_amd64_avx_mpx_linux and
	init_registers_i386_avx_mpx_linux.
	* linux-i386-ipa.c (get_ipa_tdesc): Add case for avx_mpx.
	(initialize_low_tracepoint): Call
	init_registers_i386_avx_mpx_linux.
	* linux-amd64-ipa.c (get_ipa_tdesc):  Add case for avx_mpx.
	(initialize_low_tracepoint): Call
	init_registers_amd64_avx_mpx_linux.
	* linux-x86-tdesc.h (X86_TDESC_AVX_MPX): New enum value.
	(init_registers_amd64_avx_mpx_linux, tdesc_amd64_avx_mpx_linux)
	(init_registers_i386_avx_mpx_linux, tdesc_i386_avx_mpx_linux): New
	declarations.
2016-04-19 15:44:32 +02:00
Walfred Tedeschi 012b3a217a Intel MPX bound violation handling
With Intel Memory Protection Extensions it was introduced the concept of
boundary violation.  A boundary violations is presented to the inferior as
a segmentation fault having SIGCODE 3.  This patch adds a
handler for a boundary violation extending the information displayed
when a bound violation is presented to the inferior.  In the stop mode
case the debugger will also display the kind of violation: "upper" or
"lower", bounds and the address accessed.
On no stop mode the information will still remain unchanged.  Additional
information about bound violations are not meaningful in that case user
does not know the line in which violation occurred as well.

When the segmentation fault handler is stop mode the out puts will be
changed as exemplified below.

The usual output of a segfault is:
Program received signal SIGSEGV, Segmentation fault
0x0000000000400d7c in upper (p=0x603010, a=0x603030, b=0x603050,
c=0x603070, d=0x603090, len=7) at i386-mpx-sigsegv.c:68
68        value = *(p + len);

In case it is a bound violation it will be presented as:
Program received signal SIGSEGV, Segmentation fault
Upper bound violation while accessing address 0x7fffffffc3b3
Bounds: [lower = 0x7fffffffc390, upper = 0x7fffffffc3a3]
0x0000000000400d7c in upper (p=0x603010, a=0x603030, b=0x603050,
c=0x603070, d=0x603090, len=7) at i386-mpx-sigsegv.c:68
68        value = *(p + len);

In mi mode the output of a segfault is:
*stopped,reason="signal-received",signal-name="SIGSEGV",
signal-meaning="Segmentation fault", frame={addr="0x0000000000400d7c",
func="upper",args=[{name="p", value="0x603010"},{name="a",value="0x603030"}
,{name="b",value="0x603050"}, {name="c",value="0x603070"},
{name="d",value="0x603090"},{name="len",value="7"}],
file="i386-mpx-sigsegv.c",fullname="i386-mpx-sigsegv.c",line="68"},
thread-id="1",stopped-threads="all",core="6"

in the case of a bound violation:
*stopped,reason="signal-received",signal-name="SIGSEGV",
signal-meaning="Segmentation fault",
sigcode-meaning="Upper bound violation",
lower-bound="0x603010",upper-bound="0x603023",bound-access="0x60302f",
frame={addr="0x0000000000400d7c",func="upper",args=[{name="p",
value="0x603010"},{name="a",value="0x603030"},{name="b",value="0x603050"},
{name="c",value="0x603070"},{name="d",value="0x603090"},
{name="len",value="7"}],file="i386-mpx-sigsegv.c",
fullname="i386-mpx-sigsegv.c",line="68"},thread-id="1",
stopped-threads="all",core="6"

2016-02-18  Walfred Tedeschi  <walfred.tedeschi@intel.com>

gdb/ChangeLog:

	* NEWS: Add entry for bound violation.
	* amd64-linux-tdep.c (amd64_linux_init_abi_common):
	Add handler for segmentation fault.
	* gdbarch.sh (handle_segmentation_fault): New.
	* gdbarch.c: Regenerate.
	* gdbarch.h: Regenerate.
	* i386-linux-tdep.c (i386_linux_handle_segmentation_fault): New.
	(SIG_CODE_BONDARY_FAULT): New define.
	(i386_linux_init_abi): Use i386_mpx_bound_violation_handler.
	* i386-linux-tdep.h (i386_linux_handle_segmentation_fault) New.
	* i386-tdep.c (i386_mpx_enabled): Add as external.
	* i386-tdep.c (i386_mpx_enabled): Add as external.
	* infrun.c (handle_segmentation_fault): New function.
	(print_signal_received_reason): Use handle_segmentation_fault.

gdb/testsuite/ChangeLog:

	* gdb.arch/i386-mpx-sigsegv.c: New file.
	* gdb.arch/i386-mpx-sigsegv.exp: New file.
	* gdb.arch/i386-mpx-simple_segv.c: New file.
	* gdb.arch/i386-mpx-simple_segv.exp: New file.

gdb/doc/ChangeLog:

	* gdb.texinfo (Signals): Add bound violation display hints for
	a SIGSEGV.
2016-02-18 17:25:49 +01:00
Walfred Tedeschi 190b495d47 Use linux_get_siginfo_type_with_fields for x86
Use linux_get_siginfo_type_with_fields for adding bound fields on
segmentation fault for i386/amd64 siginfo.

2016-02-02  Walfred Tedeschi  <walfred.tedeschi@intel.com>

gdb/ChangeLog:

	* linux-tdep.h (linux_get_siginfo_type_with_fields): Make extern.
	* linux-tdep.c (linux_get_siginfo_type_with_fields): Make extern.
	* i386-linux-tdep.h (x86_linux_get_siginfo_type): New
	function.
	* amd64-linux-tdep.c (amd64_linux_init_abi_common): Add
	x86_linux_get_siginfo_type for the amd64 abi.
	* i386-linux-tdep.c (x86_linux_get_siginfo_type): New
	function.
	(i386_linux_init_abi): Add new function at the i386 ABI
	initialization.
2016-02-02 11:50:17 +01:00
Joel Brobecker 618f726fcb GDB copyright headers update after running GDB's copyright.py script.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2016-01-01 08:43:22 +04:00
Joel Brobecker 32d0add0a6 Update year range in copyright notice of all files owned by the GDB project.
gdb/ChangeLog:

        Update year range in copyright notice of all files.
2015-01-01 13:32:14 +04:00
Michael Sturm 01f9f808e2 Add AVX512 registers support to GDB and GDBserver.
This patch adds support for the Intel(R) Advanced Vector
Extensions 512 (Intel(R) AVX-512) registers.  Native and remote
debugging are covered by this patch.

Intel(R) AVX-512 is an extension to AVX to support 512-bit wide
SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31).
The number of available registers in 32-bit mode is still 8
(XMM0-7, YMM0-7, ZMM0-7).  The lower 256-bits of the ZMM registers
are aliased to the respective 256-bit YMM registers.  The lower
128-bits are aliased to the respective 128-bit XMM registers.

There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit
mode and 64-bit mode.

For more information please see
Intel(R) Developer Zone: Intel(R) AVX
http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495

Intel(R) Architecture Instruction Set Extensions Programming Reference:
http://software.intel.com/en-us/file/319433-017pdf

2014-04-24  Michael Sturm  <michael.sturm@mintel.com>
            Walfred Tedeschi  <walfred.tedeschi@intel.com>

     * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add
     AVX512 registers.
     (amd64_linux_read_description): Add code to handle AVX512 xstate
     mask and return respective tdesc.
     * amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c
     and features/i386/x32-avx512-linux.c.
     (amd64_linux_gregset_reg_offset): Add AVX512 registers.
     (amd64_linux_core_read_description): Add code to handle AVX512
     xstate mask and return respective tdesc.
     (_initialize_amd64_linux_tdep): Initialize AVX512 tdesc.
     * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum
     calculation.
     (AMD64_LINUX_NUM_REGS): Adjust to new number of registers.
     (tdesc_amd64_avx512_linux): New prototype.
     (tdesc_x32_avx512_linux): Likewise.
     * amd64-tdep.c: Include features/i386/amd64-avx512.c and
     features/i386/x32-avx512.c.
     (amd64_ymm_avx512_names): New register names for pseudo
     registers YMM16-31.
     (amd64_ymmh_avx512_names): New register names for raw registers
     YMMH16-31.
     (amd64_k_names): New register names for K registers.
     (amd64_zmmh_names): New register names for ZMM raw registers.
     (amd64_zmm_names): New registers names for ZMM pseudo registers.
     (amd64_xmm_avx512_names): New register names for XMM16-31
     registers.
     (amd64_pseudo_register_name): Add code to return AVX512 pseudo
     registers.
     (amd64_init_abi): Add code to intitialize AVX512 tdep variables
     if feature is present.
     (_initialize_amd64_tdep): Call AVX512 tdesc initializers.
     * amd64-tdep.h (enum amd64_regnum): Add AVX512 registers.
     (AMD64_NUM_REGS): Adjust to new number of registers.
     * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of
     registers supplied via XSTATE by AVX512 registers.
     (i386_linux_read_description): Add case for AVX512.
     * i386-linux-tdep.c: Include i386-avx512-linux.c.
     (i386_linux_gregset_reg_offset): Add AVX512 registers.
     (i386_linux_core_read_description): Add case for AVX512.
     (i386_linux_init_abi): Install supported register note section
     for AVX512.
     (_initialize_i386_linux_tdep): Add call to tdesc init function for
     AVX512.
     * i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of
     registers to be number of zmm7h + 1.
     (tdesc_i386_avx512_linux): Add tdesc for AVX512 registers.
     * i386-tdep.c: Include features/i386/i386-avx512.c.
     (i386_zmm_names): Add ZMM pseudo register names array.
     (i386_zmmh_names): Add ZMM raw register names array.
     (i386_k_names): Add K raw register names array.
     (num_lower_zmm_regs): Add constant for the number of lower ZMM
     registers. AVX512 has 16 more ZMM registers than there are YMM
     registers.
     (i386_zmmh_regnum_p): Add function to look up register number of
     ZMM raw registers.
     (i386_zmm_regnum_p): Likewise for ZMM pseudo registers.
     (i386_k_regnum_p): Likewise for K raw registers.
     (i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw
     registers added by AVX512.
     (i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo
     registers added by AVX512.
     (i386_xmm_avx512_regnum_p): Likewise for additional XMM registers
     added by AVX512.
     (i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31.
     (i386_pseudo_register_name): Add ZMM pseudo registers.
     (i386_zmm_type): Construct and return vector registers type for ZMM
     registers.
     (i386_pseudo_register_type): Return appropriate type for YMM16-31,
     ZMM0-31 pseudo registers and K registers.
     (i386_pseudo_register_read_into_value): Add code to read K, ZMM
     and YMM16-31 registers from register cache.
     (i386_pseudo_register_write): Add code to write  K, ZMM and
     YMM16-31 registers.
     (i386_register_reggroup_p): Add code to include/exclude AVX512
     registers in/from respective register groups.
     (i386_validate_tdesc_p): Handle AVX512 feature, add AVX512
     registers if feature is present in xcr0.
     (i386_gdbarch_init): Add code to initialize AVX512 feature
     variables in tdep structure, wire in pseudo registers and call
     initialize_tdesc_i386_avx512.
     * i386-tdep.h (struct gdbarch_tdep): Add AVX512 related
     variables.
     (i386_regnum): Add AVX512 registers.
     (I386_SSE_NUM_REGS): New define for number of SSE registers.
     (I386_AVX_NUM_REGS): Likewise for AVX registers.
     (I386_AVX512_NUM_REGS): Likewise for AVX512 registers.
     (I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are
     512 bits wide.
     (i386_xmm_avx512_regnum_p): New prototype for register look up.
     (i386_ymm_avx512_regnum_p): Likewise.
     (i386_k_regnum_p): Likewise.
     (i386_zmm_regnum_p): Likewise.
     (i386_zmmh_regnum_p): Likewise.
     * i387-tdep.c : Update year in copyright notice.
     (xsave_ymm_avx512_offset): New table for YMM16-31 offsets in
     XSAVE buffer.
     (XSAVE_YMM_AVX512_ADDR): New macro.
     (xsave_xmm_avx512_offset): New table for XMM16-31 offsets in
     XSAVE buffer.
     (XSAVE_XMM_AVX512_ADDR): New macro.
     (xsave_avx512_k_offset): New table for K register offsets in
     XSAVE buffer.
     (XSAVE_AVX512_K_ADDR): New macro.
     (xsave_avx512_zmm_h_offset): New table for ZMM register offsets
     in XSAVE buffer.
     (XSAVE_AVX512_ZMM_H_ADDR): New macro.
     (i387_supply_xsave): Add code to supply AVX512 registers to XSAVE
     buffer.
     (i387_collect_xsave): Add code to collect AVX512 registers from
     XSAVE buffer.
     * i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number
     of XMM16-31 registers.
     (I387_NUM_K_REGS): New define for number of K registers.
     (I387_K0_REGNUM): New define for K0 register number.
     (I387_NUM_ZMMH_REGS): New define for number of ZMMH registers.
     (I387_ZMM0H_REGNUM): New define for ZMM0H register number.
     (I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31
     registers.
     (I387_YMM16H_REGNUM): New define for YMM16H register number.
     (I387_XMM16_REGNUM): New define for XMM16 register number.
     (I387_YMM0_REGNUM): New define for YMM0 register number.
     (I387_KEND_REGNUM): New define for last K register number.
     (I387_ZMMENDH_REGNUM): New define for last ZMMH register number.
     (I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register
     number.
     (I387_XMM_AVX512_END_REGNUM): New define for XMM31 register
     number.
     * common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE
     size.
     * features/Makefile: Add AVX512 related files.
     * features/i386/32bit-avx512.xml: New file.
     * features/i386/64bit-avx512.xml: Likewise.
     * features/i386/amd64-avx512-linux.c: Likewise.
     * features/i386/amd64-avx512-linux.xml: Likewise.
     * features/i386/amd64-avx512.c: Likewise.
     * features/i386/amd64-avx512.xml: Likewise.
     * features/i386/i386-avx512-linux.c: Likewise.
     * features/i386/i386-avx512-linux.xml: Likewise.
     * features/i386/i386-avx512.c: Likewise.
     * features/i386/i386-avx512.xml: Likewise.
     * features/i386/x32-avx512-linux.c: Likewise.
     * features/i386/x32-avx512-linux.xml: Likewise.
     * features/i386/x32-avx512.c: Likewise.
     * features/i386/x32-avx512.xml: Likewise.
     * regformats/i386/amd64-avx512-linux.dat: New file.
     * regformats/i386/amd64-avx512.dat: Likewise.
     * regformats/i386/i386-avx512-linux.dat: Likewise.
     * regformats/i386/i386-avx512.dat: Likewise.
     * regformats/i386/x32-avx512-linux.dat: Likewise.
     * regformats/i386/x32-avx512.dat: Likewise.
     * NEWS: Add note about new support for AVX512.

testsuite/
     * Makefile.in (EXECUTABLES): Added i386-avx512.
     * gdb.arch/i386-avx512.c: New file.
     * gdb.arch/i386-avx512.exp: Likewise.

gdbserver/
     * Makefile.in: Added rules to handle new files
     i386-avx512.c i386-avx512-linux.c amd64-avx512.c
     amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c.
     * configure.srv (srv_i386_regobj): Add i386-avx512.o.
     (srv_i386_linux_regobj): Add i386-avx512-linux.o.
     (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o.
     (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and
     x32-avx512-linux.o.
     (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml.
     (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml.
     (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and
     i386/x32-avx512.xml.
     (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml.
     (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and
     i386/x32-avx512-linux.xml.
     * i387-fp.c (num_avx512_k_registers): New constant for number
     of K registers.
     (num_avx512_zmmh_low_registers): New constant for number of
     lower ZMM registers (0-15).
     (num_avx512_zmmh_high_registers): New constant for number of
     higher ZMM registers (16-31).
     (num_avx512_ymmh_registers): New contant for number of higher
     YMM registers (ymm16-31 added by avx521 on x86_64).
     (num_avx512_xmm_registers): New constant for number of higher
     XMM registers (xmm16-31 added by AVX512 on x86_64).
     (struct i387_xsave): Add space for AVX512 registers.
     (i387_cache_to_xsave): Change raw buffer size to 64 characters.
     Add code to handle AVX512 registers.
     (i387_xsave_to_cache): Add code to handle AVX512 registers.
     * linux-x86-low.c (init_registers_amd64_avx512_linux): New
     prototypei from generated file.
     (tdesc_amd64_avx512_linux): Likewise.
     (init_registers_x32_avx512_linux): Likewise.
     (tdesc_x32_avx512_linux): Likewise.
     (init_registers_i386_avx512_linux): Likewise.
     (tdesc_i386_avx512_linux): Likewise.
     (x86_64_regmap): Add AVX512 registers.
     (x86_linux_read_description): Add code to handle AVX512 XSTATE
     mask.
     (initialize_low_arch): Add code to initialize AVX512 registers.

doc/
     * gdb.texinfo (i386 Features): Add description of AVX512
     registers.

Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438
Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2014-04-24 16:30:03 +02:00
Joel Brobecker ecd75fc8ee Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
Walfred Tedeschi 1dbcd68cf1 Add MPX support for i386
2013-11-20  Walfred Tedeschi  <walfred.tedeschi@intel.com>

	* i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Add MPX
	registers on the range of registers to be read from
	xsave buffer.
	(i386_linux_read_description): Add case for MPX.
	* i386-linux-tdep.c: Include features/i386/i386-mpx-linux.c.
	(i386_linux_gregset_reg_offset): Add MPX registers.
	(i386_linux_core_read_description): Initialize also MPX.
	(_initialize_i386_linux_tdep): Add mpx initialization.
	* i386-tdep.h (gdbarch_tdep): Add fields bnd0r_regnum, bnd0_regnum,
	mpx_register_names.
	(i386_regnum): Add MPX registers.
	(I386_MPX_NUM_REGS): New macro.
	(i386_bnd_regnum_p): New function.
	* i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set
	number of registers to be the number of BNDSTATUS.
	(tdesc_i386_mpx_linux): Add description for MPX Linux registers.
	* i386-tdep.c: Include features/i386/i386-mpx.c.
	(i386_mpx_names): Add MPX register names array.
	(i386_bnd_names): Add bnd pseudo register names array.
	(i386_bndr_regnum_p): Lookup register numbers for bnd raw
	registers.
	(i386_bndr_regnum_p): Lookup register numbers for bnd raw registers.
	(386_mpx_ctrl_regnum_p): Lookup register numbers for MPX control
	registers.
	(i386_bnd_type): New function.
	(i386_pseudo_register_type): Use i386_bnd_type for bnd pseudo
	register types.
	(i386_pseudo_register_read_into_value): Add bnd case.
	(i386_pseudo_register_write): Add bnd pseudo registers.
	(i386_register_reggroup_p): Add MPX register to the group all.
	(i386_validate_tdesc_p): Add MPX to the target 	description
	validation.
	(i386_pseudo_register_name): Add bnd pseudo registers.
	(i386_gdbarch_init): Add MPX for architecture initialization.
	(_initia_initialize_i386_tdep): Add mpx initialization.
	* i387-tdep.c (xsave_mpx_offset): New vector for MPX offsets on
	XSAVE buffer.
	(XSAVE_MPX_ADDR): New macro.
	(i387_supply_xsave): Add MPX case.
	(i387_collect_xsave): Add MPX case.
	* i387-tdep.h (I387_BND0R_REGNUM): New macro.
	(I387_BNDCFGU_REGNUM): New macro.
	(I387_NUM_MPX_REGS): New macro.
	(I387_NUM_BND_REGS): New macro.
	(I387_NUM_MPX_CTRL_REGS): New macro.
	(I387_MPXEND_REGNUM): New macro.
	* common/i386-xstate.h (I386_XSTATE_BNDREGS): New macro.
	(I386_XSTATE_BNDCFG): Likewise.
	(I386_XSTATE_MPX_MASK): Likewise.
	(I386_XSTATE_ALL_MASK): New macro represents flags for all states.
	(I386_XSTATE_BNDREGS_SIZE): New macro.
	(I386_XSTATE_BNDCFG_SIZE): Likewise.
	(I386_XSTATE_SIZE): Adapt for MPX.
	(I386_XSTATE_MAX_SIZE): Likewise.

Change-Id: I9ddb7d49434d86fa18eb6b99515203d7c567aefd
Signed-off-by: Walfred Tedeschi <walfred.tedeschi@intel.com>

Conflicts:

	gdb/ChangeLog
2013-11-20 14:42:50 +01:00
Yao Qi 6df81a635e gdb/
* i386-tdep.c (i386_in_stack_tramp_p): Remove unused
	parameter 'gdbarch'.
	(i386_stack_tramp_frame_sniffer): Caller update.
	* i386-linux-tdep.c (i386_linux_core_read_xcr0): Remove
	parameter 'gdbarch' and 'target'.
	(i386_linux_core_read_description): Caller update.
	* amd64-linux-tdep.c (amd64_linux_core_read_description):
	Likewise.
	* i386-linux-tdep.h (i386_linux_core_read_xcr0): Update
	declaration.
2013-07-23 07:02:03 +00:00
Joel Brobecker 28e7fd6234 Update years in copyright notice for the GDB files.
Two modifications:
  1. The addition of 2013 to the copyright year range for every file;
  2. The use of a single year range, instead of potentially multiple
     year ranges, as approved by the FSF.
2013-01-01 06:33:28 +00:00
Joel Brobecker 0b30217134 Copyright year update in most files of the GDB Project.
gdb/ChangeLog:

        Copyright year update in most files of the GDB Project.
2012-01-04 08:17:56 +00:00
Joel Brobecker 7b6bb8daac run copyright.sh for 2011. 2011-01-01 15:34:07 +00:00
H.J. Lu be0d295484 Remove regmap from i386-linux-nat.c.
2010-04-22  H.J. Lu  <hongjiu.lu@intel.com>

	* i386-linux-nat.c (regmap): Removed.
	(fetch_register): Replace regmap with
	i386_linux_gregset_reg_offset.
	(store_register): Likewise.
	(supply_gregset): Likewise.
	(fill_gregset): Likewise.

	* i386-linux-tdep.c (i386_linux_gregset_reg_offset): Make it
	global.

	* i386-linux-tdep.h (i386_linux_gregset_reg_offset): New.
2010-04-22 20:35:28 +00:00
H.J. Lu 3a13a53b43 Support i386 without SSE.
gdb/

2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>

	* i386-linux-nat.c (have_ptrace_getfpxregs): Initialize to -1
	if HAVE_PTRACE_GETFPXREGS is defined.
	(i386_linux_read_description): Set have_ptrace_getfpxregs and
	have_ptrace_getregset to 0 if ptrace PTRACE_GETFPXREGS failed.

	* i386-linux-tdep.c: Include "features/i386/i386-mmx-linux.c"
	(i386_linux_core_read_description): Return tdesc_i386_mmx_linux
	if .reg-xfp section doesn't exist.
	(_initialize_i386_linux_tdep): Call initialize_tdesc_i386_mmx_linux.

	* i386-linux-tdep.h (tdesc_i386_mmx_linux): New.

	* i386-tdep.c: Include "features/i386/i386-mmx.c".
	(i386_go32_init_abi): Set tdesc to tdesc_i386_mmx.
	(i386_validate_tdesc_p): Make org.gnu.gdb.i386.sse optional.  Set
	xcr0 to I386_XSTATE_X87_MASK if SSE isn't available.
	(i386_gdbarch_init): Update comments.
	(_initialize_i386_tdep): Call initialize_tdesc_i386_mmx.

	* common/i386-xstate.h (I386_XSTATE_X87_MASK): New.

	* config/djgpp/fnchange.lst: Add i386 MMX XML files.

	* features/Makefile (i386/i386-mmx-expedite): New.
	(i386/i386-mmx-linux-expedite): Likewise.
	($(outdir)/i386/i386-mmx.dat): Likewise.
	($(outdir)/i386/i386-mmx-linux.dat): Likewise.

	* features/i386/i386-mmx-linux.c: New.
	* features/i386/i386-mmx-linux.xml: Likewise.
	* features/i386/i386-mmx.c: Likewise.
	* features/i386/i386-mmx.xml: Likewise.
	* regformats/i386/i386-mmx-linux.dat: Likewise.
	* regformats/i386/i386-mmx.dat: Likewise.

	* features/Makefile (WHICH): Add i386/i386-mmx and
	i386/i386-mmx-linux.

gdb/doc/

2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>

	* gdb.texinfo (i386 Features): Make org.gnu.gdb.i386.avx
	optional.  Make org.gnu.gdb.i386.avx requires
	org.gnu.gdb.i386.avx.

gdb/gdbserver/

2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
	(i386-mmx.o): New.
	(i386-mmx.c): Likewise.
	(i386-mmx-linux.o): Likewise.
	(i386-mmx-linux.c): Likewise.

	* configure.srv (srv_i386_regobj): Add i386-mmx.o.
	(srv_i386_linux_regobj): Add i386-mmx-linux.o.
	(srv_i386_xmlfiles): Add i386/i386-mmx.xml.
	(srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.

	* linux-x86-low.c (init_registers_i386_mmx_linux): New.
	(x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
	and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
2010-04-08 22:32:38 +00:00
H.J. Lu c131fcee79 Support i386 AVX.
2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>

	* i386-linux-nat.c: Include "regset.h", "elf/common.h",
	<sys/uio.h> and "i386-xstate.h".
	(PTRACE_GETREGSET): New.
	(PTRACE_SETREGSET): Likewise.
	(fetch_xstateregs): Likewise.
	(store_xstateregs): Likewise.
	(GETXSTATEREGS_SUPPLIES): Likewise.
	(regmap): Include 8 upper YMM registers.
	(i386_linux_fetch_inferior_registers): Support XSAVE extended
	state.
	(i386_linux_store_inferior_registers): Likewise.
	(i386_linux_read_description): Check and enable AVX target
	descriptions.

	* i386-linux-tdep.c: Include "regset.h", "i387-tdep.h",
	"i386-xstate.h" and "features/i386/i386-avx-linux.c".
	(i386_linux_regset_sections): Add ".reg-xstate".
	(i386_linux_gregset_reg_offset): Include 8 upper YMM registers.
	(i386_linux_core_read_xcr0): New.
	(i386_linux_core_read_description): Check and enable AVX target
	description.
	(i386_linux_init_abi): Set xsave_xcr0_offset.
	(_initialize_i386_linux_tdep): Call
	initialize_tdesc_i386_avx_linux.

	* i386-linux-tdep.h (I386_LINUX_ORIG_EAX_REGNUM): Replace
	I386_SSE_NUM_REGS with I386_AVX_NUM_REGS.
	(i386_linux_core_read_xcr0): New.
	(tdesc_i386_avx_linux): Likewise.
	(I386_LINUX_XSAVE_XCR0_OFFSET): Likewise.

	* i386-tdep.c: Include "i386-xstate.h" and
	"features/i386/i386-avx.c".
	(i386_ymm_names): New.
	(i386_ymmh_names): Likewise.
	(i386_ymmh_regnum_p): Likewise.
	(i386_ymm_regnum_p): Likewise.
	(i386_xmm_regnum_p): Likewise.
	(i386_register_name): Likewise.
	(i386_ymm_type): Likewise.
	(i386_supply_xstateregset): Likewise.
	(i386_collect_xstateregset): Likewise.
	(i386_sse_regnum_p): Removed.
	(i386_pseudo_register_name): Support pseudo YMM registers.
	(i386_pseudo_register_type): Likewise.
	(i386_pseudo_register_read): Likewise.
	(i386_pseudo_register_write): Likewise.
	(i386_dbx_reg_to_regnum): Return %ymmN register number for
	%xmmN if AVX is available.
	(i386_regset_from_core_section): Support .reg-xstate section.
	(i386_register_reggroup_p): Supper upper YMM and YMM registers.
	(i386_process_record): Replace i386_sse_regnum_p with
	i386_xmm_regnum_p.
	(i386_validate_tdesc_p): Support org.gnu.gdb.i386.avx feature.
	Set ymmh_register_names, num_ymm_regs, ymm0h_regnum and xcr0.
	(i386_gdbarch_init): Set xstateregset.  Set xsave_xcr0_offset.
	Call set_gdbarch_register_name.  Replace I386_SSE_NUM_REGS with
	I386_AVX_NUM_REGS.  Set ymmh_register_names, ymm0h_regnum and
	num_ymm_regs.  Add num_ymm_regs to set_gdbarch_num_pseudo_regs.
	Set ymm0_regnum.
	(_initialize_i386_tdep): Call initialize_tdesc_i386_avx.

	* i386-tdep.h (gdbarch_tdep): Add xstateregset, ymm0_regnum,
	xcr0, xsave_xcr0_offset, ymm0h_regnum, ymmh_register_names and
	i386_ymm_type.
	(i386_regnum): Add I386_YMM0H_REGNUM, and I386_YMM7H_REGNUM.
	(I386_AVX_NUM_REGS): New.
	(i386_xmm_regnum_p): Likewise.
	(i386_ymm_regnum_p): Likewise.
	(i386_ymmh_regnum_p): Likewise.

	* common/i386-xstate.h: New.
2010-04-07 18:43:45 +00:00
H.J. Lu 90884b2b1f Enable XML target descriptions for x86.
gdb/

2010-03-01  H.J. Lu  <hongjiu.lu@intel.com>

	* amd64-linux-nat.c (AMD64_LINUX_USER64_CS): New.
	(amd64_linux_read_description): Likewise.
	(_initialize_amd64_linux_nat): Set to_read_description to
	amd64_linux_read_description.

	* amd64-linux-tdep.c: Include "features/i386/amd64-linux.c".
	(amd64_linux_register_name): Removed.
	(amd64_linux_register_type): Likewise.
	(amd64_linux_core_read_description): New.
	(amd64_linux_init_abi): Set target description to
	tdesc_amd64_linux if needed.  Support orig_rax in target
	description.  Don't call set_gdbarch_register_name nor
	set_gdbarch_register_type.  Call
	set_gdbarch_core_read_description.
	(_initialize_amd64_linux_tdep): Call
	initialize_tdesc_amd64_linux.

	* amd64-linux-tdep.h (tdesc_amd64_linux): New.

	* amd64-tdep.c:  Include "features/i386/amd64.c".
	(amd64_register_names): Removed.
	(amd64_register_name): Likewise.
	(amd64_register_type): Likewise.
	(amd64_init_abi):  Set num_core_regs and register_names.  Set
	target description to tdesc_amd64 if needed.  Don't call
	set_gdbarch_register_name nor set_gdbarch_register_type.
	(_initialize_amd64_tdep): New.

	* i386-linux-nat.c (i386_linux_read_description): New.
	(_initialize_i386_linux_nat): Set to_read_description to
	i386_linux_read_description.

	* i386-linux-tdep.c: Include "features/i386/i386-linux.c".
	(i386_linux_register_name): Removed.
	(i386_linux_core_read_description): New.
	(i386_linux_read_description): Likewise.
	(i386_linux_init_abi): Don't call set_gdbarch_register_name.
	Set target description to tdesc_i386_linux if needed.  Support
	orig_eax.  Set register_reggroup_p.  Call
	set_gdbarch_core_read_description.
	(_initialize_i386_linux_tdep): Call initialize_tdesc_i386_linux.

	* i386-linux-tdep.h (tdesc_i386_linux): New.

	* i386-nto-tdep.c (i386nto_regset_id): Replace I386_NUM_FREGS
	with I387_NUM_REGS.

	* i386-tdep.c: Include "features/i386/i386.c".
	(i386_register_names): Make it const.
	(i386_mmx_names): Likewise.
	(i386_num_register_names): Removed.
	(i386_register_name): Likewise.
	(i386_eflags_type): Likewise.
	(i386_mxcsr_type): Likewise.
	(i386_sse_type): Likewise.
	(i386_register_type): Likewise.
	(i387_ext_type): Call tdesc_find_type instead of arch_float_type.
	(i386_pseudo_register_name): New.
	(i386_pseudo_register_type): Likewise.
	(i386_mmx_type): Make it static.
	(i386_gdbarch_init): Check arch.  Replace I386_NUM_FREGS with
	I387_NUM_REGS.  Set num_core_regs and register_names.  Don't
	call set_gdbarch_register_name nor set_gdbarch_register_type.
	Set register_reggroup_p.  Set target description to tdesc_i386
	if needed.  Call set_tdesc_pseudo_register_type,
	set_tdesc_pseudo_register_name and tdesc_use_registers.
	(_initialize_i386_tdep): Call initialize_tdesc_i386.
	initialize_tdesc_x86_64.

	* i386-tdep.h (gdbarch_tdep): Remove i386_eflags_type,
	i386_mxcsr_type and i386_sse_type.  Add num_core_regs,
	register_names, tdesc and register_reggroup_p.
	(I386_NUM_FREGS): Removed.
	(i386_eflags_type): Likewise.
	(i386_mxcsr_type): Likewise.
	(i386_mmx_type): Likewise.
	(i386_sse_type): Likewise.
	(i386_register_name): Likewise.
	(i386_regnum): Add I386_MXCSR_REGNUM.
	(I386_SSE_NUM_REGS): Defined with I386_MXCSR_REGNUM.

	* i387-tdep.h (I387_NUM_REGS): New.

	* regformats/i386/i386-linux.dat: Generated.
	* regformats/i386/i386.dat: Likewise.
	* regformats/i386/amd64-linux.dat: Likewise.
	* regformats/i386/amd64.dat: Likewise.

	* regformats/reg-i386-linux.dat: Removed.
	* regformats/reg-i386.dat: Likewise.
	* regformats/reg-x86-64-linux.dat: Likewise.
	* regformats/reg-x86-64.dat: Likewise.

gdb/gdbserver/

2010-03-01  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c,
	reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c,
	i386-linux.c and amd64-linux.c.
	(reg-i386.o): Removed.
	(reg-i386.c): Likewise.
	(reg-i386-linux.o): Likewise.
	(reg-i386-linux.c): Likewise.
	(reg-x86-64.o): Likewise.
	(reg-x86-64.c): Likewise.
	(reg-x86-64-linux.o): Likewise.
	(reg-x86-64-linux.c): Likewise.
	(i386.o): New.
	(i386.c): Likewise.
	(i386-linux.o): Likewise.
	(i386-linux.c): Likewise.
	(amd64.o): Likewise.
	(amd64.c): Likewise.
	(amd64-linux.o): Likewise.
	(amd64-linux.c): Likewise.

	* configure.srv (srv_i386_regobj): New.
	(srv_i386_linux_regobj): Likewise.
	(srv_amd64_regobj): Likewise.
	(srv_amd64_linux_regobj): Likewise.
	(srv_i386_32bit_xmlfiles): Likewise.
	(srv_i386_64bit_xmlfiles): Likewise.
	(srv_i386_xmlfiles): Likewise.
	(srv_amd64_xmlfiles): Likewise.
	(srv_i386_linux_xmlfiles): Likewise.
	(srv_amd64_linux_xmlfiles): Likewise.
	(i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj.  Set
	srv_xmlfiles to $srv_i386_xmlfiles.
	(i[34567]86-*-mingw32ce*): Likewise.
	(i[34567]86-*-mingw*): Likewise.
	(i[34567]86-*-nto*): Likewise.
	(i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj
	and $srv_amd64_linux_regobj.  Set srv_xmlfiles to
	$srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles.
	(x86_64-*-linux*): Likewise.

	* linux-x86-low.c (init_registers_x86_64_linux): Removed.
	(init_registers_amd64_linux): New.
	(x86_arch_setup): Replace init_registers_x86_64_linux with
	init_registers_amd64_linux.

gdb/testsuite/

2010-03-01  H.J. Lu  <hongjiu.lu@intel.com>

	* gdb.xml/tdesc-regs.exp (architecture): New.  Set it for x86.
	(load_description): Set architecture if defined.
2010-03-01 15:33:32 +00:00
Joel Brobecker 4c38e0a4fc Update copyright year in most headers.
Automatic update by copyright.sh.
2010-01-01 07:32:07 +00:00
Joel Brobecker 0fb0cc7590 Updated copyright notices for most files. 2009-01-03 05:58:08 +00:00
Daniel Jacobowitz 9b254dd1ce Updated copyright notices for most files. 2008-01-01 22:53:26 +00:00
Joel Brobecker a9762ec78a Switch the license of all .c files to GPLv3.
Switch the license of all .h files to GPLv3.
        Switch the license of all .cc files to GPLv3.
2007-08-23 18:08:50 +00:00
Daniel Jacobowitz 6aba47ca06 Copyright updates for 2007. 2007-01-09 17:59:20 +00:00
Eli Zaretskii 197e01b6dc * breakpoint.c:
* arm-tdep.c:
	* ia64-tdep.c:
	* i386-tdep.c:
	* hpread.c:
	* hppa-tdep.c:
	* hppa-hpux-tdep.c:
	* gnu-nat.c:
	* gdbtypes.c:
	* gdbarch.h:
	* gdbarch.c:
	* eval.c:
	* dwarf2read.c:
	* dbxread.c:
	* copying:
	* symfile.c:
	* stabsread.c:
	* sh64-tdep.c:
	* sh-tdep.c:
	* s390-tdep.c:
	* rs6000-tdep.c:
	* remote.c:
	* remote-mips.c:
	* mips-tdep.c:
	* mdebugread.c:
	* linux-nat.c:
	* infrun.c:
	* xcoffread.c:
	* win32-nat.c:
	* valops.c:
	* utils.c:
	* tracepoint.c:
	* target.c:
	* symtab.c:
	* c-exp.y:
	* ada-valprint.c:
	* ada-typeprint.c:
	* ada-lex.l:
	* ada-lang.h:
	* ada-lang.c:
	* ada-exp.y:
	* alphafbsd-tdep.c:
	* alphabsd-tdep.h:
	* alphabsd-tdep.c:
	* alphabsd-nat.c:
	* alpha-tdep.h:
	* alpha-tdep.c:
	* alpha-osf1-tdep.c:
	* alpha-nat.c:
	* alpha-mdebug-tdep.c:
	* alpha-linux-tdep.c:
	* alpha-linux-nat.c:
	* aix-thread.c:
	* abug-rom.c:
	* arch-utils.c:
	* annotate.h:
	* annotate.c:
	* amd64obsd-tdep.c:
	* amd64obsd-nat.c:
	* amd64nbsd-tdep.c:
	* amd64nbsd-nat.c:
	* amd64fbsd-tdep.c:
	* amd64fbsd-nat.c:
	* amd64bsd-nat.c:
	* amd64-tdep.h:
	* amd64-tdep.c:
	* amd64-sol2-tdep.c:
	* amd64-nat.h:
	* amd64-nat.c:
	* amd64-linux-tdep.c:
	* amd64-linux-nat.c:
	* alphanbsd-tdep.c:
	* block.h:
	* block.c:
	* bfd-target.h:
	* bfd-target.c:
	* bcache.h:
	* bcache.c:
	* ax.h:
	* ax-general.c:
	* ax-gdb.h:
	* ax-gdb.c:
	* avr-tdep.c:
	* auxv.h:
	* auxv.c:
	* armnbsd-tdep.c:
	* armnbsd-nat.c:
	* arm-tdep.h:
	* arm-linux-nat.c:
	* arch-utils.h:
	* charset.c:
	* call-cmds.h:
	* c-valprint.c:
	* c-typeprint.c:
	* c-lang.h:
	* c-lang.c:
	* buildsym.h:
	* buildsym.c:
	* bsd-uthread.h:
	* bsd-uthread.c:
	* bsd-kvm.h:
	* bsd-kvm.c:
	* breakpoint.h:
	* core-regset.c:
	* core-aout.c:
	* completer.h:
	* completer.c:
	* complaints.h:
	* complaints.c:
	* command.h:
	* coffread.c:
	* coff-solib.h:
	* coff-solib.c:
	* coff-pe-read.h:
	* coff-pe-read.c:
	* cli-out.h:
	* cli-out.c:
	* charset.h:
	* dink32-rom.c:
	* dictionary.h:
	* dictionary.c:
	* demangle.c:
	* defs.h:
	* dcache.h:
	* dcache.c:
	* d10v-tdep.c:
	* cpu32bug-rom.c:
	* cp-valprint.c:
	* cp-support.h:
	* cp-support.c:
	* cp-namespace.c:
	* cp-abi.h:
	* cp-abi.c:
	* corelow.c:
	* corefile.c:
	* environ.c:
	* elfread.c:
	* dwarfread.c:
	* dwarf2loc.c:
	* dwarf2expr.h:
	* dwarf2expr.c:
	* dwarf2-frame.h:
	* dwarf2-frame.c:
	* dve3900-rom.c:
	* dummy-frame.h:
	* dummy-frame.c:
	* dsrec.c:
	* doublest.h:
	* doublest.c:
	* disasm.h:
	* disasm.c:
	* fork-child.c:
	* findvar.c:
	* fbsd-nat.h:
	* fbsd-nat.c:
	* f-valprint.c:
	* f-typeprint.c:
	* f-lang.h:
	* f-lang.c:
	* expression.h:
	* expprint.c:
	* exec.h:
	* exec.c:
	* exceptions.h:
	* exceptions.c:
	* event-top.h:
	* event-top.c:
	* event-loop.h:
	* event-loop.c:
	* gdb.c:
	* gdb-stabs.h:
	* gdb-events.h:
	* gdb-events.c:
	* gcore.c:
	* frv-tdep.h:
	* frv-tdep.c:
	* frv-linux-tdep.c:
	* frame.h:
	* frame.c:
	* frame-unwind.h:
	* frame-unwind.c:
	* frame-base.h:
	* frame-base.c:
	* gdb_vfork.h:
	* gdb_thread_db.h:
	* gdb_string.h:
	* gdb_stat.h:
	* gdb_regex.h:
	* gdb_ptrace.h:
	* gdb_proc_service.h:
	* gdb_obstack.h:
	* gdb_locale.h:
	* gdb_dirent.h:
	* gdb_curses.h:
	* gdb_assert.h:
	* gdbarch.sh:
	* gdb.h:
	* hpux-thread.c:
	* hppabsd-nat.c:
	* hppa-tdep.h:
	* hpacc-abi.c:
	* h8300-tdep.c:
	* gregset.h:
	* go32-nat.c:
	* gnu-v3-abi.c:
	* gnu-v2-abi.h:
	* gnu-v2-abi.c:
	* gnu-nat.h:
	* glibc-tdep.c:
	* gdbtypes.h:
	* gdbcore.h:
	* gdbcmd.h:
	* i386nbsd-tdep.c:
	* i386nbsd-nat.c:
	* i386gnu-tdep.c:
	* i386gnu-nat.c:
	* i386fbsd-tdep.c:
	* i386fbsd-nat.c:
	* i386bsd-tdep.c:
	* i386bsd-nat.h:
	* i386bsd-nat.c:
	* i386-tdep.h:
	* i386-sol2-nat.c:
	* i386-nto-tdep.c:
	* i386-nat.c:
	* i386-linux-tdep.h:
	* i386-linux-tdep.c:
	* i386-linux-nat.c:
	* i386-cygwin-tdep.c:
	* inf-ttrace.c:
	* inf-ptrace.h:
	* inf-ptrace.c:
	* inf-loop.h:
	* inf-loop.c:
	* inf-child.h:
	* inf-child.c:
	* ia64-tdep.h:
	* ia64-linux-nat.c:
	* i387-tdep.h:
	* i387-tdep.c:
	* i386v4-nat.c:
	* i386v-nat.c:
	* i386obsd-tdep.c:
	* i386obsd-nat.c:
	* kod.c:
	* jv-valprint.c:
	* jv-typeprint.c:
	* jv-lang.h:
	* jv-lang.c:
	* irix5-nat.c:
	* iq2000-tdep.c:
	* interps.h:
	* interps.c:
	* inftarg.c:
	* inflow.h:
	* inflow.c:
	* inferior.h:
	* infcmd.c:
	* infcall.h:
	* infcall.c:
	* inf-ttrace.h:
	* m32r-tdep.h:
	* m32r-tdep.c:
	* m32r-rom.c:
	* m32r-linux-tdep.c:
	* m32r-linux-nat.c:
	* m2-valprint.c:
	* m2-typeprint.c:
	* m2-lang.h:
	* m2-lang.c:
	* lynx-nat.c:
	* linux-thread-db.c:
	* linux-nat.h:
	* linespec.c:
	* libunwind-frame.h:
	* libunwind-frame.c:
	* language.h:
	* language.c:
	* macroexp.c:
	* macrocmd.c:
	* m88kbsd-nat.c:
	* m88k-tdep.h:
	* m88k-tdep.c:
	* m68klinux-tdep.c:
	* m68klinux-nat.c:
	* m68kbsd-tdep.c:
	* m68kbsd-nat.c:
	* m68k-tdep.h:
	* m68k-tdep.c:
	* mips-linux-nat.c:
	* mips-irix-tdep.c:
	* minsyms.c:
	* memattr.h:
	* memattr.c:
	* mem-break.c:
	* mdebugread.h:
	* main.h:
	* main.c:
	* macrotab.h:
	* macrotab.c:
	* macroscope.h:
	* macroscope.c:
	* macroexp.h:
	* nbsd-tdep.c:
	* mt-tdep.c:
	* monitor.h:
	* monitor.c:
	* mn10300-tdep.h:
	* mn10300-tdep.c:
	* mn10300-linux-tdep.c:
	* mipsv4-nat.c:
	* mipsread.c:
	* mipsnbsd-tdep.h:
	* mipsnbsd-tdep.c:
	* mipsnbsd-nat.c:
	* mips64obsd-tdep.c:
	* mips64obsd-nat.c:
	* mips-tdep.h:
	* mips-mdebug-tdep.c:
	* mips-linux-tdep.c:
	* osabi.h:
	* osabi.c:
	* ocd.h:
	* ocd.c:
	* observer.c:
	* objfiles.h:
	* objfiles.c:
	* objc-lang.h:
	* objc-lang.c:
	* objc-exp.y:
	* nto-tdep.h:
	* nto-tdep.c:
	* nto-procfs.c:
	* nlmread.c:
	* nbsd-tdep.h:
	* ppcobsd-tdep.c:
	* ppcobsd-nat.c:
	* ppcnbsd-tdep.h:
	* ppcnbsd-tdep.c:
	* ppcnbsd-nat.c:
	* ppcbug-rom.c:
	* ppc-tdep.h:
	* ppc-sysv-tdep.c:
	* ppc-linux-tdep.c:
	* ppc-linux-nat.c:
	* ppc-bdm.c:
	* parser-defs.h:
	* parse.c:
	* p-valprint.c:
	* p-typeprint.c:
	* p-lang.h:
	* p-lang.c:
	* remote-fileio.h:
	* remote-fileio.c:
	* remote-est.c:
	* remote-e7000.c:
	* regset.h:
	* regset.c:
	* reggroups.h:
	* reggroups.c:
	* regcache.h:
	* regcache.c:
	* proc-why.c:
	* proc-service.c:
	* proc-events.c:
	* printcmd.c:
	* ppcobsd-tdep.h:
	* sentinel-frame.h:
	* sentinel-frame.c:
	* scm-valprint.c:
	* scm-tags.h:
	* scm-lang.h:
	* scm-lang.c:
	* scm-exp.c:
	* s390-tdep.h:
	* rom68k-rom.c:
	* remote.h:
	* remote-utils.c:
	* remote-st.c:
	* remote-sim.c:
	* remote-sds.c:
	* remote-rdp.c:
	* remote-rdi.c:
	* remote-hms.c:
	* sim-regno.h:
	* shnbsd-tdep.h:
	* shnbsd-tdep.c:
	* shnbsd-nat.c:
	* sh-tdep.h:
	* serial.h:
	* serial.c:
	* ser-unix.h:
	* ser-unix.c:
	* ser-tcp.c:
	* ser-pipe.c:
	* ser-go32.c:
	* ser-e7kpc.c:
	* ser-base.h:
	* ser-base.c:
	* solib.c:
	* solib-svr4.h:
	* solib-svr4.c:
	* solib-sunos.c:
	* solib-som.h:
	* solib-som.c:
	* solib-pa64.h:
	* solib-pa64.c:
	* solib-osf.c:
	* solib-null.c:
	* solib-legacy.c:
	* solib-irix.c:
	* solib-frv.c:
	* solib-aix5.c:
	* sol-thread.c:
	* sparc64-linux-tdep.c:
	* sparc64-linux-nat.c:
	* sparc-tdep.h:
	* sparc-tdep.c:
	* sparc-sol2-tdep.c:
	* sparc-sol2-nat.c:
	* sparc-nat.h:
	* sparc-nat.c:
	* sparc-linux-tdep.c:
	* sparc-linux-nat.c:
	* source.h:
	* source.c:
	* somread.c:
	* solist.h:
	* solib.h:
	* std-regs.c:
	* stack.h:
	* stack.c:
	* stabsread.h:
	* sparcobsd-tdep.c:
	* sparcnbsd-tdep.c:
	* sparcnbsd-nat.c:
	* sparc64obsd-tdep.c:
	* sparc64nbsd-tdep.c:
	* sparc64nbsd-nat.c:
	* sparc64fbsd-tdep.c:
	* sparc64fbsd-nat.c:
	* sparc64-tdep.h:
	* sparc64-tdep.c:
	* sparc64-sol2-tdep.c:
	* sparc64-nat.c:
	* ui-file.c:
	* typeprint.h:
	* typeprint.c:
	* tramp-frame.h:
	* tramp-frame.c:
	* trad-frame.h:
	* trad-frame.c:
	* tracepoint.h:
	* top.c:
	* tobs.inc:
	* thread.c:
	* terminal.h:
	* target.h:
	* symfile.h:
	* stop-gdb.c:
	* vaxbsd-nat.c:
	* vax-tdep.h:
	* vax-tdep.c:
	* vax-nat.c:
	* varobj.h:
	* varobj.c:
	* value.h:
	* value.c:
	* valprint.h:
	* valprint.c:
	* v850-tdep.c:
	* uw-thread.c:
	* user-regs.c:
	* ui-out.h:
	* ui-out.c:
	* ui-file.h:
	* xcoffsolib.h:
	* xcoffsolib.c:
	* wrapper.c:
	* wince.c:
	* wince-stub.h:
	* wince-stub.c:
	* vaxobsd-tdep.c:
	* vaxnbsd-tdep.c:
	* gdb_gcore.sh:
	* copying.c:
	* configure.ac:
	* aclocal.m4:
	* acinclude.m4:
	* reply_mig_hack.awk:
	* observer.sh:
	* gdb_mbuild.sh:
	* arm-linux-tdep.c:
	* blockframe.c:
	* dbug-rom.c:
	* environ.h:
	* dwarf2loc.h:
	* gdb-events.sh:
	* glibc-tdep.h:
	* gdb_wait.h:
	* gdbthread.h:
	* i386-sol2-tdep.c:
	* hppabsd-tdep.c:
	* hppa-linux-nat.c:
	* hppa-hpux-nat.c:
	* ia64-linux-tdep.c:
	* infptrace.c:
	* linespec.h:
	* maint.c:
	* mips-mdebug-tdep.h:
	* remote-m32r-sdi.c:
	* s390-nat.c:
	* rs6000-nat.c:
	* remote-utils.h:
	* sh3-rom.c:
	* sh-linux-tdep.c:
	* top.h:
	* symtab.h:
	* symmisc.c:
	* symfile-mem.c:
	* srec.h:
	* user-regs.h:
	* version.h:
	* valarith.c:
	* xstormy16-tdep.c:
	* wrapper.h:
	* Makefile.in:
	* f-exp.y:
	* cris-tdep.c:
	* cp-name-parser.y:
	* procfs.c:
	* proc-utils.h:
	* proc-flags.c:
	* proc-api.c:
	* p-exp.y:
	* m68hc11-tdep.c:
	* m2-exp.y:
	* kod.h:
	* kod-cisco.c:
	* jv-exp.y:
	* hppa-linux-tdep.c: Add (c) after Copyright.  Update the FSF
	address.
2005-12-17 22:34:03 +00:00
Mark Kettenis 60fac5b81a * i386-linux-tdep.h (I386_LINUX_NUM_REGS): New define.
* x86-64-linux-nat.c: Include "i386-linux-tdep.h" and "amd64.h".
Change "register array" to "register cache" in comments.
(x86_64_linux_gregset64_reg_offset): New variable.
(GETREGS_SUPPLIES): Remove macro.
(supply_gregset): Call amd64_supply_native_gregset instead of
x86_64_linux_supply_gregset.
(fill_gregset): Rename `regno' to `regnum'.  Call
amd64_collect_native_gregset instead of x86_64_linux_fill_gregset.
(store_regs): Rename `regno' to `regnum'.
(store_fpregs): Rename `regno' to `regnum'.
(fetch_inferior_registers): Rename `regno' to `regnum'.  Use
amd64_native_gregset_supplies_p instead of GREGSET_SUPPLIES.
Reorganize function a bit.
(store_inferior_registers): Rename `regno' to `regnum'.  Use
amd64_native_gregset_supplies_p instead of GREGSET_SUPPLIES.
Reorganize function a bit.
(_initialize_x86_64_linux_nat): New function.
* config/i386/x86-64linux.mh.
2003-08-29 16:28:39 +00:00
Andrew Cagney 0542c38179 Fix GNU/Linux tipo. 2002-09-18 22:00:22 +00:00
Mark Kettenis 8201327c40 * config/i386/i386sol2.mt (TDEPFILES): Add i386-sol2-tdep.o and
i386bsd-tdep.o.  Remove solib.o, solib-svr4.o and solib-legacy.o.
Move these to ...
* config/i386/i386sol2.mh: ... here.
* config/i386/tm-i386sol2.h (STAB_REG_TO_REGNUM): Remove define.
(sigtramp_saved_pc, I386V4_SIGTRAMP_SAVED_PC): Don't #undef.
(SIGCONTEXT_PC_OFFSET): Remove define.
(IN_SIGTRAMP): Remove define.
* i386-sol2-tdep.c: New file.

* config/i386/i386nw.mt (TM_FILE): Change to tm-i386.h.
* config/i386/tm-i386nw.h: Removed.

* config/i386/tm-fbsd.h (STAB_REG_TO_REGNUM,
USE_STRUCT_CONVENTION): Remove defines.
(JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines.
(get_longjmp_target): Remove prototype.
(IN_SIGTRAMP): Remove define.
(i386bsd_in_sigtramp): Remove prototype.
(i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a
function.  Update comment accordingly
(SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly.
(FRAME_SAVED_PC): Remove define.
(i386bsd_frame_saved_pc): Remove prototype.
* config/i386/tm-nbsd.h (JB_ELEMENT_SIZE, JB_PC,
GET_LONGJMP_TARGET): Remove defines.
(get_longjmp_target): Remove prototype.
(IN_SIGTRAMP): Remove define.
(i386bsd_in_sigtramp): Remove prototype.
(i386bsd_sigtramp_start, i386bsd_sigtramp_end): Turn into a
function.  Update comment accordingly
(SIGTRAMP_START, SIGTRAMP): Adjust definition accordingly.
(FRAME_SAVED_PC): Remove define.
(i386bsd_frame_saved_pc): Remove prototype.
* config/i386/tm-nbsdaout.h (i386nbsd_aout_use_struct_convention):
Remove prototype.
(USE_STRUCT_CONVENTION): Remove prototype.
* i386bsd-nat.c (i386bsd_sigcontext_pc_offset): Remove
declaration.
(_initialize_i386bsd_nat): Revise logic to determine some
constants at compile time when compiling a native GDB.  Warn if
things don't match up with what we expect.
* i386bsd-tdep.c (i386bsd_sigtramp_start, i386bsd_sigtramp_end):
Remove variables.
(i386bsd_in_sigtramp): Rename tp i386bsd_pc_in_sigtramp.  Rewrite
to use date stored in `struct gdbarch_tdep'.
(i386bsd_sigcontext_offset): Remove varaible.
(i386bsd_sigtramp_saved_pc): Make public.  Rewrite to use data
stored in `struct gdbarch_tdep'.
(i386bsd_frame_saved_pc): Make static.
(i386bsd_sigtramp_start, i386bsd_sigtramp_end): New functions.
(i386bsd_sc_pc_offset, i386nbsd_sc_pc_offset,
i386fbsd_sigtramp_start, i386fbsd_sigtramp_end,
i386fbsd4_sc_pc_offset): New variables.
(i386bsd_init_abi, i386nbsd_init_abi, i386nbsdelf_init_abi,
i386fbsdaout_init_abi, i386fbsd_init_abi, i386fbsd4_init_abi): New
functions.
(i386bsd_aout_osabi_sniffer, _initialize_i386bsd_tdep): New
functions.
* i386fbsd-nat.c (_initialize_i386fbsd_nat): Fix type in comment.
Modify the value of i386fbsd_sigtramp_start and
i386fbsd_sigtramp_end instead of i386bsd_sigtramp_start and
i386fbsd_sigtramp_end.
* i386nbsd-tdep.c: (i386nbsd_aout_use_struct_convention): Remove
function.

* config/i386/tm-linux.h (I386_LINUX_ORIG_EAX_REGNUM): Move
define to i386-linux-tdep.h.
(NUM_REGS, MAX_NUM_REGS, REGISTER_BYTES, REGISTER_NAME,
REGISTER_BYTE, REGISTER_RAW_SIZE, STAB_REG_TO_REGNUM): Remove
defines.
(i386_linux_register_name, i386_linux_register_byte,
i386_linux_register_raw_size): Remove prototypes.
(i386_linux_svr4_fetch_link_map_offsets): Remove prototype.
(SVR4_FETCH_LINK_MAP_OFFSETS): Remove define.
(IN_SIGTRAMP, FRAME_CHAIN, FRAME_SAVED_PC, SAVED_PC_AFTER_CALL,
TARGET_WRITE_PC): Remove defines.
(i386_linux_in_sigtramp, i386_linux_frame_chain,
i386_linux_frame_saved_pc, i386_linux_saved_pc_after_call,
i386_linux_write_pc): Remove prototypes.
(JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines.
(get_longjmp_target): Remove prototype.
* i386-linux-tdep.h: New file.
* i386-linux-nat.c: Include "i386-linux-tdep.h".
* i386-linux-tdep.c: Include "i386-tdep.h" and
"i386-linux-tdep.h".
(i386_linux_register_name, i386_linux_register_byte,
i386_linux_register_raw_size, i386_linux_in_sigtramp,
i386_linux_write_pc, i386_linux_svr4_fetch_link_map_offsets):
Make static.
(i386_linux_init_abi): New function.
(_initialize_i386_linux_tdep): New function.

* config/i386/tm-i386.h (SAVED_PC_AFTER_CALL): Remove define.
(i386_saved_pc_after_call): Remove prototype.
(MAX_NUM_REGS): Increase to deal with Linux's orig_eax "register".
(REGISTER_NAME, STAB_REG_TO_REGNUM, SDB_REG_TO_REGNUM,
DWARF_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM): Remove defines.
(i386_register_name, i386_stab_reg_to_regnum,
i386_dwarf_reg_to_regnum): Remove prototypes.
(SIZEOF_GREGS, SIZEOF_FPU_REGS, SIZEOF_FPU_CTL_REGS,
SIZEOF_SSE_REGS): Remove defines.
(REGISTER_BYTES): Remove define.
(REGISTER_BYTE, REGISTER_RAW_SIZE): Remove defines.
(i386_register_byte, i386_register_raw_size): Remove prototypes.
(FRAME_CHAIN, FRAME_SAVED_PC): Remove defines.
(i386_frame_chain, i386_frame_saved_pc): Remove prototypes.
* config/i386/tm-i386v4.h (FRAME_CHAIN_VALID): Remove define.
(JB_ELEMENT_SIZE, JB_PC, JB_EBX, JB_ESI, JB_EDI, JB_EBP, JB_ESP,
JB_EDX, GET_LONGJMP_TARGET): Remove defines.
(get_longjmp_target): Remove prototype.
(I386V4_SIGTRAMP_SAVED_PC, IN_SIGTRAMP): Remove defines.
(sigtramp_saved_pc): Remove define.
(i386v4_sigtramp_saved_pc): Remove prototype.
* config/i386/tm-go32.h (FRAME_CHAIN,
FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC): Remove defines.
(i386go32_frame_saved_pc): Remove prototype.
(JB_ELEMENT_SIZE, JB_PC, GET_LONGJMP_TARGET): Remove defines.
(get_longjmp_target): Remove prototype.
* i386-tdep.h: Include "osabi.h".
(enum i386_abi): Removed.
(enum struct_return): New enum.
(struct gdbarch_tdep): Remove abi member, add osabi, jb_pc_offset,
struct_return, sigtramp_saved_pc, sigtramp_start, sigtramp_end and
sc_pc_offset members.
(i386_gdbarch_register_os_abi): Remove prototype.
(I386_NUM_GREGS, I386_NUM_FREGS, I386_NUM_XREGS,
I386_SSE_NUM_REGS): New defines.
(I386_SIZEOF_GREGS, I386_SIZEOF_FREGS, I386_SIZEOF_XREGS,
I386_SSE_SIZEOF_REGS): New defines.
(i386_register_name, i386_register_byte, i386_register_raw_size):
New prototypes.
(i386_elf_init_abi, i386_svr4_init_abi): New prototypes.
(i386bsd_sigtramp_saved_pc): New prototype.
* i386-tdep.c: Don't include "elf-bfd.h".
(i386_stab_reg_to_regnum, i386_dwarf_reg_to_regnum,
i386_frame_chain, i386_saved_pc_after_call): Make static.
(i386_frame_saved_pc): Rewrite to call architecture dependent
function to deal with signal handlers.  Make static.
(i386go32_frame_saved_pc): Removed.
[GET_LONGJMP_TARGET] (JB_PC, JB_ELEMENT_SIZE, get_longjmp_target):
Removed.
(i386_get_longjmp_target): New function.
(default_struct_convention, pcc_struct_convention,
reg_struct_convention, valid_conventions, struct_convention): New
variables.
(i386_use_struct_convention): New function.
(i386v4_sigtramp_saved_pc): Renamed to
i386_svr4_sigtramp_saved_pc.  Made static.  Moved.
(i386_pc_in_sigtramp): New function.
(i386_abi_names): Removed.
(ABI_TAG_OS_GNU_LINUX, ABI_TAG_OS_GNU_HURD,
ABI_TAG_OS_GNU_SOLARIS, ABI_TAG_OS_FREEBSD, ABI_TAG_OS_NETBSD):
Removed.
(process_note_sections, i386_elf_abi_from_note, i386_elf_abi,
i386_gdbarch_register_os_abi): Removed.
(struct i386_abi_handler): Removed.
(i386_abi_handler_list): Removed.
(i386_svr4_pc_in_sigtramp, i386_go32_pc_in_sigtramp): New
functions.
(i386_elf_init_abi, i386_svr4_init_abi, i386_go32_init_abi,
i386_nw_init_abi): New functions.
(i386_gdbarch_init): Rewritten to use generic OS ABI framework.
Use set_gdbarch_xxx() calls instead of relying on macros for a
number of calls.
(i386_coff_osabi_sniffer, i386_nlm_osabi_sniffer): New functions.
(_initialize_i386_tdep): Add new 'struct-convcention' command.
Register the various architecture variants defined in this file.
2002-06-14 19:42:20 +00:00