Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v2 0/5] [gdb] xml linting
@ 2026-08-26 21:22 Tom de Vries
  2026-08-26 21:22 ` [PATCH v2 1/5] [pre-commit] Check xml files Tom de Vries
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Tom de Vries @ 2026-08-26 21:22 UTC (permalink / raw)
  To: gdb-patches

This contains five patches.

The first patch adds two pre-commit checks for xml files.

The following patch fixes a namespace problem found with xmllint.

The third and fourth patches fix problems found with xmllint --valid.

The last patch enables xmllint --valid for clean files.

Changes in v2:
- fix bug in in the second patch: don't add <target> ... </target>
- in the first patch, add xmllint disabled by default (stages: manual)
- add two patches fixing problems found using xmllint --valid
- add a patch enabling xmllint --valid

Versions:
- v1 https://sourceware.org/pipermail/gdb-patches/2026-August/229764.html

Tom de Vries (5):
  [pre-commit] Check xml files
  [gdb] Fix xmllint namespace errors
  [gdb] Fix target element validity error in features/gdb-target.dtd
  [gdb] Fix syscalls-info -> syscalls_info in syscalls/gdb-syscalls.dtd
  [pre-commit] Use --valid with xmllint

 .pre-commit-config.yaml                       |  27 ++++
 gdb/contrib/xmllint.sh                        | 152 ++++++++++++++++++
 gdb/features/alpha.xml                        |   2 +-
 gdb/features/gdb-target.dtd                   |   6 +-
 gdb/features/microblaze-linux.xml             |   2 +-
 .../microblaze-with-stack-protect.xml         |   2 +-
 gdb/features/microblaze.xml                   |   2 +-
 gdb/features/mips-dsp-linux.xml               |   2 +-
 gdb/features/mips-linux.xml                   |   2 +-
 gdb/features/mips64-dsp-linux.xml             |   2 +-
 gdb/features/mips64-linux.xml                 |   2 +-
 gdb/features/nds32.xml                        |   2 +-
 gdb/features/or1k-linux.xml                   |   2 +-
 gdb/features/or1k.xml                         |   2 +-
 gdb/features/rs6000/powerpc-32.xml            |   2 +-
 gdb/features/rs6000/powerpc-32l.xml           |   2 +-
 gdb/features/rs6000/powerpc-403.xml           |   2 +-
 gdb/features/rs6000/powerpc-403gc.xml         |   2 +-
 gdb/features/rs6000/powerpc-405.xml           |   2 +-
 gdb/features/rs6000/powerpc-505.xml           |   2 +-
 gdb/features/rs6000/powerpc-601.xml           |   2 +-
 gdb/features/rs6000/powerpc-602.xml           |   2 +-
 gdb/features/rs6000/powerpc-603.xml           |   2 +-
 gdb/features/rs6000/powerpc-604.xml           |   2 +-
 gdb/features/rs6000/powerpc-64.xml            |   2 +-
 gdb/features/rs6000/powerpc-64l.xml           |   2 +-
 gdb/features/rs6000/powerpc-7400.xml          |   2 +-
 gdb/features/rs6000/powerpc-750.xml           |   2 +-
 gdb/features/rs6000/powerpc-860.xml           |   2 +-
 gdb/features/rs6000/powerpc-altivec32.xml     |   2 +-
 gdb/features/rs6000/powerpc-altivec32l.xml    |   2 +-
 gdb/features/rs6000/powerpc-altivec64.xml     |   2 +-
 gdb/features/rs6000/powerpc-altivec64l.xml    |   2 +-
 gdb/features/rs6000/powerpc-e500.xml          |   2 +-
 gdb/features/rs6000/powerpc-e500l.xml         |   2 +-
 gdb/features/rs6000/powerpc-isa205-32l.xml    |   2 +-
 gdb/features/rs6000/powerpc-isa205-64l.xml    |   2 +-
 .../rs6000/powerpc-isa205-altivec32l.xml      |   2 +-
 .../rs6000/powerpc-isa205-altivec64l.xml      |   2 +-
 .../rs6000/powerpc-isa205-ppr-dscr-vsx32l.xml |   2 +-
 .../rs6000/powerpc-isa205-ppr-dscr-vsx64l.xml |   2 +-
 gdb/features/rs6000/powerpc-isa205-vsx32l.xml |   2 +-
 gdb/features/rs6000/powerpc-isa205-vsx64l.xml |   2 +-
 .../rs6000/powerpc-isa207-htm-vsx32l.xml      |   2 +-
 .../rs6000/powerpc-isa207-htm-vsx64l.xml      |   2 +-
 gdb/features/rs6000/powerpc-isa207-vsx32l.xml |   2 +-
 gdb/features/rs6000/powerpc-isa207-vsx64l.xml |   2 +-
 gdb/features/rs6000/powerpc-vsx32.xml         |   2 +-
 gdb/features/rs6000/powerpc-vsx32l.xml        |   2 +-
 gdb/features/rs6000/powerpc-vsx64.xml         |   2 +-
 gdb/features/rs6000/powerpc-vsx64l.xml        |   2 +-
 gdb/features/rs6000/rs6000.xml                |   2 +-
 gdb/features/rx.xml                           |   2 +-
 gdb/features/s390-gs-linux64.xml              |   2 +-
 gdb/features/s390-linux32.xml                 |   2 +-
 gdb/features/s390-linux32v1.xml               |   2 +-
 gdb/features/s390-linux32v2.xml               |   2 +-
 gdb/features/s390-linux64.xml                 |   2 +-
 gdb/features/s390-linux64v1.xml               |   2 +-
 gdb/features/s390-linux64v2.xml               |   2 +-
 gdb/features/s390-te-linux64.xml              |   2 +-
 gdb/features/s390-tevx-linux64.xml            |   2 +-
 gdb/features/s390-vx-linux64.xml              |   2 +-
 gdb/features/s390x-gs-linux64.xml             |   2 +-
 gdb/features/s390x-linux64.xml                |   2 +-
 gdb/features/s390x-linux64v1.xml              |   2 +-
 gdb/features/s390x-linux64v2.xml              |   2 +-
 gdb/features/s390x-te-linux64.xml             |   2 +-
 gdb/features/s390x-tevx-linux64.xml           |   2 +-
 gdb/features/s390x-vx-linux64.xml             |   2 +-
 gdb/features/sparc/sparc32-solaris.xml        |   2 +-
 gdb/features/sparc/sparc64-solaris.xml        |   2 +-
 gdb/features/tic6x-c62x-linux.xml             |   2 +-
 gdb/features/tic6x-c64x-linux.xml             |   2 +-
 gdb/features/tic6x-c64xp-linux.xml            |   2 +-
 gdb/features/z80.xml                          |   2 +-
 gdb/syscalls/gdb-syscalls.dtd                 |   4 +-
 gdb/testsuite/gdb.xml/bad-include.xml         |   2 +-
 gdb/testsuite/gdb.xml/core-only.xml           |   2 +-
 gdb/testsuite/gdb.xml/extra-regs.xml          |   2 +-
 gdb/testsuite/gdb.xml/inc-2.xml               |   2 +-
 gdb/testsuite/gdb.xml/includes.xml            |   2 +-
 gdb/testsuite/gdb.xml/loop.xml                |   2 +-
 83 files changed, 263 insertions(+), 84 deletions(-)
 create mode 100755 gdb/contrib/xmllint.sh


base-commit: 63b85fe5d59d1eee20f177b4b6e653ddabdeebf7
-- 
2.51.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/5] [pre-commit] Check xml files
  2026-08-26 21:22 [PATCH v2 0/5] [gdb] xml linting Tom de Vries
@ 2026-08-26 21:22 ` Tom de Vries
  2026-08-26 21:22 ` [PATCH v2 2/5] [gdb] Fix xmllint namespace errors Tom de Vries
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2026-08-26 21:22 UTC (permalink / raw)
  To: gdb-patches

Add two pre-commit checks to check xml files (*.xml, *.xsl and
./gdb/doc/stack_frame.svg).

The first one is check-xml [1].  This just checks for well-formedness.  It's
enabled by default.

The second one is xmllint [2].  This has more elaborate checks.  But because
it's C-based, it's not enabled by default.

[1] https://github.com/pre-commit/pre-commit-hooks#check-xml
[2] https://gnome.pages.gitlab.gnome.org/libxml2/xmllint.html
---
 .pre-commit-config.yaml | 27 +++++++++++++
 gdb/contrib/xmllint.sh  | 87 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 114 insertions(+)
 create mode 100755 gdb/contrib/xmllint.sh

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 53e4c5033c1..622d56936fb 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -109,6 +109,19 @@ repos:
       - id: yamllint
         files: '^\.pre-commit-config.yaml$'
 
+  # Out-of-the-box hooks.
+  - repo: https://github.com/pre-commit/pre-commit-hooks
+    rev: v6.0.0
+    hooks:
+      # This just checks for well-formedness.  For better xml checking, see
+      # xmllint (disabled by default) below.
+      - id: &id5 check-xml
+        name: *id5
+        files: &gdb_xml_files '^(gdb|gdbserver|gdbsupport)/.*\.(xml|xsl|svg)$'
+        # Exclude:
+        # - gdb.xml/tdesc-bogus.xml (malformed)
+        exclude: ^gdb/testsuite/gdb.xml/tdesc-bogus.xml$
+
   # Local hooks.
   - repo: local
     hooks:
@@ -146,6 +159,20 @@ repos:
         language: unsupported_script
         entry: gdb/contrib/check-file-mode.sh
         files: *gdb_files
+      - id: &id6 xmllint
+        name: *id6
+        # The xmllint.sh script calls xmllint.  Users need to install xmllint
+        # and its dependencies.  It's not clear what the supported versions
+        # are, but this has been tested with libxml version 21308.
+        language: unsupported_script
+        entry: gdb/contrib/xmllint.sh
+        files: *gdb_xml_files
+        # Disabled by default, because pre-commit doesn't install xmllint for
+        # you.  To use this hook, do:
+        #   $ pre-commit run --hook-stage manual xmllint --files ...
+        #   $ pre-commit run --hook-stage manual xmllint --all-files
+        # or similar.
+        stages: [manual]
 
 # Local Variables:
 # indent-tabs-mode: nil
diff --git a/gdb/contrib/xmllint.sh b/gdb/contrib/xmllint.sh
new file mode 100755
index 00000000000..748e096bbef
--- /dev/null
+++ b/gdb/contrib/xmllint.sh
@@ -0,0 +1,87 @@
+#!/bin/sh
+
+# Copyright (C) 2026 Free Software Foundation, Inc.
+# 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 <http://www.gnu.org/licenses/>.
+
+# Wrapper around xmllint to make it exit with non-zero if there is any output.
+
+tmp=""
+
+cleanup()
+{
+    if [ "$tmp" != "" ]; then
+	rm -f "$tmp"
+    fi
+}
+
+# Schedule cleanup.
+trap cleanup EXIT
+
+tmp=$(mktemp)
+
+check_basic=""
+check_includes=""
+for f in "$@"; do
+    case $f in
+        gdb/testsuite/gdb.xml/tdesc-bogus.xml)
+	    # Malformed.
+	    continue
+	    ;;
+	gdb/testsuite/gdb.xml/bad-include.xml \
+	    | gdb/testsuite/gdb.xml/core-only.xml \
+	    | gdb/testsuite/gdb.xml/extra-regs.xml \
+	    | gdb/testsuite/gdb.xml/loop.xml)
+            # Don't check includes for:
+            # - gdb.xml/bad-include.xml (XInclude error: nonexistent.xml)
+            # - gdb.xml/{core-only,extra-regs}.xml (XInclude error: core-regs.xml)
+            # - gdb.xml/loop.xml (XInclude error: loop.xml)
+	    check_basic="$check_basic $f"
+	    ;;
+	*)
+	    check_includes="$check_includes $f"
+	    ;;
+    esac
+done
+
+st1=0
+if [ "$check_basic" != "" ]; then
+    xmllint --noout \
+	    $check_basic \
+	    > "$tmp" \
+	    2>&1; st1=$?
+fi
+
+st2=0
+if [ "$check_includes" != "" ]; then
+    # Provide the --path parts to let xmllint find the .dtd files.
+    xmllint --noout --xinclude --path gdb/syscalls --path gdb/features \
+	    $check_includes \
+	    >> "$tmp" \
+	    2>&1; st2=$?
+fi
+
+if [ $st1 -eq 0 ] && [ $st2 -eq 0 ]; then
+    st=0
+else
+    st=1
+fi
+
+if [ -s "$tmp" ]; then
+    cat "$tmp"
+    if [ $st -eq 0 ]; then
+	st=1
+    fi
+fi
+
+exit $st
-- 
2.51.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 2/5] [gdb] Fix xmllint namespace errors
  2026-08-26 21:22 [PATCH v2 0/5] [gdb] xml linting Tom de Vries
  2026-08-26 21:22 ` [PATCH v2 1/5] [pre-commit] Check xml files Tom de Vries
