Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH v2 5/5] [pre-commit] Use --valid with xmllint
Date: Wed, 26 Aug 2026 23:22:09 +0200	[thread overview]
Message-ID: <20260826212209.925066-6-tdevries@suse.de> (raw)
In-Reply-To: <20260826212209.925066-1-tdevries@suse.de>

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


      parent reply	other threads:[~2026-08-26 21:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Tom de Vries [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260826212209.925066-6-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox