From: Alan Hayward Date: Thu, 4 Jul 2019 10:48:16 +0000 (+0100) Subject: i386/AArch64: Remove old xml tests X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2b40fda74b2af11a914d50f4e54c1472e1bd81fb;p=binutils-gdb.git i386/AArch64: Remove old xml tests Both the i386, X86_64 and AArch64 builds of gdbserver include a bunch of legacy xml files, dat files and auto generated C files, when building for unit test. These tests exists back from when feature target descriptions were added to prove that the new target descriptions were identical to the original older versions. The old files are not used for anything other than these tests. Now that this has been proven, we are not gaining anything by keeping the original files and tests. Should new functionality be added, it would break the tests, unless the functionality was backported to the xml. There is no requirement that we must match the exact xml from N releases ago. It adds obfuscation, where as the feature target descriptions were meant to simplify the code. In addition, there are a bunch of xml and dat files which are completely unused. This patch removes the selftests and the target descriptions from gdbserver. Update the unittest to allow 0 tests (note, this failed on other targets that never had any tests). gdb/ChangeLog: * aarch64-tdep.c: Remove xml self tests. * amd64-linux-tdep.c: Likewise. * amd64-tdep.c: Likewise. * i386-linux-tdep.c: Likewise. * i386-tdep.c: Likewise. gdb/gdbserver/ChangeLog: * configure.srv: Remove legacy xml. * linux-aarch64-low.c (initialize_low_arch): Remove initialize_low_tdesc call. * linux-aarch64-tdesc-selftest.c: Remove file. * linux-aarch64-tdesc.h (initialize_low_tdesc): Remove. * linux-x86-low.c (initialize_low_arch): Remove initialize_low_tdesc call. * linux-x86-tdesc-selftest.c: Remove file. * linux-x86-tdesc.h (initialize_low_tdesc): Remove. gdb/testsuite/ChangeLog: * gdb.server/unittest.exp: Allow 0 unit tests to run. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a462b27ba5b..bb9f811fbf2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2019-07-04 Alan Hayward + + * aarch64-tdep.c: Remove xml self tests. + * amd64-linux-tdep.c: Likewise. + * amd64-tdep.c: Likewise. + * i386-linux-tdep.c: Likewise. + * i386-tdep.c: Likewise. + 2019-07-03 Pedro Alves PR cli/24732 diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 96ebce4c352..b945697fad3 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -3430,8 +3430,6 @@ When on, AArch64 specific debugging is enabled."), selftests::aarch64_analyze_prologue_test); selftests::register_test ("aarch64-process-record", selftests::aarch64_process_record_test); - selftests::record_xml_tdesc ("aarch64.xml", - aarch64_create_target_description (0, false)); #endif } diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index 5475cf629f3..008817c38d3 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -2279,32 +2279,4 @@ _initialize_amd64_linux_tdep (void) GDB_OSABI_LINUX, amd64_linux_init_abi); gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x64_32, GDB_OSABI_LINUX, amd64_x32_linux_init_abi); - -#if GDB_SELF_TEST - struct - { - const char *xml; - uint64_t mask; - } xml_masks[] = { - { "i386/amd64-linux.xml", X86_XSTATE_SSE_MASK }, - { "i386/amd64-avx-linux.xml", X86_XSTATE_AVX_MASK }, - { "i386/amd64-mpx-linux.xml", X86_XSTATE_MPX_MASK }, - { "i386/amd64-avx-mpx-linux.xml", X86_XSTATE_AVX_MPX_MASK }, - { "i386/amd64-avx-avx512-linux.xml", X86_XSTATE_AVX_AVX512_MASK }, - { "i386/amd64-avx-mpx-avx512-pku-linux.xml", - X86_XSTATE_AVX_MPX_AVX512_PKU_MASK }, - { "i386/x32-linux.xml", X86_XSTATE_SSE_MASK }, - { "i386/x32-avx-linux.xml", X86_XSTATE_AVX_MASK }, - { "i386/x32-avx-avx512-linux.xml", X86_XSTATE_AVX_AVX512_MASK }, - }; - - for (auto &a : xml_masks) - { - auto tdesc = amd64_linux_read_description (a.mask, - startswith (a.xml, - "i386/x32")); - - selftests::record_xml_tdesc (a.xml, tdesc); - } -#endif /* GDB_SELF_TEST */ } diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index 31791f9a9f1..f02b007afda 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -3318,29 +3318,6 @@ _initialize_amd64_tdep (void) amd64_none_init_abi); gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x64_32, GDB_OSABI_NONE, amd64_x32_none_init_abi); - -#if GDB_SELF_TEST - struct - { - const char *xml; - uint64_t mask; - } xml_masks[] = { - { "i386/amd64.xml", X86_XSTATE_SSE_MASK }, - { "i386/amd64-avx.xml", X86_XSTATE_AVX_MASK }, - { "i386/amd64-mpx.xml", X86_XSTATE_MPX_MASK }, - { "i386/amd64-avx-mpx.xml", X86_XSTATE_AVX_MPX_MASK }, - { "i386/amd64-avx-avx512.xml", X86_XSTATE_AVX_AVX512_MASK }, - { "i386/amd64-avx-mpx-avx512-pku.xml", - X86_XSTATE_AVX_MPX_AVX512_PKU_MASK }, - }; - - for (auto &a : xml_masks) - { - auto tdesc = amd64_target_description (a.mask, true); - - selftests::record_xml_tdesc (a.xml, tdesc); - } -#endif /* GDB_SELF_TEST */ } diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index d7094ca3a1a..f3518368996 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,15 @@ +2019-07-04 Alan Hayward + + * configure.srv: Remove legacy xml. + * linux-aarch64-low.c (initialize_low_arch): Remove + initialize_low_tdesc call. + * linux-aarch64-tdesc-selftest.c: Remove file. + * linux-aarch64-tdesc.h (initialize_low_tdesc): Remove. + * linux-x86-low.c (initialize_low_arch): Remove + initialize_low_tdesc call. + * linux-x86-tdesc-selftest.c: Remove file. + * linux-x86-tdesc.h (initialize_low_tdesc): Remove. + 2019-06-20 Tom de Vries * linux-s390-ipa.c (get_ipa_tdesc)[!__s390x__]: Use diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv index bec72e2b193..c20177ef183 100644 --- a/gdb/gdbserver/configure.srv +++ b/gdb/gdbserver/configure.srv @@ -24,14 +24,6 @@ # Default hostio_last_error implementation srv_hostio_err_objs="hostio-errno.o" -if $enable_unittests; then - srv_i386_linux_regobj="i386-linux.o i386-avx-linux.o i386-avx-avx512-linux.o i386-avx-mpx-avx512-pku-linux.o i386-mpx-linux.o i386-avx-mpx-linux.o i386-mmx-linux.o linux-x86-tdesc-selftest.o" - srv_amd64_linux_regobj="amd64-linux.o amd64-avx-linux.o amd64-avx-avx512-linux.o amd64-avx-mpx-avx512-pku-linux.o amd64-mpx-linux.o amd64-avx-mpx-linux.o x32-linux.o x32-avx-linux.o x32-avx-avx512-linux.o" -else - srv_i386_linux_regobj="" - srv_amd64_linux_regobj="" -fi - ipa_ppc_linux_regobj="powerpc-32l-ipa.o powerpc-altivec32l-ipa.o powerpc-cell32l-ipa.o powerpc-vsx32l-ipa.o powerpc-isa205-32l-ipa.o powerpc-isa205-altivec32l-ipa.o powerpc-isa205-vsx32l-ipa.o powerpc-isa205-ppr-dscr-vsx32l-ipa.o powerpc-isa207-vsx32l-ipa.o powerpc-isa207-htm-vsx32l-ipa.o powerpc-e500l-ipa.o powerpc-64l-ipa.o powerpc-altivec64l-ipa.o powerpc-cell64l-ipa.o powerpc-vsx64l-ipa.o powerpc-isa205-64l-ipa.o powerpc-isa205-altivec64l-ipa.o powerpc-isa205-vsx64l-ipa.o powerpc-isa205-ppr-dscr-vsx64l-ipa.o powerpc-isa207-vsx64l-ipa.o powerpc-isa207-htm-vsx64l-ipa.o" # Linux object files. This is so we don't have to repeat @@ -41,12 +33,7 @@ srv_linux_obj="linux-low.o linux-osdata.o linux-procfs.o linux-ptrace.o linux-wa # Input is taken from the "${target}" variable. case "${target}" in - aarch64*-*-linux*) - srv_regobj="arm-with-neon.o" - if $enable_unittests; then - srv_regobj="${srv_regobj} aarch64.o" - srv_regobj="${srv_regobj} linux-aarch64-tdesc-selftest.o" - fi + aarch64*-*-linux*) srv_regobj="arm-with-neon.o" srv_tgtobj="linux-aarch64-low.o aarch64-linux-hw-point.o" srv_tgtobj="$srv_tgtobj linux-aarch32-low.o" srv_tgtobj="${srv_tgtobj} arch/arm.o" @@ -110,12 +97,7 @@ case "${target}" in srv_tgtobj="x86-low.o x86-dregs.o win32-low.o win32-i386-low.o" srv_tgtobj="${srv_tgtobj} arch/i386.o" ;; - i[34567]86-*-linux*) srv_regobj="$srv_i386_linux_regobj" - if test "$gdb_cv_i386_is_x86_64" = yes ; then - srv_regobj="$srv_regobj $srv_amd64_linux_regobj" - srv_tgtobj="amd64-linux-siginfo.o" - fi - srv_tgtobj="${srv_tgtobj} arch/i386.o" + i[34567]86-*-linux*) srv_tgtobj="${srv_tgtobj} arch/i386.o" srv_tgtobj="${srv_tgtobj} $srv_linux_obj linux-x86-low.o x86-low.o x86-dregs.o i387-fp.o" srv_tgtobj="${srv_tgtobj} linux-x86-tdesc.o" srv_tgtobj="${srv_tgtobj} linux-btrace.o x86-linux.o" @@ -382,8 +364,8 @@ case "${target}" in srv_linux_usrregs=yes srv_linux_thread_db=yes ;; - x86_64-*-linux*) srv_regobj="$srv_amd64_linux_regobj $srv_i386_linux_regobj" - srv_tgtobj="$srv_linux_obj linux-x86-low.o x86-low.o x86-dregs.o i387-fp.o" + x86_64-*-linux*) srv_tgtobj="$srv_linux_obj linux-x86-low.o x86-low.o" + srv_tgtobj="${srv_tgtobj} x86-dregs.o i387-fp.o" srv_tgtobj="${srv_tgtobj} arch/i386.o arch/amd64.o" srv_tgtobj="${srv_tgtobj} linux-x86-tdesc.o" srv_tgtobj="${srv_tgtobj} linux-btrace.o x86-linux.o" diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index dc4ee81d2a2..5aea5de3726 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -3097,8 +3097,4 @@ initialize_low_arch (void) initialize_regsets_info (&aarch64_regsets_info); initialize_regsets_info (&aarch64_sve_regsets_info); - -#if GDB_SELF_TEST - initialize_low_tdesc (); -#endif } diff --git a/gdb/gdbserver/linux-aarch64-tdesc-selftest.c b/gdb/gdbserver/linux-aarch64-tdesc-selftest.c deleted file mode 100644 index bf24a27c598..00000000000 --- a/gdb/gdbserver/linux-aarch64-tdesc-selftest.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (C) 2017-2019 Free Software Foundation, Inc. - - This file is part of GDB. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#include "server.h" -#include "tdesc.h" -#include "common/selftest.h" -#include "linux-aarch64-tdesc.h" - -/* Defined in auto-generated file features/aarch64.c. */ -void init_registers_aarch64 (void); -extern const struct target_desc *tdesc_aarch64; - -namespace selftests { -namespace tdesc { -static void -aarch64_tdesc_test () -{ - const target_desc *tdesc = aarch64_linux_read_description (0, false); - SELF_CHECK (*tdesc == *tdesc_aarch64); -} -} -} // namespace selftests - -void -initialize_low_tdesc () -{ - init_registers_aarch64 (); - - selftests::register_test ("aarch64-tdesc", - selftests::tdesc::aarch64_tdesc_test); -} diff --git a/gdb/gdbserver/linux-aarch64-tdesc.h b/gdb/gdbserver/linux-aarch64-tdesc.h index 06b3ec9b1e6..0cd9adc7d70 100644 --- a/gdb/gdbserver/linux-aarch64-tdesc.h +++ b/gdb/gdbserver/linux-aarch64-tdesc.h @@ -22,8 +22,4 @@ const target_desc * aarch64_linux_read_description (uint64_t vq, bool pauth_p); -#if GDB_SELF_TEST -void initialize_low_tdesc (); -#endif - #endif /* GDBSERVER_LINUX_AARCH64_TDESC_H */ diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c index e84e7a1793c..db240e2bc46 100644 --- a/gdb/gdbserver/linux-x86-low.c +++ b/gdb/gdbserver/linux-x86-low.c @@ -2911,10 +2911,6 @@ initialize_low_arch (void) tdesc_amd64_linux_no_xml->xmltarget = xmltarget_amd64_linux_no_xml; #endif -#if GDB_SELF_TEST - initialize_low_tdesc (); -#endif - tdesc_i386_linux_no_xml = allocate_target_description (); copy_target_description (tdesc_i386_linux_no_xml, i386_linux_read_description (X86_XSTATE_SSE_MASK)); diff --git a/gdb/gdbserver/linux-x86-tdesc-selftest.c b/gdb/gdbserver/linux-x86-tdesc-selftest.c deleted file mode 100644 index 50474b3668c..00000000000 --- a/gdb/gdbserver/linux-x86-tdesc-selftest.c +++ /dev/null @@ -1,183 +0,0 @@ -/* Copyright (C) 2017-2019 Free Software Foundation, Inc. - - This file is part of GDB. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#include "server.h" -#include "linux-x86-tdesc.h" -#include "tdesc.h" -#include "common/selftest.h" -#include "common/x86-xstate.h" - -/* Defined in auto-generated file i386-linux.c. */ -void init_registers_i386_linux (void); -extern const struct target_desc *tdesc_i386_linux; - -/* Defined in auto-generated file i386-mmx-linux.c. */ -void init_registers_i386_mmx_linux (void); -extern const struct target_desc *tdesc_i386_mmx_linux; - -/* Defined in auto-generated file i386-avx-linux.c. */ -void init_registers_i386_avx_linux (void); -extern const struct target_desc *tdesc_i386_avx_linux; - -/* Defined in auto-generated file i386-avx-mpx-linux.c. */ -void init_registers_i386_avx_mpx_linux (void); -extern const struct target_desc *tdesc_i386_avx_mpx_linux; - -/* Defined in auto-generated file i386-avx-avx512-linux.c. */ -void init_registers_i386_avx_avx512_linux (void); -extern const struct target_desc *tdesc_i386_avx_avx512_linux; - -/* Defined in auto-generated file i386-avx-mpx-avx512-linux.c. */ -void init_registers_i386_avx_mpx_avx512_pku_linux (void); -extern const struct target_desc *tdesc_i386_avx_mpx_avx512_pku_linux; - -/* Defined in auto-generated file i386-mpx-linux.c. */ -void init_registers_i386_mpx_linux (void); -extern const struct target_desc *tdesc_i386_mpx_linux; - -#ifdef __x86_64__ - -/* Defined in auto-generated file amd64-linux.c. */ -void init_registers_amd64_linux (void); -extern const struct target_desc *tdesc_amd64_linux; - -/* Defined in auto-generated file amd64-avx-linux.c. */ -void init_registers_amd64_avx_linux (void); -extern const struct target_desc *tdesc_amd64_avx_linux; - -/* Defined in auto-generated file amd64-avx-avx512-linux.c. */ -void init_registers_amd64_avx_avx512_linux (void); -extern const struct target_desc *tdesc_amd64_avx_avx512_linux; - -/* Defined in auto-generated file amd64-avx-mpx-avx512-pku-linux.c. */ -void init_registers_amd64_avx_mpx_avx512_pku_linux (void); -extern const struct target_desc *tdesc_amd64_avx_mpx_avx512_pku_linux; - -/* Defined in auto-generated file amd64-avx-mpx-linux.c. */ -void init_registers_amd64_avx_mpx_linux (void); -extern const struct target_desc *tdesc_amd64_avx_mpx_linux; - -/* Defined in auto-generated file amd64-mpx-linux.c. */ -void init_registers_amd64_mpx_linux (void); -extern const struct target_desc *tdesc_amd64_mpx_linux; - -/* Defined in auto-generated file x32-linux.c. */ -void init_registers_x32_linux (void); -extern const struct target_desc *tdesc_x32_linux; - -/* Defined in auto-generated file x32-avx-linux.c. */ -void init_registers_x32_avx_linux (void); -extern const struct target_desc *tdesc_x32_avx_linux; - -/* Defined in auto-generated file x32-avx-avx512-linux.c. */ -void init_registers_x32_avx_avx512_linux (void); -extern const struct target_desc *tdesc_x32_avx_avx512_linux; - -#endif - -namespace selftests { -namespace tdesc { -static void -i386_tdesc_test () -{ - struct - { - unsigned int mask; - const target_desc *tdesc; - } tdesc_tests[] = { - { X86_XSTATE_X87, tdesc_i386_mmx_linux }, - { X86_XSTATE_SSE_MASK, tdesc_i386_linux }, - { X86_XSTATE_AVX_MASK, tdesc_i386_avx_linux }, - { X86_XSTATE_MPX_MASK, tdesc_i386_mpx_linux }, - { X86_XSTATE_AVX_MPX_MASK, tdesc_i386_avx_mpx_linux }, - { X86_XSTATE_AVX_AVX512_MASK, tdesc_i386_avx_avx512_linux }, - { X86_XSTATE_AVX_MPX_AVX512_PKU_MASK, tdesc_i386_avx_mpx_avx512_pku_linux } - }; - - for (auto &elem : tdesc_tests) - { - const target_desc *tdesc = i386_linux_read_description (elem.mask); - - SELF_CHECK (*tdesc == *elem.tdesc); - } -} - -#ifdef __x86_64__ - -static void -amd64_tdesc_test () -{ - struct - { - unsigned int mask; - const target_desc *tdesc[2]; - } tdesc_tests[] = { - { X86_XSTATE_SSE_MASK, { tdesc_amd64_linux, tdesc_x32_linux } }, - { X86_XSTATE_AVX_MASK, { tdesc_amd64_avx_linux, tdesc_x32_avx_linux } }, - { X86_XSTATE_MPX_MASK, { tdesc_amd64_mpx_linux, tdesc_x32_avx_linux } }, - { X86_XSTATE_AVX_MPX_MASK, { tdesc_amd64_avx_mpx_linux, - tdesc_x32_avx_linux } }, - { X86_XSTATE_AVX_AVX512_MASK, { tdesc_amd64_avx_avx512_linux, - tdesc_x32_avx_avx512_linux } }, - { X86_XSTATE_AVX_MPX_AVX512_PKU_MASK, - { tdesc_amd64_avx_mpx_avx512_pku_linux, tdesc_x32_avx_avx512_linux } }, - }; - - for (auto &elem : tdesc_tests) - { - for (int i = 0; i < 2; i++) - { - const target_desc *tdesc = amd64_linux_read_description (elem.mask, - i); - - SELF_CHECK (*tdesc == *elem.tdesc[i]); - } - } -} - -#endif -} -} // namespace selftests - -void -initialize_low_tdesc () -{ - init_registers_i386_linux (); - init_registers_i386_mmx_linux (); - init_registers_i386_avx_linux (); - init_registers_i386_mpx_linux (); - init_registers_i386_avx_mpx_linux (); - init_registers_i386_avx_avx512_linux (); - init_registers_i386_avx_mpx_avx512_pku_linux (); - - selftests::register_test ("i386-tdesc", selftests::tdesc::i386_tdesc_test); - -#ifdef __x86_64__ - init_registers_x32_linux (); - init_registers_x32_avx_linux (); - init_registers_x32_avx_avx512_linux (); - - init_registers_amd64_linux (); - init_registers_amd64_avx_linux (); - init_registers_amd64_mpx_linux (); - init_registers_amd64_avx_mpx_linux (); - init_registers_amd64_avx_avx512_linux (); - init_registers_amd64_avx_mpx_avx512_pku_linux (); - - selftests::register_test ("amd64-tdesc", selftests::tdesc::amd64_tdesc_test); -#endif -} diff --git a/gdb/gdbserver/linux-x86-tdesc.h b/gdb/gdbserver/linux-x86-tdesc.h index 5f1fb18458c..bca9b64bca5 100644 --- a/gdb/gdbserver/linux-x86-tdesc.h +++ b/gdb/gdbserver/linux-x86-tdesc.h @@ -53,6 +53,4 @@ const struct target_desc *amd64_linux_read_description (uint64_t xcr0, const struct target_desc *i386_linux_read_description (uint64_t xcr0); -void initialize_low_tdesc (); - #endif /* GDBSERVER_LINUX_X86_TDESC_H */ diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index 74f429b49af..4d94ea659aa 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -1081,28 +1081,4 @@ _initialize_i386_linux_tdep (void) { gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_LINUX, i386_linux_init_abi); - -#if GDB_SELF_TEST - struct - { - const char *xml; - uint64_t mask; - } xml_masks[] = { - { "i386/i386-linux.xml", X86_XSTATE_SSE_MASK }, - { "i386/i386-mmx-linux.xml", X86_XSTATE_X87_MASK }, - { "i386/i386-avx-linux.xml", X86_XSTATE_AVX_MASK }, - { "i386/i386-mpx-linux.xml", X86_XSTATE_MPX_MASK }, - { "i386/i386-avx-mpx-linux.xml", X86_XSTATE_AVX_MPX_MASK }, - { "i386/i386-avx-avx512-linux.xml", X86_XSTATE_AVX_AVX512_MASK }, - { "i386/i386-avx-mpx-avx512-pku-linux.xml", - X86_XSTATE_AVX_MPX_AVX512_PKU_MASK }, - }; - - for (auto &a : xml_masks) - { - auto tdesc = i386_linux_read_description (a.mask); - - selftests::record_xml_tdesc (a.xml, tdesc); - } -#endif /* GDB_SELF_TEST */ } diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 00c1f8d7499..e3dd4b3238d 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -9098,28 +9098,4 @@ Show Intel Memory Protection Extensions specific variables."), /* Tell remote stub that we support XML target description. */ register_remote_support_xml ("i386"); - -#if GDB_SELF_TEST - struct - { - const char *xml; - uint64_t mask; - } xml_masks[] = { - { "i386/i386.xml", X86_XSTATE_SSE_MASK }, - { "i386/i386-mmx.xml", X86_XSTATE_X87_MASK }, - { "i386/i386-avx.xml", X86_XSTATE_AVX_MASK }, - { "i386/i386-mpx.xml", X86_XSTATE_MPX_MASK }, - { "i386/i386-avx-mpx.xml", X86_XSTATE_AVX_MPX_MASK }, - { "i386/i386-avx-avx512.xml", X86_XSTATE_AVX_AVX512_MASK }, - { "i386/i386-avx-mpx-avx512-pku.xml", - X86_XSTATE_AVX_MPX_AVX512_PKU_MASK }, - }; - - for (auto &a : xml_masks) - { - auto tdesc = i386_target_description (a.mask, false); - - selftests::record_xml_tdesc (a.xml, tdesc); - } -#endif /* GDB_SELF_TEST */ } diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 90b5f8ff8b5..2ad89ac01f5 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-07-04 Alan Hayward + + * gdb.server/unittest.exp: Allow 0 unit tests to run. + 2019-07-03 Pedro Alves * lib/gdb.exp (foreach_with_prefix): Use "catch" and diff --git a/gdb/testsuite/gdb.server/unittest.exp b/gdb/testsuite/gdb.server/unittest.exp index ef4a7b5e920..5aa6e4c58f8 100644 --- a/gdb/testsuite/gdb.server/unittest.exp +++ b/gdb/testsuite/gdb.server/unittest.exp @@ -35,7 +35,7 @@ gdb_expect { -i $server_spawn_id -re "Ran ($decimal) unit tests, 0 failed" { set num_ran $expect_out(1,string) - gdb_assert "$num_ran > 0" $test + gdb_assert "$num_ran >= 0" $test } -re "Selftests have been disabled for this build.\r\n$" {