@ 2026-08-26 21:22 ` Tom de Vries
  2026-08-26 21:22 ` [PATCH v2 3/5] [gdb] Fix target element validity error in features/gdb-target.dtd Tom de Vries
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2026-08-26 21:22 UTC (permalink / raw)
  To: gdb-patches

I ran xmllint on the xml files in gdb, and ran into:
...
$ pre-commit run --hook-stage manual --all-files
xmllint.................................................................Failed
- hook id: xmllint
- exit code: 1

gdb/features/rs6000/powerpc-405.xml:10: namespace error : \
  Namespace prefix xi on include is not defined
  <xi:include href="power-core.xml"/>
                                   ^
...

While this doesn't cause problems for gdb/libexpat, fixing it seems like a
good idea.

Fix this by an explicit:
...
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
...
or in case of missing <target> ... </target>:
...
-<xi:include href="..."/>
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="..."/>
...

After fixing this, the check passes:
...
$ pre-commit run --hook-stage manual --all-files
xmllint.................................................................Passed
...
---
 gdb/features/alpha.xml                                 | 2 +-
 gdb/features/microblaze-linux.xml                      | 2 +-
 gdb/features/microblaze-with-stack-protect.xml         | 2 +-
 gdb/features/microblaze.xml                            | 2 +-
 gdb/features/mips-dsp-linux.xml                        | 2 +-
 gdb/features/mips-linux.xml                            | 2 +-
 gdb/features/mips64-dsp-linux.xml                      | 2 +-
 gdb/features/mips64-linux.xml                          | 2 +-
 gdb/features/nds32.xml                                 | 2 +-
 gdb/features/or1k-linux.xml                            | 2 +-
 gdb/features/or1k.xml                                  | 2 +-
 gdb/features/rs6000/powerpc-32.xml                     | 2 +-
 gdb/features/rs6000/powerpc-32l.xml                    | 2 +-
 gdb/features/rs6000/powerpc-403.xml                    | 2 +-
 gdb/features/rs6000/powerpc-403gc.xml                  | 2 +-
 gdb/features/rs6000/powerpc-405.xml                    | 2 +-
 gdb/features/rs6000/powerpc-505.xml                    | 2 +-
 gdb/features/rs6000/powerpc-601.xml                    | 2 +-
 gdb/features/rs6000/powerpc-602.xml                    | 2 +-
 gdb/features/rs6000/powerpc-603.xml                    | 2 +-
 gdb/features/rs6000/powerpc-604.xml                    | 2 +-
 gdb/features/rs6000/powerpc-64.xml                     | 2 +-
 gdb/features/rs6000/powerpc-64l.xml                    | 2 +-
 gdb/features/rs6000/powerpc-7400.xml                   | 2 +-
 gdb/features/rs6000/powerpc-750.xml                    | 2 +-
 gdb/features/rs6000/powerpc-860.xml                    | 2 +-
 gdb/features/rs6000/powerpc-altivec32.xml              | 2 +-
 gdb/features/rs6000/powerpc-altivec32l.xml             | 2 +-
 gdb/features/rs6000/powerpc-altivec64.xml              | 2 +-
 gdb/features/rs6000/powerpc-altivec64l.xml             | 2 +-
 gdb/features/rs6000/powerpc-e500.xml                   | 2 +-
 gdb/features/rs6000/powerpc-e500l.xml                  | 2 +-
 gdb/features/rs6000/powerpc-isa205-32l.xml             | 2 +-
 gdb/features/rs6000/powerpc-isa205-64l.xml             | 2 +-
 gdb/features/rs6000/powerpc-isa205-altivec32l.xml      | 2 +-
 gdb/features/rs6000/powerpc-isa205-altivec64l.xml      | 2 +-
 gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.xml | 2 +-
 gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.xml | 2 +-
 gdb/features/rs6000/powerpc-isa205-vsx32l.xml          | 2 +-
 gdb/features/rs6000/powerpc-isa205-vsx64l.xml          | 2 +-
 gdb/features/rs6000/powerpc-isa207-htm-vsx32l.xml      | 2 +-
 gdb/features/rs6000/powerpc-isa207-htm-vsx64l.xml      | 2 +-
 gdb/features/rs6000/powerpc-isa207-vsx32l.xml          | 2 +-
 gdb/features/rs6000/powerpc-isa207-vsx64l.xml          | 2 +-
 gdb/features/rs6000/powerpc-vsx32.xml                  | 2 +-
 gdb/features/rs6000/powerpc-vsx32l.xml                 | 2 +-
 gdb/features/rs6000/powerpc-vsx64.xml                  | 2 +-
 gdb/features/rs6000/powerpc-vsx64l.xml                 | 2 +-
 gdb/features/rs6000/rs6000.xml                         | 2 +-
 gdb/features/rx.xml                                    | 2 +-
 gdb/features/s390-gs-linux64.xml                       | 2 +-
 gdb/features/s390-linux32.xml                          | 2 +-
 gdb/features/s390-linux32v1.xml                        | 2 +-
 gdb/features/s390-linux32v2.xml                        | 2 +-
 gdb/features/s390-linux64.xml                          | 2 +-
 gdb/features/s390-linux64v1.xml                        | 2 +-
 gdb/features/s390-linux64v2.xml                        | 2 +-
 gdb/features/s390-te-linux64.xml                       | 2 +-
 gdb/features/s390-tevx-linux64.xml                     | 2 +-
 gdb/features/s390-vx-linux64.xml                       | 2 +-
 gdb/features/s390x-gs-linux64.xml                      | 2 +-
 gdb/features/s390x-linux64.xml                         | 2 +-
 gdb/features/s390x-linux64v1.xml                       | 2 +-
 gdb/features/s390x-linux64v2.xml                       | 2 +-
 gdb/features/s390x-te-linux64.xml                      | 2 +-
 gdb/features/s390x-tevx-linux64.xml                    | 2 +-
 gdb/features/s390x-vx-linux64.xml                      | 2 +-
 gdb/features/sparc/sparc32-solaris.xml                 | 2 +-
 gdb/features/sparc/sparc64-solaris.xml                 | 2 +-
 gdb/features/tic6x-c62x-linux.xml                      | 2 +-
 gdb/features/tic6x-c64x-linux.xml                      | 2 +-
 gdb/features/tic6x-c64xp-linux.xml                     | 2 +-
 gdb/features/z80.xml                                   | 2 +-
 gdb/testsuite/gdb.xml/bad-include.xml                  | 2 +-
 gdb/testsuite/gdb.xml/core-only.xml                    | 2 +-
 gdb/testsuite/gdb.xml/extra-regs.xml                   | 2 +-
 gdb/testsuite/gdb.xml/inc-2.xml                        | 2 +-
 gdb/testsuite/gdb.xml/includes.xml                     | 2 +-
 gdb/testsuite/gdb.xml/loop.xml                         | 2 +-
 79 files changed, 79 insertions(+), 79 deletions(-)

diff --git a/gdb/features/alpha.xml b/gdb/features/alpha.xml
index 8ede1f404e5..46ae2078d91 100644
--- a/gdb/features/alpha.xml
+++ b/gdb/features/alpha.xml
@@ -6,6 +6,6 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE feature SYSTEM "gdb-target.dtd">
-<target version="1.0">
+<target version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="alpha-core.xml"/>
 </target>
diff --git a/gdb/features/microblaze-linux.xml b/gdb/features/microblaze-linux.xml
index 06945af08dd..f0a59aaddd2 100644
--- a/gdb/features/microblaze-linux.xml
+++ b/gdb/features/microblaze-linux.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>microblaze</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="microblaze-core.xml"/>
diff --git a/gdb/features/microblaze-with-stack-protect.xml b/gdb/features/microblaze-with-stack-protect.xml
index 524ab9f7adb..6ebc5c608fa 100644
--- a/gdb/features/microblaze-with-stack-protect.xml
+++ b/gdb/features/microblaze-with-stack-protect.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="microblaze-core.xml"/>
   <xi:include href="microblaze-stack-protect.xml"/>
 </target>
diff --git a/gdb/features/microblaze.xml b/gdb/features/microblaze.xml
index 93554b295ed..e13b9cd8570 100644
--- a/gdb/features/microblaze.xml
+++ b/gdb/features/microblaze.xml
@@ -6,6 +6,6 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="microblaze-core.xml"/>
 </target>
diff --git a/gdb/features/mips-dsp-linux.xml b/gdb/features/mips-dsp-linux.xml
index 166d322f746..0247b08672b 100644
--- a/gdb/features/mips-dsp-linux.xml
+++ b/gdb/features/mips-dsp-linux.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>mips</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="mips-cpu.xml"/>
diff --git a/gdb/features/mips-linux.xml b/gdb/features/mips-linux.xml
index f24c656d93b..d8e8b2a0c5a 100644
--- a/gdb/features/mips-linux.xml
+++ b/gdb/features/mips-linux.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>mips</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="mips-cpu.xml"/>
diff --git a/gdb/features/mips64-dsp-linux.xml b/gdb/features/mips64-dsp-linux.xml
index 1568ced003b..9062b730619 100644
--- a/gdb/features/mips64-dsp-linux.xml
+++ b/gdb/features/mips64-dsp-linux.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>mips</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="mips64-cpu.xml"/>
diff --git a/gdb/features/mips64-linux.xml b/gdb/features/mips64-linux.xml
index 72022c17d32..d3dcf493892 100644
--- a/gdb/features/mips64-linux.xml
+++ b/gdb/features/mips64-linux.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>mips</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="mips64-cpu.xml"/>
diff --git a/gdb/features/nds32.xml b/gdb/features/nds32.xml
index 6b9d3132ee3..b90b60532a7 100644
--- a/gdb/features/nds32.xml
+++ b/gdb/features/nds32.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>nds32</architecture>
   <xi:include href="nds32-core.xml"/>
   <xi:include href="nds32-fpu.xml"/>
diff --git a/gdb/features/or1k-linux.xml b/gdb/features/or1k-linux.xml
index 40424ec3106..bb9c1f7cdbb 100644
--- a/gdb/features/or1k-linux.xml
+++ b/gdb/features/or1k-linux.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>or1k</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="or1k-core.xml"/>
diff --git a/gdb/features/or1k.xml b/gdb/features/or1k.xml
index f9bb4afe584..973b760cac1 100644
--- a/gdb/features/or1k.xml
+++ b/gdb/features/or1k.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>or1k</architecture>
   <xi:include href="or1k-core.xml"/>
 </target>
diff --git a/gdb/features/rs6000/powerpc-32.xml b/gdb/features/rs6000/powerpc-32.xml
index 5d920c9b1e9..a296a4580c7 100644
--- a/gdb/features/rs6000/powerpc-32.xml
+++ b/gdb/features/rs6000/powerpc-32.xml
@@ -9,7 +9,7 @@
      view of the PowerPC.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common</architecture>
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
diff --git a/gdb/features/rs6000/powerpc-32l.xml b/gdb/features/rs6000/powerpc-32l.xml
index 7250b3c8c63..613ceb2b5a1 100644
--- a/gdb/features/rs6000/powerpc-32l.xml
+++ b/gdb/features/rs6000/powerpc-32l.xml
@@ -9,7 +9,7 @@
      view of the PowerPC.  Includes Linux-only special "registers".  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common</architecture>
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
diff --git a/gdb/features/rs6000/powerpc-403.xml b/gdb/features/rs6000/powerpc-403.xml
index 886da764c94..3a8a2b373e0 100644
--- a/gdb/features/rs6000/powerpc-403.xml
+++ b/gdb/features/rs6000/powerpc-403.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
   <xi:include href="power-oea.xml"/>
diff --git a/gdb/features/rs6000/powerpc-403gc.xml b/gdb/features/rs6000/powerpc-403gc.xml
index 4a0b35383fd..b077a213fed 100644
--- a/gdb/features/rs6000/powerpc-403gc.xml
+++ b/gdb/features/rs6000/powerpc-403gc.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
   <xi:include href="power-oea.xml"/>
diff --git a/gdb/features/rs6000/powerpc-405.xml b/gdb/features/rs6000/powerpc-405.xml
index 674c4e83441..da3c6ee62b9 100644
--- a/gdb/features/rs6000/powerpc-405.xml
+++ b/gdb/features/rs6000/powerpc-405.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
 
diff --git a/gdb/features/rs6000/powerpc-505.xml b/gdb/features/rs6000/powerpc-505.xml
index cfa8dfdfc9b..8620bb639a5 100644
--- a/gdb/features/rs6000/powerpc-505.xml
+++ b/gdb/features/rs6000/powerpc-505.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
   <xi:include href="power-oea.xml"/>
diff --git a/gdb/features/rs6000/powerpc-601.xml b/gdb/features/rs6000/powerpc-601.xml
index c13560272ca..7ca747243d2 100644
--- a/gdb/features/rs6000/powerpc-601.xml
+++ b/gdb/features/rs6000/powerpc-601.xml
@@ -9,7 +9,7 @@
      user-level SPR's.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <!-- This description is slightly different from the standard
        org.gnu.gdb.power.core, to accommodate mq.  -->
   <feature name="org.gnu.gdb.power.core">
diff --git a/gdb/features/rs6000/powerpc-602.xml b/gdb/features/rs6000/powerpc-602.xml
index dd366c1e7f5..66dc888084b 100644
--- a/gdb/features/rs6000/powerpc-602.xml
+++ b/gdb/features/rs6000/powerpc-602.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
   <xi:include href="power-oea.xml"/>
diff --git a/gdb/features/rs6000/powerpc-603.xml b/gdb/features/rs6000/powerpc-603.xml
index 524111fb0b1..2d4914d2aa9 100644
--- a/gdb/features/rs6000/powerpc-603.xml
+++ b/gdb/features/rs6000/powerpc-603.xml
@@ -8,7 +8,7 @@
 <!-- PowerPC 603 or 603e.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
   <xi:include href="power-oea.xml"/>
diff --git a/gdb/features/rs6000/powerpc-604.xml b/gdb/features/rs6000/powerpc-604.xml
index 35586ee7471..664a9043e6c 100644
--- a/gdb/features/rs6000/powerpc-604.xml
+++ b/gdb/features/rs6000/powerpc-604.xml
@@ -8,7 +8,7 @@
 <!-- PowerPC 604 or 604e.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
   <xi:include href="power-oea.xml"/>
diff --git a/gdb/features/rs6000/powerpc-64.xml b/gdb/features/rs6000/powerpc-64.xml
index 1c1b7f14194..ad17dc0bd57 100644
--- a/gdb/features/rs6000/powerpc-64.xml
+++ b/gdb/features/rs6000/powerpc-64.xml
@@ -9,7 +9,7 @@
      view of the PowerPC.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common64</architecture>
   <xi:include href="power64-core.xml"/>
   <xi:include href="power-fpu.xml"/>
diff --git a/gdb/features/rs6000/powerpc-64l.xml b/gdb/features/rs6000/powerpc-64l.xml
index 358f89604a5..792fcd0e55e 100644
--- a/gdb/features/rs6000/powerpc-64l.xml
+++ b/gdb/features/rs6000/powerpc-64l.xml
@@ -9,7 +9,7 @@
      view of the PowerPC.  Includes Linux-only special "registers".  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common64</architecture>
   <xi:include href="power64-core.xml"/>
   <xi:include href="power-fpu.xml"/>
diff --git a/gdb/features/rs6000/powerpc-7400.xml b/gdb/features/rs6000/powerpc-7400.xml
index e7a41a82feb..ba42e84d57d 100644
--- a/gdb/features/rs6000/powerpc-7400.xml
+++ b/gdb/features/rs6000/powerpc-7400.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
   <xi:include href="power-oea.xml"/>
diff --git a/gdb/features/rs6000/powerpc-750.xml b/gdb/features/rs6000/powerpc-750.xml
index 96088952804..1815f0323f7 100644
--- a/gdb/features/rs6000/powerpc-750.xml
+++ b/gdb/features/rs6000/powerpc-750.xml
@@ -8,7 +8,7 @@
 <!-- PowerPC 750 or 740.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
   <xi:include href="power-oea.xml"/>
diff --git a/gdb/features/rs6000/powerpc-860.xml b/gdb/features/rs6000/powerpc-860.xml
index 1dde3b95f2d..5f17abd8cd4 100644
--- a/gdb/features/rs6000/powerpc-860.xml
+++ b/gdb/features/rs6000/powerpc-860.xml
@@ -8,7 +8,7 @@
 <!-- PowerPC 860 or 850.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
   <xi:include href="power-oea.xml"/>
diff --git a/gdb/features/rs6000/powerpc-altivec32.xml b/gdb/features/rs6000/powerpc-altivec32.xml
index 7d0485deddc..b69efa88586 100644
--- a/gdb/features/rs6000/powerpc-altivec32.xml
+++ b/gdb/features/rs6000/powerpc-altivec32.xml
@@ -9,7 +9,7 @@
      view of the PowerPC.  Includes AltiVec vector registers.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common</architecture>
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
diff --git a/gdb/features/rs6000/powerpc-altivec32l.xml b/gdb/features/rs6000/powerpc-altivec32l.xml
index 68c7cad2cde..f3c1232789f 100644
--- a/gdb/features/rs6000/powerpc-altivec32l.xml
+++ b/gdb/features/rs6000/powerpc-altivec32l.xml
@@ -10,7 +10,7 @@
      vector registers.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common</architecture>
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
diff --git a/gdb/features/rs6000/powerpc-altivec64.xml b/gdb/features/rs6000/powerpc-altivec64.xml
index 204014d2566..c7eae3d61c4 100644
--- a/gdb/features/rs6000/powerpc-altivec64.xml
+++ b/gdb/features/rs6000/powerpc-altivec64.xml
@@ -9,7 +9,7 @@
      view of the PowerPC.  Includes AltiVec vector registers.   -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common64</architecture>
   <xi:include href="power64-core.xml"/>
   <xi:include href="power-fpu.xml"/>
diff --git a/gdb/features/rs6000/powerpc-altivec64l.xml b/gdb/features/rs6000/powerpc-altivec64l.xml
index 97cf2184d02..aa93b4aa935 100644
--- a/gdb/features/rs6000/powerpc-altivec64l.xml
+++ b/gdb/features/rs6000/powerpc-altivec64l.xml
@@ -10,7 +10,7 @@
      vector registers.   -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common64</architecture>
   <xi:include href="power64-core.xml"/>
   <xi:include href="power-fpu.xml"/>
diff --git a/gdb/features/rs6000/powerpc-e500.xml b/gdb/features/rs6000/powerpc-e500.xml
index da8e5fff0ff..2b033549482 100644
--- a/gdb/features/rs6000/powerpc-e500.xml
+++ b/gdb/features/rs6000/powerpc-e500.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:e500</architecture>
   <xi:include href="power-core.xml"/>
   <xi:include href="power-spe.xml"/>
diff --git a/gdb/features/rs6000/powerpc-e500l.xml b/gdb/features/rs6000/powerpc-e500l.xml
index 50d990ab140..972dd83c2f6 100644
--- a/gdb/features/rs6000/powerpc-e500l.xml
+++ b/gdb/features/rs6000/powerpc-e500l.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:e500</architecture>
   <xi:include href="power-core.xml"/>
   <xi:include href="power-spe.xml"/>
diff --git a/gdb/features/rs6000/powerpc-isa205-32l.xml b/gdb/features/rs6000/powerpc-isa205-32l.xml
index 637dfb2e173..9b4c36a8943 100644
--- a/gdb/features/rs6000/powerpc-isa205-32l.xml
+++ b/gdb/features/rs6000/powerpc-isa205-32l.xml
@@ -9,7 +9,7 @@
      view of the PowerPC.  Includes Linux-only special "registers".  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common</architecture>
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu-isa205.xml"/>
diff --git a/gdb/features/rs6000/powerpc-isa205-64l.xml b/gdb/features/rs6000/powerpc-isa205-64l.xml
index 873ba4218d1..a36d83e5707 100644
--- a/gdb/features/rs6000/powerpc-isa205-64l.xml
+++ b/gdb/features/rs6000/powerpc-isa205-64l.xml
@@ -9,7 +9,7 @@
      view of the PowerPC.  Includes Linux-only special "registers".  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common64</architecture>
   <xi:include href="power64-core.xml"/>
   <xi:include href="power-fpu-isa205.xml"/>
diff --git a/gdb/features/rs6000/powerpc-isa205-altivec32l.xml b/gdb/features/rs6000/powerpc-isa205-altivec32l.xml
index 8c979874a52..88d04a01904 100644
--- a/gdb/features/rs6000/powerpc-isa205-altivec32l.xml
+++ b/gdb/features/rs6000/powerpc-isa205-altivec32l.xml
@@ -10,7 +10,7 @@
      vector registers.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common</architecture>
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu-isa205.xml"/>
diff --git a/gdb/features/rs6000/powerpc-isa205-altivec64l.xml b/gdb/features/rs6000/powerpc-isa205-altivec64l.xml
index 72e70484429..b14c5652d5f 100644
--- a/gdb/features/rs6000/powerpc-isa205-altivec64l.xml
+++ b/gdb/features/rs6000/powerpc-isa205-altivec64l.xml
@@ -10,7 +10,7 @@
      vector registers.   -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common64</architecture>
   <xi:include href="power64-core.xml"/>
   <xi:include href="power-fpu-isa205.xml"/>
diff --git a/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.xml b/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.xml
index 45c51947888..f1513a623f8 100644
--- a/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.xml
+++ b/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx32l.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common</architecture>
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu-isa205.xml"/>
diff --git a/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.xml b/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.xml
index 090acb450dd..b455d2ce1c8 100644
--- a/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.xml
+++ b/gdb/features/rs6000/powerpc-isa205-ppr-dscr-vsx64l.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common64</architecture>
   <xi:include href="power64-core.xml"/>
   <xi:include href="power-fpu-isa205.xml"/>
diff --git a/gdb/features/rs6000/powerpc-isa205-vsx32l.xml b/gdb/features/rs6000/powerpc-isa205-vsx32l.xml
index c4a15e5ef4c..c37663d1105 100644
--- a/gdb/features/rs6000/powerpc-isa205-vsx32l.xml
+++ b/gdb/features/rs6000/powerpc-isa205-vsx32l.xml
@@ -10,7 +10,7 @@
      and VSX vector registers.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common</architecture>
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu-isa205.xml"/>
diff --git a/gdb/features/rs6000/powerpc-isa205-vsx64l.xml b/gdb/features/rs6000/powerpc-isa205-vsx64l.xml
index 621c9073f24..ac00f3a5584 100644
--- a/gdb/features/rs6000/powerpc-isa205-vsx64l.xml
+++ b/gdb/features/rs6000/powerpc-isa205-vsx64l.xml
@@ -10,7 +10,7 @@
      and VSX vector registers.   -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common64</architecture>
   <xi:include href="power64-core.xml"/>
   <xi:include href="power-fpu-isa205.xml"/>
diff --git a/gdb/features/rs6000/powerpc-isa207-htm-vsx32l.xml b/gdb/features/rs6000/powerpc-isa207-htm-vsx32l.xml
index 1025a620b9a..e360ea5b918 100644
--- a/gdb/features/rs6000/powerpc-isa207-htm-vsx32l.xml
+++ b/gdb/features/rs6000/powerpc-isa207-htm-vsx32l.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common</architecture>
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu-isa205.xml"/>
diff --git a/gdb/features/rs6000/powerpc-isa207-htm-vsx64l.xml b/gdb/features/rs6000/powerpc-isa207-htm-vsx64l.xml
index 6f94734c03c..bf7ee85e369 100644
--- a/gdb/features/rs6000/powerpc-isa207-htm-vsx64l.xml
+++ b/gdb/features/rs6000/powerpc-isa207-htm-vsx64l.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common64</architecture>
   <xi:include href="power64-core.xml"/>
   <xi:include href="power-fpu-isa205.xml"/>
diff --git a/gdb/features/rs6000/powerpc-isa207-vsx32l.xml b/gdb/features/rs6000/powerpc-isa207-vsx32l.xml
index cc7d5388949..9314aa752a2 100644
--- a/gdb/features/rs6000/powerpc-isa207-vsx32l.xml
+++ b/gdb/features/rs6000/powerpc-isa207-vsx32l.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common</architecture>
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu-isa205.xml"/>
diff --git a/gdb/features/rs6000/powerpc-isa207-vsx64l.xml b/gdb/features/rs6000/powerpc-isa207-vsx64l.xml
index 181aff6349b..115208dbb0b 100644
--- a/gdb/features/rs6000/powerpc-isa207-vsx64l.xml
+++ b/gdb/features/rs6000/powerpc-isa207-vsx64l.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common64</architecture>
   <xi:include href="power64-core.xml"/>
   <xi:include href="power-fpu-isa205.xml"/>
diff --git a/gdb/features/rs6000/powerpc-vsx32.xml b/gdb/features/rs6000/powerpc-vsx32.xml
index 94060140920..0ad6cf49739 100644
--- a/gdb/features/rs6000/powerpc-vsx32.xml
+++ b/gdb/features/rs6000/powerpc-vsx32.xml
@@ -9,7 +9,7 @@
      view of the PowerPC.  Includes AltiVec and VSX vector registers.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common</architecture>
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
diff --git a/gdb/features/rs6000/powerpc-vsx32l.xml b/gdb/features/rs6000/powerpc-vsx32l.xml
index 4126b1acce8..d85ab358091 100644
--- a/gdb/features/rs6000/powerpc-vsx32l.xml
+++ b/gdb/features/rs6000/powerpc-vsx32l.xml
@@ -10,7 +10,7 @@
      and VSX vector registers.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common</architecture>
   <xi:include href="power-core.xml"/>
   <xi:include href="power-fpu.xml"/>
diff --git a/gdb/features/rs6000/powerpc-vsx64.xml b/gdb/features/rs6000/powerpc-vsx64.xml
index cf67b81615a..1fb744485b3 100644
--- a/gdb/features/rs6000/powerpc-vsx64.xml
+++ b/gdb/features/rs6000/powerpc-vsx64.xml
@@ -9,7 +9,7 @@
      view of the PowerPC.  Includes AltiVec and VSX vector registers.   -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common64</architecture>
   <xi:include href="power64-core.xml"/>
   <xi:include href="power-fpu.xml"/>
diff --git a/gdb/features/rs6000/powerpc-vsx64l.xml b/gdb/features/rs6000/powerpc-vsx64l.xml
index 606babc7b5b..38cf7393808 100644
--- a/gdb/features/rs6000/powerpc-vsx64l.xml
+++ b/gdb/features/rs6000/powerpc-vsx64l.xml
@@ -10,7 +10,7 @@
      and VSX vector registers.   -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>powerpc:common64</architecture>
   <xi:include href="power64-core.xml"/>
   <xi:include href="power-fpu.xml"/>
diff --git a/gdb/features/rs6000/rs6000.xml b/gdb/features/rs6000/rs6000.xml
index b8f27d2fead..3c0a299fe83 100644
--- a/gdb/features/rs6000/rs6000.xml
+++ b/gdb/features/rs6000/rs6000.xml
@@ -9,7 +9,7 @@
      user-level SPR's.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>rs6000:6000</architecture>
 
   <!-- This description is slightly different from the standard
diff --git a/gdb/features/rx.xml b/gdb/features/rx.xml
index a3c506188fa..d942198ec04 100644
--- a/gdb/features/rx.xml
+++ b/gdb/features/rx.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <feature name="org.gnu.gdb.rx.core">
     <reg name="r0" bitsize="32" type="data_ptr"/>
     <reg name="r1" bitsize="32" type="uint32"/>
diff --git a/gdb/features/s390-gs-linux64.xml b/gdb/features/s390-gs-linux64.xml
index ecdd3068741..c55de96e374 100644
--- a/gdb/features/s390-gs-linux64.xml
+++ b/gdb/features/s390-gs-linux64.xml
@@ -9,7 +9,7 @@
      in z/Architecture mode.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:31-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390-core64.xml"/>
diff --git a/gdb/features/s390-linux32.xml b/gdb/features/s390-linux32.xml
index cdbabf9dc6a..f375b47853b 100644
--- a/gdb/features/s390-linux32.xml
+++ b/gdb/features/s390-linux32.xml
@@ -9,7 +9,7 @@
      in ESA/390 architecture mode.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:31-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390-core32.xml"/>
diff --git a/gdb/features/s390-linux32v1.xml b/gdb/features/s390-linux32v1.xml
index bb138a5343d..149e6a6fb3c 100644
--- a/gdb/features/s390-linux32v1.xml
+++ b/gdb/features/s390-linux32v1.xml
@@ -9,7 +9,7 @@
      in ESA/390 architecture mode.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:31-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390-core32.xml"/>
diff --git a/gdb/features/s390-linux32v2.xml b/gdb/features/s390-linux32v2.xml
index 7db4efe66b8..c5da74ef096 100644
--- a/gdb/features/s390-linux32v2.xml
+++ b/gdb/features/s390-linux32v2.xml
@@ -9,7 +9,7 @@
      in ESA/390 architecture mode.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:31-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390-core32.xml"/>
diff --git a/gdb/features/s390-linux64.xml b/gdb/features/s390-linux64.xml
index 71d044899ad..f12cb60c5ef 100644
--- a/gdb/features/s390-linux64.xml
+++ b/gdb/features/s390-linux64.xml
@@ -9,7 +9,7 @@
      in z/Architecture mode.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:31-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390-core64.xml"/>
diff --git a/gdb/features/s390-linux64v1.xml b/gdb/features/s390-linux64v1.xml
index bb349663111..6d49c59fcb9 100644
--- a/gdb/features/s390-linux64v1.xml
+++ b/gdb/features/s390-linux64v1.xml
@@ -9,7 +9,7 @@
      in z/Architecture mode.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:31-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390-core64.xml"/>
diff --git a/gdb/features/s390-linux64v2.xml b/gdb/features/s390-linux64v2.xml
index b795b71d26f..1905e283e4f 100644
--- a/gdb/features/s390-linux64v2.xml
+++ b/gdb/features/s390-linux64v2.xml
@@ -9,7 +9,7 @@
      in z/Architecture mode.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:31-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390-core64.xml"/>
diff --git a/gdb/features/s390-te-linux64.xml b/gdb/features/s390-te-linux64.xml
index 564a6498167..8f591312f89 100644
--- a/gdb/features/s390-te-linux64.xml
+++ b/gdb/features/s390-te-linux64.xml
@@ -9,7 +9,7 @@
      in z/Architecture mode.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:31-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390-core64.xml"/>
diff --git a/gdb/features/s390-tevx-linux64.xml b/gdb/features/s390-tevx-linux64.xml
index aa3a69f02ae..9930f156f28 100644
--- a/gdb/features/s390-tevx-linux64.xml
+++ b/gdb/features/s390-tevx-linux64.xml
@@ -9,7 +9,7 @@
      in z/Architecture mode.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:31-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390-core64.xml"/>
diff --git a/gdb/features/s390-vx-linux64.xml b/gdb/features/s390-vx-linux64.xml
index 4771b680594..29278f8f213 100644
--- a/gdb/features/s390-vx-linux64.xml
+++ b/gdb/features/s390-vx-linux64.xml
@@ -9,7 +9,7 @@
      in z/Architecture mode.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:31-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390-core64.xml"/>
diff --git a/gdb/features/s390x-gs-linux64.xml b/gdb/features/s390x-gs-linux64.xml
index 99a1965e9b1..751f9d288c1 100644
--- a/gdb/features/s390x-gs-linux64.xml
+++ b/gdb/features/s390x-gs-linux64.xml
@@ -8,7 +8,7 @@
 <!-- S/390 64-bit user-level code.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:64-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390x-core64.xml"/>
diff --git a/gdb/features/s390x-linux64.xml b/gdb/features/s390x-linux64.xml
index 3a15c5a34c8..c30216680fe 100644
--- a/gdb/features/s390x-linux64.xml
+++ b/gdb/features/s390x-linux64.xml
@@ -8,7 +8,7 @@
 <!-- S/390 64-bit user-level code.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:64-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390x-core64.xml"/>
diff --git a/gdb/features/s390x-linux64v1.xml b/gdb/features/s390x-linux64v1.xml
index 01ec0c38722..65dc27a988d 100644
--- a/gdb/features/s390x-linux64v1.xml
+++ b/gdb/features/s390x-linux64v1.xml
@@ -8,7 +8,7 @@
 <!-- S/390 64-bit user-level code.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:64-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390x-core64.xml"/>
diff --git a/gdb/features/s390x-linux64v2.xml b/gdb/features/s390x-linux64v2.xml
index 57bbb08e6e0..cef73507800 100644
--- a/gdb/features/s390x-linux64v2.xml
+++ b/gdb/features/s390x-linux64v2.xml
@@ -8,7 +8,7 @@
 <!-- S/390 64-bit user-level code.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:64-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390x-core64.xml"/>
diff --git a/gdb/features/s390x-te-linux64.xml b/gdb/features/s390x-te-linux64.xml
index 28aa716f4e4..14066590672 100644
--- a/gdb/features/s390x-te-linux64.xml
+++ b/gdb/features/s390x-te-linux64.xml
@@ -8,7 +8,7 @@
 <!-- S/390 64-bit user-level code.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:64-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390x-core64.xml"/>
diff --git a/gdb/features/s390x-tevx-linux64.xml b/gdb/features/s390x-tevx-linux64.xml
index 376a512fb17..9eadc67fe18 100644
--- a/gdb/features/s390x-tevx-linux64.xml
+++ b/gdb/features/s390x-tevx-linux64.xml
@@ -8,7 +8,7 @@
 <!-- S/390 64-bit user-level code.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:64-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390x-core64.xml"/>
diff --git a/gdb/features/s390x-vx-linux64.xml b/gdb/features/s390x-vx-linux64.xml
index b8a162f6668..06e4e272b6a 100644
--- a/gdb/features/s390x-vx-linux64.xml
+++ b/gdb/features/s390x-vx-linux64.xml
@@ -8,7 +8,7 @@
 <!-- S/390 64-bit user-level code.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>s390:64-bit</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="s390x-core64.xml"/>
diff --git a/gdb/features/sparc/sparc32-solaris.xml b/gdb/features/sparc/sparc32-solaris.xml
index 02712d1fd6e..e5302f03320 100644
--- a/gdb/features/sparc/sparc32-solaris.xml
+++ b/gdb/features/sparc/sparc32-solaris.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>sparc</architecture>
   <osabi>Solaris</osabi>
   <xi:include href="sparc32-cpu.xml"/>
diff --git a/gdb/features/sparc/sparc64-solaris.xml b/gdb/features/sparc/sparc64-solaris.xml
index 8a31d465b2b..e41394855e9 100644
--- a/gdb/features/sparc/sparc64-solaris.xml
+++ b/gdb/features/sparc/sparc64-solaris.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>sparc:v9</architecture>
   <osabi>Solaris</osabi>
   <xi:include href="sparc64-cpu.xml"/>
diff --git a/gdb/features/tic6x-c62x-linux.xml b/gdb/features/tic6x-c62x-linux.xml
index 039c410f0a3..e77a8d10fd2 100644
--- a/gdb/features/tic6x-c62x-linux.xml
+++ b/gdb/features/tic6x-c62x-linux.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>tic6x</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="tic6x-core.xml"/>
diff --git a/gdb/features/tic6x-c64x-linux.xml b/gdb/features/tic6x-c64x-linux.xml
index 91fc619cf62..59c9fb5c4a5 100644
--- a/gdb/features/tic6x-c64x-linux.xml
+++ b/gdb/features/tic6x-c64x-linux.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>tic6x</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="tic6x-core.xml"/>
diff --git a/gdb/features/tic6x-c64xp-linux.xml b/gdb/features/tic6x-c64xp-linux.xml
index d6abc8645d3..b9f638c9452 100644
--- a/gdb/features/tic6x-c64xp-linux.xml
+++ b/gdb/features/tic6x-c64xp-linux.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>tic6x</architecture>
   <osabi>GNU/Linux</osabi>
   <xi:include href="tic6x-core.xml"/>
diff --git a/gdb/features/z80.xml b/gdb/features/z80.xml
index 85ef98803a1..0515c4a5749 100644
--- a/gdb/features/z80.xml
+++ b/gdb/features/z80.xml
@@ -6,7 +6,7 @@
      notice and this notice are preserved.  -->
 
 <!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <architecture>z80</architecture>
   <xi:include href="z80-cpu.xml"/>
 </target>
diff --git a/gdb/testsuite/gdb.xml/bad-include.xml b/gdb/testsuite/gdb.xml/bad-include.xml
index cd9cce39056..5660d5a8574 100644
--- a/gdb/testsuite/gdb.xml/bad-include.xml
+++ b/gdb/testsuite/gdb.xml/bad-include.xml
@@ -1 +1 @@
-<xi:include href="nonexistent.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="nonexistent.xml"/>
diff --git a/gdb/testsuite/gdb.xml/core-only.xml b/gdb/testsuite/gdb.xml/core-only.xml
index f2ddcd5e671..253bc493194 100644
--- a/gdb/testsuite/gdb.xml/core-only.xml
+++ b/gdb/testsuite/gdb.xml/core-only.xml
@@ -1,3 +1,3 @@
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="core-regs.xml"/>
 </target>
diff --git a/gdb/testsuite/gdb.xml/extra-regs.xml b/gdb/testsuite/gdb.xml/extra-regs.xml
index 302e64ce7db..1b818635623 100644
--- a/gdb/testsuite/gdb.xml/extra-regs.xml
+++ b/gdb/testsuite/gdb.xml/extra-regs.xml
@@ -1,4 +1,4 @@
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="core-regs.xml"/>
   <feature name="extra">
     <vector id="v4int8" type="int8" count="4"/>
diff --git a/gdb/testsuite/gdb.xml/inc-2.xml b/gdb/testsuite/gdb.xml/inc-2.xml
index b076814d148..18886fef7d8 100644
--- a/gdb/testsuite/gdb.xml/inc-2.xml
+++ b/gdb/testsuite/gdb.xml/inc-2.xml
@@ -1 +1 @@
-<xi:include href="inc-body.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="inc-body.xml"/>
diff --git a/gdb/testsuite/gdb.xml/includes.xml b/gdb/testsuite/gdb.xml/includes.xml
index 3a6a243ae06..7e9a158968d 100644
--- a/gdb/testsuite/gdb.xml/includes.xml
+++ b/gdb/testsuite/gdb.xml/includes.xml
@@ -1,3 +1,3 @@
-<target>
+<target xmlns:xi="http://www.w3.org/2001/XInclude">
   <xi:include href="inc-2.xml"/>
 </target>
diff --git a/gdb/testsuite/gdb.xml/loop.xml b/gdb/testsuite/gdb.xml/loop.xml
index edd6d203337..ec4f4bcfd56 100644
--- a/gdb/testsuite/gdb.xml/loop.xml
+++ b/gdb/testsuite/gdb.xml/loop.xml
@@ -1 +1 @@
-<xi:include href="loop.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="loop.xml"/>
-- 
2.51.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 3/5] [gdb] Fix target element validity error in features/gdb-target.dtd
  2026-08-26 21:22 [PATCH v2 0/5] [gdb] xml linting Tom de Vries
  2026-08-26 21:22 ` [PATCH v2 1/5] [pre-commit] Check xml files Tom de Vries
  2026-08-26 21:22 ` [PATCH v2 2/5] [gdb] Fix xmllint namespace errors Tom de Vries
@ 2026-08-26 21:22 ` Tom de Vries
  2026-08-26 21:22 ` [PATCH v2 4/5] [gdb] Fix syscalls-info -> syscalls_info in syscalls/gdb-syscalls.dtd Tom de Vries
  2026-08-26 21:22 ` [PATCH v2 5/5] [pre-commit] Use --valid with xmllint Tom de Vries
  4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2026-08-26 21:22 UTC (permalink / raw)
  To: gdb-patches

When running xmllint with --valid, I got:
...
gdb/features/rs6000/powerpc-405.xml:9: element target: validity error : \
  No declaration for attribute xmlns:xi of element target
<target xmlns:xi="http://www.w3.org/2001/XInclude">
                                                  ^
...

Fix this by updating features/gdb-target.dtd.

Note that this is not a regression since "Fix xmllint namespace errors".

Before that patch, we have a slightly different error:
...
gdb/features/rs6000/powerpc-405.xml:58: element target: validity error : \
  Element target content does not follow the DTD, \
  expecting (architecture? , osabi? , compatible* , feature*), \
  got (xi:include xi:include feature )
</target>
...

This patch fixes both variants.
---
 gdb/features/gdb-target.dtd | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/features/gdb-target.dtd b/gdb/features/gdb-target.dtd
index 2c405af8add..d1efbad16a5 100644
--- a/gdb/features/gdb-target.dtd
+++ b/gdb/features/gdb-target.dtd
@@ -9,10 +9,10 @@
 <!-- The osabi and compatible elements were added post GDB 6.8.  The version
      wasn't bumped, since older GDBs silently ignore unknown elements.  -->
 
-<!ELEMENT target	(architecture?, osabi?, compatible*, feature*)>
+<!ELEMENT target	(architecture?, osabi?, compatible*, xi:include*, feature*)>
 <!ATTLIST target
-	version		CDATA	#FIXED "1.0">
-
+	version		CDATA	#FIXED "1.0"
+	xmlns:xi	CDATA   #FIXED "http://www.w3.org/2001/XInclude">
 <!ELEMENT architecture	(#PCDATA)>
 
 <!ELEMENT osabi	(#PCDATA)>
-- 
2.51.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 4/5] [gdb] Fix syscalls-info -> syscalls_info in syscalls/gdb-syscalls.dtd
  2026-08-26 21:22 [PATCH v2 0/5] [gdb] xml linting Tom de Vries
                   ` (2 preceding siblings ...)
  2026-08-26 21:22 ` [PATCH v2 3/5] [gdb] Fix target element validity error in features/gdb-target.dtd Tom de Vries
@ 2026-08-26 21:22 ` Tom de Vries
  2026-08-26 21:22 ` [PATCH v2 5/5] [pre-commit] Use --valid with xmllint Tom de Vries
  4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2026-08-26 21:22 UTC (permalink / raw)
  To: gdb-patches

When running xmllint with --valid, we get:
...
gdb/syscalls/ppc64-linux.xml:433: element syscalls_info: validity error : \
  No declaration for element syscalls_info
</syscalls_info>
                ^
...

Fix this by changing syscalls-info to syscalls_info in syscalls/gdb-syscalls.dtd.
---
 gdb/syscalls/gdb-syscalls.dtd | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/syscalls/gdb-syscalls.dtd b/gdb/syscalls/gdb-syscalls.dtd
index 09dff02910f..35a676fa585 100644
--- a/gdb/syscalls/gdb-syscalls.dtd
+++ b/gdb/syscalls/gdb-syscalls.dtd
@@ -4,9 +4,9 @@
      are permitted in any medium without royalty provided the copyright
      notice and this notice are preserved.  -->
 
-<!-- The root element of a syscall info is <syscalls-info>.  -->
+<!-- The root element of a syscall info is <syscalls_info>.  -->
 
-<!ELEMENT syscalls-info		(syscall*)>
+<!ELEMENT syscalls_info		(syscall*)>
 
 <!ELEMENT syscall		EMPTY>
 <!ATTLIST syscall
-- 
2.51.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 5/5] [pre-commit] Use --valid with xmllint
  2026-08-26 21:22 [PATCH v2 0/5] [gdb] xml linting Tom de Vries
                   ` (3 preceding siblings ...)
  2026-08-26 21:22 ` [PATCH v2 4/5] [gdb] Fix syscalls-info -> syscalls_info in syscalls/gdb-syscalls.dtd Tom de Vries
@ 2026-08-26 21:22 ` Tom de Vries
  4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2026-08-26 21:22 UTC (permalink / raw)
  To: gdb-patches

Use --valid with xmllint, but only for files that are currently clean.
---
 gdb/contrib/xmllint.sh | 69 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 67 insertions(+), 2 deletions(-)

diff --git a/gdb/contrib/xmllint.sh b/gdb/contrib/xmllint.sh
index 748e096bbef..76e6d3a033e 100755
--- a/gdb/contrib/xmllint.sh
+++ b/gdb/contrib/xmllint.sh
@@ -32,6 +32,7 @@ tmp=$(mktemp)
 
 check_basic=""
 check_includes=""
+check_valid=""
 for f in "$@"; do
     case $f in
         gdb/testsuite/gdb.xml/tdesc-bogus.xml)
@@ -48,9 +49,63 @@ for f in "$@"; do
             # - gdb.xml/loop.xml (XInclude error: loop.xml)
 	    check_basic="$check_basic $f"
 	    ;;
-	*)
+	gdb/features/aarch64-core.xml \
+	    | gdb/features/aarch64-fpmr.xml \
+	    | gdb/features/aarch64-fpu.xml \
+	    | gdb/features/alpha-core.xml \
+	    | gdb/features/alpha.xml \
+	    | gdb/features/arc/v1-aux.xml \
+	    | gdb/features/arc/v1-core.xml \
+	    | gdb/features/arc/v2-aux.xml \
+	    | gdb/features/arc/v2-core.xml \
+	    | gdb/features/cskyv2-linux.xml \
+	    | gdb/features/i386/32bit-linux.xml \
+	    | gdb/features/i386/64bit-avx512.xml \
+	    | gdb/features/or1k-core.xml \
+	    | gdb/features/or1k-linux.xml \
+	    | gdb/features/or1k.xml \
+	    | gdb/features/rs6000/powerpc-403gc.xml \
+	    | gdb/features/rs6000/powerpc-403.xml \
+	    | gdb/features/rs6000/powerpc-405.xml \
+	    | gdb/features/rs6000/powerpc-505.xml \
+	    | gdb/features/rs6000/powerpc-601.xml \
+	    | gdb/features/rs6000/powerpc-602.xml \
+	    | gdb/features/rs6000/powerpc-603.xml \
+	    | gdb/features/rs6000/powerpc-604.xml \
+	    | gdb/features/rs6000/powerpc-750.xml \
+	    | gdb/features/rs6000/powerpc-860.xml \
+	    | gdb/features/rx.xml \
+	    | gdb/features/s390-gs-linux64.xml \
+	    | gdb/features/s390-te-linux64.xml \
+	    | gdb/features/s390-tevx-linux64.xml \
+	    | gdb/features/s390-vx-linux64.xml \
+	    | gdb/features/s390x-gs-linux64.xml \
+	    | gdb/features/s390x-te-linux64.xml \
+	    | gdb/features/s390x-tevx-linux64.xml \
+	    | gdb/features/s390x-vx-linux64.xml \
+	    | gdb/syscalls/freebsd.xml \
+	    | gdb/syscalls/netbsd.xml \
+	    | gdb/testsuite/gdb.xml/inc-2.xml \
+	    | gdb/testsuite/gdb.xml/inc-body.xml \
+	    | gdb/testsuite/gdb.xml/includes.xml \
+	    | gdb/testsuite/gdb.xml/maint_print_struct.xml \
+	    | gdb/testsuite/gdb.xml/maint-xml-dump-02.xml \
+	    | gdb/testsuite/gdb.xml/maint-xml-dump-03.xml \
+	    | gdb/testsuite/gdb.xml/single-reg.xml \
+	    | gdb/testsuite/gdb.xml/tdesc-unknown.xml \
+	    | gdb/testsuite/gdb.xml/trivial.xml \
+	    | gdb/syscalls/apply-defaults.xsl \
+	    | gdb/features/print-osabi.xsl \
+	    | gdb/features/number-regs.xsl \
+	    | gdb/features/gdbserver-regs.xsl \
+	    | gdb/features/sort-regs.xsl \
+	    | gdb/doc/stack_frame.svg)
+	    # Files that are not clean with --valid.
 	    check_includes="$check_includes $f"
 	    ;;
+	*)
+	    check_valid="$check_valid $f"
+	    ;;
     esac
 done
 
@@ -71,7 +126,17 @@ if [ "$check_includes" != "" ]; then
 	    2>&1; st2=$?
 fi
 
-if [ $st1 -eq 0 ] && [ $st2 -eq 0 ]; then
+st3=0
+if [ "$check_valid" != "" ]; then
+    # Provide the --path parts to let xmllint find the .dtd files.
+    xmllint --noout --xinclude --path gdb/syscalls --path gdb/features \
+	    --valid \
+	    $check_valid \
+	    >> "$tmp" \
+	    2>&1; st3=$?
+fi
+
+if [ $st1 -eq 0 ] && [ $st2 -eq 0 ] && [ $st3 -eq 0 ]; then
     st=0
 else
     st=1
-- 
2.51.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-08-26 21:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-26 21:22 [PATCH v2 0/5] [gdb] xml linting Tom de Vries
2026-08-26 21:22 ` [PATCH v2 1/5] [pre-commit] Check xml files Tom de Vries
2026-08-26 21:22 ` [PATCH v2 2/5] [gdb] Fix xmllint namespace errors Tom de Vries
2026-08-26 21:22 ` [PATCH v2 3/5] [gdb] Fix target element validity error in features/gdb-target.dtd Tom de Vries
2026-08-26 21:22 ` [PATCH v2 4/5] [gdb] Fix syscalls-info -> syscalls_info in syscalls/gdb-syscalls.dtd Tom de Vries
2026-08-26 21:22 ` [PATCH v2 5/5] [pre-commit] Use --valid with xmllint Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox