Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/9] [gdb] More whitespace fixes
@ 2026-06-18 13:38 Tom de Vries
  2026-06-18 13:38 ` [PATCH 1/9] [gdb] Increase clean range in check-whitespace-pre-commit.py Tom de Vries
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Tom de Vries @ 2026-06-18 13:38 UTC (permalink / raw)
  To: gdb-patches

I came across the trailing-whitespace hook here (
https://github.com/pre-commit/pre-commit-hooks ) and tried it out:
...
  # Out-of-the-box pre-commit hooks.
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v6.0.0
    hooks:
    - id: trailing-whitespace
      files: '^(gdb|gdbserver|gdbsupport)/.*$'
      exclude: 'ChangeLog'
      args: [--chars," \t"]
...

The args field is necessary to stop it removing ^L.

The result is:
...
$ pre-commit run trailing-whitespace --all-files
trim trailing whitespace................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing gdbsupport/Makefile.in
Fixing gdb/config/djgpp/fnchange.lst
Fixing gdb/doc/annotate.texinfo
Fixing gdb/doc/stack_frame.txt
Fixing gdb/exc_request.defs
Fixing gdb/doc/refcard.tex
Fixing gdb/gdb-gdb.gdb.in
Fixing gdb/configure.tgt
...

This made me look again at our homegrown whitespace check, and I found that it
recognizes a set of clean files that doesn't include the above files.

This patch series:
- in check-whitespace-pre-commit.py, adds a todo list of files which are not
  yet clean, enabling complete checking for all other files, and
- reduces the todo list with each following patch.

Tom de Vries (9):
  [gdb] Increase clean range in check-whitespace-pre-commit.py
  [gdb] Fix leftover conflict marker in gdb/config/djgpp/README
  [gdb] Fix new blank line at EOF in a few scripts
  [gdb] Fix new blank line at EOF in a few xml files
  [gdb] Ignore whitespace in imported file gdb/exc_request.defs
  [gdb] Fix trailing whitespace in some files
  [gdb] Ignore trailing whitespace in gdb/gdb-gdb.gdb.in
  [gdb] Fix trailing whitespace in annotate.texinfo
  [gdb] Fix trailing whitespace in refcard.tex

 .pre-commit-config.yaml                    |  1 +
 gdb/.gitattributes                         |  6 +++++
 gdb/config/djgpp/.gitattributes            |  3 +++
 gdb/config/djgpp/djcheck.sh                |  1 -
 gdb/config/djgpp/fnchange.lst              |  2 +-
 gdb/configure.tgt                          |  6 ++---
 gdb/contrib/ari/create-web-ari-in-src.sh   |  1 -
 gdb/contrib/ari/gdb_ari.sh                 |  1 -
 gdb/contrib/check-whitespace-pre-commit.py | 13 +++++++----
 gdb/doc/annotate.texinfo                   |  8 +++----
 gdb/doc/refcard.tex                        | 26 +++++++++++-----------
 gdb/doc/stack_frame.txt                    |  2 +-
 gdb/features/aarch64-pauth.xml             |  1 -
 gdb/features/library-list-aix.dtd          |  1 -
 gdb/features/s390-core64.xml               |  1 -
 gdb/features/sparc/sparc32-cp0.xml         |  1 -
 gdb/features/sparc/sparc32-fpu.xml         |  1 -
 gdb/features/sparc/sparc64-cp0.xml         |  1 -
 gdb/features/sparc/sparc64-fpu.xml         |  1 -
 19 files changed, 41 insertions(+), 36 deletions(-)
 create mode 100644 gdb/config/djgpp/.gitattributes


base-commit: 478b1846cdb82b776c8dcbec20ecd198297cd8ff
-- 
2.51.0


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

* [PATCH 1/9] [gdb] Increase clean range in check-whitespace-pre-commit.py
  2026-06-18 13:38 [PATCH 0/9] [gdb] More whitespace fixes Tom de Vries
@ 2026-06-18 13:38 ` Tom de Vries
  2026-06-18 13:38 ` [PATCH 2/9] [gdb] Fix leftover conflict marker in gdb/config/djgpp/README Tom de Vries
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Tom de Vries @ 2026-06-18 13:38 UTC (permalink / raw)
  To: gdb-patches

The list of files completely checked by check-whitespace-pre-commit.py is
determined by this regexp:
...
re_clean = re.compile(
    "(^(gdb/testsuite/|gdbsupport/|gdbserver/)|[.](m4|ac|def|[chly])$|NEWS)"
)
...

Turn this around, and add a todo list of files not completely whitespace clean
yet, enabling complete checking for all other files.
---
 .pre-commit-config.yaml                    |  1 +
 gdb/contrib/check-whitespace-pre-commit.py | 32 +++++++++++++++++++---
 2 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 141451501ed..9910bbb82f2 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -117,6 +117,7 @@ repos:
       language: unsupported_script
       entry: gdb/contrib/check-whitespace-pre-commit.py
       files: '^(gdb(support|server)?)/.*$'
+      types: ['text']
     - id: &id3 pre-commit-setup
       name: *id3
       language: python
diff --git a/gdb/contrib/check-whitespace-pre-commit.py b/gdb/contrib/check-whitespace-pre-commit.py
index 128727d2ca6..fb4e4b8f537 100755
--- a/gdb/contrib/check-whitespace-pre-commit.py
+++ b/gdb/contrib/check-whitespace-pre-commit.py
@@ -18,15 +18,39 @@ import re
 import subprocess
 import sys
 
-re_clean = re.compile(
-    "(^(gdb/testsuite/|gdbsupport/|gdbserver/)|[.](m4|ac|def|[chly])$|NEWS)"
-)
+# Files to completely ignore.
+re_ignore = re.compile("ChangeLog")
+
+# Files that are not clean, so they're only checked when changes.
+todo_list = [
+    "gdb/config/djgpp/fnchange.lst",
+    "gdb/contrib/ari/create-web-ari-in-src.sh",
+    "gdb/gdb-gdb.gdb.in",
+    "gdb/config/djgpp/djcheck.sh",
+    "gdb/contrib/ari/gdb_ari.sh",
+    "gdb/features/sparc/sparc64-cp0.xml",
+    "gdb/features/sparc/sparc64-fpu.xml",
+    "gdb/configure.tgt",
+    "gdb/doc/annotate.texinfo",
+    "gdb/features/aarch64-pauth.xml",
+    "gdb/features/sparc/sparc32-fpu.xml",
+    "gdb/features/s390-core64.xml",
+    "gdb/features/sparc/sparc32-cp0.xml",
+    "gdb/config/djgpp/README",
+    "gdb/exc_request.defs",
+    "gdb/doc/refcard.tex",
+    "gdb/doc/stack_frame.txt",
+    "gdb/features/library-list-aix.dtd",
+]
 
 clean = []
 other = []
 for f in sys.argv[1:]:
-    m = re_clean.search(f)
+    m = re_ignore.search(f)
     if m:
+        continue
+
+    if f not in todo_list:
         clean.append(f)
     else:
         other.append(f)
-- 
2.51.0


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

* [PATCH 2/9] [gdb] Fix leftover conflict marker in gdb/config/djgpp/README
  2026-06-18 13:38 [PATCH 0/9] [gdb] More whitespace fixes Tom de Vries
  2026-06-18 13:38 ` [PATCH 1/9] [gdb] Increase clean range in check-whitespace-pre-commit.py Tom de Vries
@ 2026-06-18 13:38 ` Tom de Vries
  2026-06-18 13:38 ` [PATCH 3/9] [gdb] Fix new blank line at EOF in a few scripts Tom de Vries
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Tom de Vries @ 2026-06-18 13:38 UTC (permalink / raw)
  To: gdb-patches

For gdb/config/djgpp/README, we have:
...
gdb/config/djgpp/README:6: leftover conflict marker
...

This is a false positive, this is just some text formatting using '=':
...
General
=======
...
whose length happens to match the default value of git attribute
conflict-marker-size: 7.

Fix this by setting the conflict-marker-size to 80.
---
 gdb/config/djgpp/.gitattributes            | 3 +++
 gdb/contrib/check-whitespace-pre-commit.py | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 100644 gdb/config/djgpp/.gitattributes

diff --git a/gdb/config/djgpp/.gitattributes b/gdb/config/djgpp/.gitattributes
new file mode 100644
index 00000000000..807fd6d5c56
--- /dev/null
+++ b/gdb/config/djgpp/.gitattributes
@@ -0,0 +1,3 @@
+# -*- conf -*-
+
+README	conflict-marker-size=80
diff --git a/gdb/contrib/check-whitespace-pre-commit.py b/gdb/contrib/check-whitespace-pre-commit.py
index fb4e4b8f537..fbcc1a1ac45 100755
--- a/gdb/contrib/check-whitespace-pre-commit.py
+++ b/gdb/contrib/check-whitespace-pre-commit.py
@@ -36,7 +36,6 @@ todo_list = [
     "gdb/features/sparc/sparc32-fpu.xml",
     "gdb/features/s390-core64.xml",
     "gdb/features/sparc/sparc32-cp0.xml",
-    "gdb/config/djgpp/README",
     "gdb/exc_request.defs",
     "gdb/doc/refcard.tex",
     "gdb/doc/stack_frame.txt",
-- 
2.51.0


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

* [PATCH 3/9] [gdb] Fix new blank line at EOF in a few scripts
  2026-06-18 13:38 [PATCH 0/9] [gdb] More whitespace fixes Tom de Vries
  2026-06-18 13:38 ` [PATCH 1/9] [gdb] Increase clean range in check-whitespace-pre-commit.py Tom de Vries
  2026-06-18 13:38 ` [PATCH 2/9] [gdb] Fix leftover conflict marker in gdb/config/djgpp/README Tom de Vries
@ 2026-06-18 13:38 ` Tom de Vries
  2026-06-18 13:38 ` [PATCH 4/9] [gdb] Fix new blank line at EOF in a few xml files Tom de Vries
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Tom de Vries @ 2026-06-18 13:38 UTC (permalink / raw)
  To: gdb-patches

Fix this:
...
gdb/contrib/ari/gdb_ari.sh:1216: new blank line at EOF.
gdb/contrib/ari/create-web-ari-in-src.sh:82: new blank line at EOF.
gdb/config/djgpp/djcheck.sh:48: new blank line at EOF.
...
---
 gdb/config/djgpp/djcheck.sh                | 1 -
 gdb/contrib/ari/create-web-ari-in-src.sh   | 1 -
 gdb/contrib/ari/gdb_ari.sh                 | 1 -
 gdb/contrib/check-whitespace-pre-commit.py | 3 ---
 4 files changed, 6 deletions(-)

diff --git a/gdb/config/djgpp/djcheck.sh b/gdb/config/djgpp/djcheck.sh
index c19550e5f9d..fa75d03f776 100644
--- a/gdb/config/djgpp/djcheck.sh
+++ b/gdb/config/djgpp/djcheck.sh
@@ -45,4 +45,3 @@ do
     fi
   done
 done
-
diff --git a/gdb/contrib/ari/create-web-ari-in-src.sh b/gdb/contrib/ari/create-web-ari-in-src.sh
index e8ba13ef540..e326905efef 100644
--- a/gdb/contrib/ari/create-web-ari-in-src.sh
+++ b/gdb/contrib/ari/create-web-ari-in-src.sh
@@ -79,4 +79,3 @@ if [ -f "${webdir}/index.html" ] ; then
 else
   echo "ARI script failed to generate file \"${webdir}/index.html\""
 fi
-
diff --git a/gdb/contrib/ari/gdb_ari.sh b/gdb/contrib/ari/gdb_ari.sh
index 41bfae4db80..c1687c73885 100755
--- a/gdb/contrib/ari/gdb_ari.sh
+++ b/gdb/contrib/ari/gdb_ari.sh
@@ -1213,4 +1213,3 @@ BEGIN {
 	exit
     }
 }' "$@"
-
diff --git a/gdb/contrib/check-whitespace-pre-commit.py b/gdb/contrib/check-whitespace-pre-commit.py
index fbcc1a1ac45..f39e9477410 100755
--- a/gdb/contrib/check-whitespace-pre-commit.py
+++ b/gdb/contrib/check-whitespace-pre-commit.py
@@ -24,10 +24,7 @@ re_ignore = re.compile("ChangeLog")
 # Files that are not clean, so they're only checked when changes.
 todo_list = [
     "gdb/config/djgpp/fnchange.lst",
-    "gdb/contrib/ari/create-web-ari-in-src.sh",
     "gdb/gdb-gdb.gdb.in",
-    "gdb/config/djgpp/djcheck.sh",
-    "gdb/contrib/ari/gdb_ari.sh",
     "gdb/features/sparc/sparc64-cp0.xml",
     "gdb/features/sparc/sparc64-fpu.xml",
     "gdb/configure.tgt",
-- 
2.51.0


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

* [PATCH 4/9] [gdb] Fix new blank line at EOF in a few xml files
  2026-06-18 13:38 [PATCH 0/9] [gdb] More whitespace fixes Tom de Vries
                   ` (2 preceding siblings ...)
  2026-06-18 13:38 ` [PATCH 3/9] [gdb] Fix new blank line at EOF in a few scripts Tom de Vries
@ 2026-06-18 13:38 ` Tom de Vries
  2026-06-18 13:38 ` [PATCH 5/9] [gdb] Ignore whitespace in imported file gdb/exc_request.defs Tom de Vries
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Tom de Vries @ 2026-06-18 13:38 UTC (permalink / raw)
  To: gdb-patches

Fix this:
...
gdb/features/sparc/sparc32-cp0.xml:19: new blank line at EOF.
gdb/features/sparc/sparc64-cp0.xml:17: new blank line at EOF.
gdb/features/sparc/sparc64-fpu.xml:60: new blank line at EOF.
gdb/features/s390-core64.xml:45: new blank line at EOF.
gdb/features/sparc/sparc32-fpu.xml:43: new blank line at EOF.
gdb/features/aarch64-pauth.xml:13: new blank line at EOF.
gdb/features/library-list-aix.dtd:18: new blank line at EOF.
...

I re-ran "make clean-cfiles cfiles" in gdb/features, no changes.
---
 gdb/contrib/check-whitespace-pre-commit.py | 7 -------
 gdb/features/aarch64-pauth.xml             | 1 -
 gdb/features/library-list-aix.dtd          | 1 -
 gdb/features/s390-core64.xml               | 1 -
 gdb/features/sparc/sparc32-cp0.xml         | 1 -
 gdb/features/sparc/sparc32-fpu.xml         | 1 -
 gdb/features/sparc/sparc64-cp0.xml         | 1 -
 gdb/features/sparc/sparc64-fpu.xml         | 1 -
 8 files changed, 14 deletions(-)

diff --git a/gdb/contrib/check-whitespace-pre-commit.py b/gdb/contrib/check-whitespace-pre-commit.py
index f39e9477410..0fd7bcc3068 100755
--- a/gdb/contrib/check-whitespace-pre-commit.py
+++ b/gdb/contrib/check-whitespace-pre-commit.py
@@ -25,18 +25,11 @@ re_ignore = re.compile("ChangeLog")
 todo_list = [
     "gdb/config/djgpp/fnchange.lst",
     "gdb/gdb-gdb.gdb.in",
-    "gdb/features/sparc/sparc64-cp0.xml",
-    "gdb/features/sparc/sparc64-fpu.xml",
     "gdb/configure.tgt",
     "gdb/doc/annotate.texinfo",
-    "gdb/features/aarch64-pauth.xml",
-    "gdb/features/sparc/sparc32-fpu.xml",
-    "gdb/features/s390-core64.xml",
-    "gdb/features/sparc/sparc32-cp0.xml",
     "gdb/exc_request.defs",
     "gdb/doc/refcard.tex",
     "gdb/doc/stack_frame.txt",
-    "gdb/features/library-list-aix.dtd",
 ]
 
 clean = []
diff --git a/gdb/features/aarch64-pauth.xml b/gdb/features/aarch64-pauth.xml
index 19e014521f5..7e93c7f519f 100644
--- a/gdb/features/aarch64-pauth.xml
+++ b/gdb/features/aarch64-pauth.xml
@@ -10,4 +10,3 @@
   <reg name="pauth_dmask" bitsize="64"/>
   <reg name="pauth_cmask" bitsize="64"/>
 </feature>
-
diff --git a/gdb/features/library-list-aix.dtd b/gdb/features/library-list-aix.dtd
index 6ad67d66329..69181915a2a 100644
--- a/gdb/features/library-list-aix.dtd
+++ b/gdb/features/library-list-aix.dtd
@@ -15,4 +15,3 @@
 <!ATTLIST library  text_size  CDATA   #REQUIRED>
 <!ATTLIST library  data_addr  CDATA   #REQUIRED>
 <!ATTLIST library  data_size  CDATA   #REQUIRED>
-
diff --git a/gdb/features/s390-core64.xml b/gdb/features/s390-core64.xml
index 76bc52045cc..d81e4456408 100644
--- a/gdb/features/s390-core64.xml
+++ b/gdb/features/s390-core64.xml
@@ -42,4 +42,3 @@
   <reg name="r15h" bitsize="32" type="uint32" group="upper"/>
   <reg name="r15l" bitsize="32" type="uint32" group="lower"/>
 </feature>
-
diff --git a/gdb/features/sparc/sparc32-cp0.xml b/gdb/features/sparc/sparc32-cp0.xml
index 2b029200a86..eacd89cf3b5 100644
--- a/gdb/features/sparc/sparc32-cp0.xml
+++ b/gdb/features/sparc/sparc32-cp0.xml
@@ -16,4 +16,3 @@
   <reg name="fsr" bitsize="32" type="uint32" regnum="70"/>
   <reg name="csr" bitsize="32" type="uint32" regnum="71"/>
 </feature>
-
diff --git a/gdb/features/sparc/sparc32-fpu.xml b/gdb/features/sparc/sparc32-fpu.xml
index fb37322c13d..38217ca7a92 100644
--- a/gdb/features/sparc/sparc32-fpu.xml
+++ b/gdb/features/sparc/sparc32-fpu.xml
@@ -40,4 +40,3 @@
   <reg name="f30" bitsize="32" type="ieee_single" regnum="62"/>
   <reg name="f31" bitsize="32" type="ieee_single" regnum="63"/>
 </feature>
-
diff --git a/gdb/features/sparc/sparc64-cp0.xml b/gdb/features/sparc/sparc64-cp0.xml
index 8d1461ab099..9b938dc7ecc 100644
--- a/gdb/features/sparc/sparc64-cp0.xml
+++ b/gdb/features/sparc/sparc64-cp0.xml
@@ -14,4 +14,3 @@
   <reg name="fprs" bitsize="64" type="uint64" regnum="84"/>
   <reg name="y" bitsize="64" type="uint64" regnum="85"/>
 </feature>
-
diff --git a/gdb/features/sparc/sparc64-fpu.xml b/gdb/features/sparc/sparc64-fpu.xml
index 839468623a5..d7151b34c7f 100644
--- a/gdb/features/sparc/sparc64-fpu.xml
+++ b/gdb/features/sparc/sparc64-fpu.xml
@@ -57,4 +57,3 @@
   <reg name="f60" bitsize="64" type="ieee_double" regnum="78"/>
   <reg name="f62" bitsize="64" type="ieee_double" regnum="79"/>
 </feature>
-
-- 
2.51.0


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

* [PATCH 5/9] [gdb] Ignore whitespace in imported file gdb/exc_request.defs
  2026-06-18 13:38 [PATCH 0/9] [gdb] More whitespace fixes Tom de Vries
                   ` (3 preceding siblings ...)
  2026-06-18 13:38 ` [PATCH 4/9] [gdb] Fix new blank line at EOF in a few xml files Tom de Vries
@ 2026-06-18 13:38 ` Tom de Vries
  2026-06-18 13:38 ` [PATCH 6/9] [gdb] Fix trailing whitespace in some files Tom de Vries
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Tom de Vries @ 2026-06-18 13:38 UTC (permalink / raw)
  To: gdb-patches

The file gdb/exc_request.defs is imported.

Use .gitattributes to ignore whitespace in this file.
---
 gdb/.gitattributes                         | 3 +++
 gdb/contrib/check-whitespace-pre-commit.py | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdb/.gitattributes b/gdb/.gitattributes
index a3f15e96349..fa3e5af7af8 100644
--- a/gdb/.gitattributes
+++ b/gdb/.gitattributes
@@ -20,3 +20,6 @@ aclocal.m4  -whitespace
 
 *.[ly]	whitespace=space-before-tab,indent-with-non-tab,trailing-space
 *.def	whitespace=space-before-tab,indent-with-non-tab,trailing-space
+
+# Imported files.
+exc_request.defs -whitespace
diff --git a/gdb/contrib/check-whitespace-pre-commit.py b/gdb/contrib/check-whitespace-pre-commit.py
index 0fd7bcc3068..b79e158fecc 100755
--- a/gdb/contrib/check-whitespace-pre-commit.py
+++ b/gdb/contrib/check-whitespace-pre-commit.py
@@ -27,7 +27,6 @@ todo_list = [
     "gdb/gdb-gdb.gdb.in",
     "gdb/configure.tgt",
     "gdb/doc/annotate.texinfo",
-    "gdb/exc_request.defs",
     "gdb/doc/refcard.tex",
     "gdb/doc/stack_frame.txt",
 ]
-- 
2.51.0


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

* [PATCH 6/9] [gdb] Fix trailing whitespace in some files
  2026-06-18 13:38 [PATCH 0/9] [gdb] More whitespace fixes Tom de Vries
                   ` (4 preceding siblings ...)
  2026-06-18 13:38 ` [PATCH 5/9] [gdb] Ignore whitespace in imported file gdb/exc_request.defs Tom de Vries
@ 2026-06-18 13:38 ` Tom de Vries
  2026-06-18 13:38 ` [PATCH 7/9] [gdb] Ignore trailing whitespace in gdb/gdb-gdb.gdb.in Tom de Vries
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Tom de Vries @ 2026-06-18 13:38 UTC (permalink / raw)
  To: gdb-patches

Fix this:
...
gdb/configure.tgt:369: trailing whitespace.
+lm32-*-*)
gdb/configure.tgt:370: trailing whitespace.
+	gdb_target_obs="lm32-tdep.o"
gdb/configure.tgt:674: trailing whitespace.
+	# Target: TI C6X
gdb/config/djgpp/fnchange.lst:247: trailing whitespace.
+@V@/gdb/features/tic6x-core.xml @V@/gdb/features/c6x-core.xml
gdb/doc/stack_frame.txt:36: trailing whitespace.
+               |         |  Red Zone  |                      v
...
---
 gdb/config/djgpp/fnchange.lst              | 2 +-
 gdb/configure.tgt                          | 6 +++---
 gdb/contrib/check-whitespace-pre-commit.py | 3 ---
 gdb/doc/stack_frame.txt                    | 2 +-
 4 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/gdb/config/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst
index be10b57faab..85ce1dc4088 100644
--- a/gdb/config/djgpp/fnchange.lst
+++ b/gdb/config/djgpp/fnchange.lst
@@ -244,7 +244,7 @@
 @V@/gdb/features/i386/i386-mmx.c @V@/gdb/features/i386/i32-m.c
 @V@/gdb/features/i386/i386-mmx-linux.xml @V@/gdb/features/i386/i32-ml.xml
 @V@/gdb/features/i386/i386-mmx.xml @V@/gdb/features/i386/i32-m.xml
-@V@/gdb/features/tic6x-core.xml @V@/gdb/features/c6x-core.xml 
+@V@/gdb/features/tic6x-core.xml @V@/gdb/features/c6x-core.xml
 @V@/gdb/features/tic6x-gp.xml @V@/gdb/features/c6x-gp.xml
 @V@/gdb/features/tic6x-c6xp.xml @V@/gdb/features/c6x-c6xp.xml
 @V@/gdb/features/tic6x-c62x.xml @V@/gdb/features/c6x-62x.xml
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index 21fc9d95978..362de60065c 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -366,8 +366,8 @@ iq2000-*-*)
 	gdb_target_obs="iq2000-tdep.o"
 	;;
 
-lm32-*-*)		
-	gdb_target_obs="lm32-tdep.o" 
+lm32-*-*)
+	gdb_target_obs="lm32-tdep.o"
 	;;
 
 loongarch*-*-linux*)
@@ -671,7 +671,7 @@ tic6x-*-*linux)
 	;;
 
 tic6x-*-*)
-	# Target: TI C6X 
+	# Target: TI C6X
 	gdb_target_obs="tic6x-tdep.o"
 	;;
 
diff --git a/gdb/contrib/check-whitespace-pre-commit.py b/gdb/contrib/check-whitespace-pre-commit.py
index b79e158fecc..bc76fb0cd5f 100755
--- a/gdb/contrib/check-whitespace-pre-commit.py
+++ b/gdb/contrib/check-whitespace-pre-commit.py
@@ -23,12 +23,9 @@ re_ignore = re.compile("ChangeLog")
 
 # Files that are not clean, so they're only checked when changes.
 todo_list = [
-    "gdb/config/djgpp/fnchange.lst",
     "gdb/gdb-gdb.gdb.in",
-    "gdb/configure.tgt",
     "gdb/doc/annotate.texinfo",
     "gdb/doc/refcard.tex",
-    "gdb/doc/stack_frame.txt",
 ]
 
 clean = []
diff --git a/gdb/doc/stack_frame.txt b/gdb/doc/stack_frame.txt
index e6ff020b378..0f2510e9990 100644
--- a/gdb/doc/stack_frame.txt
+++ b/gdb/doc/stack_frame.txt
@@ -33,7 +33,7 @@ Number          - |   |  |============|       int fact (int n)
                |      |  |------------|                      |
                |       --+-----o      |<--------- SP         |
                 =        |============|                      |
-               |         |  Red Zone  |                      v  
+               |         |  Red Zone  |                      v
                |         \/\/\/\/\/\/\/                 Direction of
   #-1         <          \/\/\/\/\/\/\/                 stack growth
                |         |            |
-- 
2.51.0


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

* [PATCH 7/9] [gdb] Ignore trailing whitespace in gdb/gdb-gdb.gdb.in
  2026-06-18 13:38 [PATCH 0/9] [gdb] More whitespace fixes Tom de Vries
                   ` (5 preceding siblings ...)
  2026-06-18 13:38 ` [PATCH 6/9] [gdb] Fix trailing whitespace in some files Tom de Vries
@ 2026-06-18 13:38 ` Tom de Vries
  2026-06-18 13:38 ` [PATCH 8/9] [gdb] Fix trailing whitespace in annotate.texinfo Tom de Vries
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Tom de Vries @ 2026-06-18 13:38 UTC (permalink / raw)
  To: gdb-patches

In gdb/gdb-gdb.gdb.in we have:
...
gdb/gdb-gdb.gdb.in:22: trailing whitespace.
+set prompt (top-gdb)
...

The trailing space is significant.

Fix this by dropping the trailing whitespace check for this file.
---
 gdb/.gitattributes                         | 3 +++
 gdb/contrib/check-whitespace-pre-commit.py | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdb/.gitattributes b/gdb/.gitattributes
index fa3e5af7af8..f176977e7aa 100644
--- a/gdb/.gitattributes
+++ b/gdb/.gitattributes
@@ -23,3 +23,6 @@ aclocal.m4  -whitespace
 
 # Imported files.
 exc_request.defs -whitespace
+
+# Files with significant trailing whitespace.
+gdb-gdb.gdb.in  whitespace=space-before-tab,indent-with-non-tab,-trailing-space
diff --git a/gdb/contrib/check-whitespace-pre-commit.py b/gdb/contrib/check-whitespace-pre-commit.py
index bc76fb0cd5f..7f1d5b47690 100755
--- a/gdb/contrib/check-whitespace-pre-commit.py
+++ b/gdb/contrib/check-whitespace-pre-commit.py
@@ -23,7 +23,6 @@ re_ignore = re.compile("ChangeLog")
 
 # Files that are not clean, so they're only checked when changes.
 todo_list = [
-    "gdb/gdb-gdb.gdb.in",
     "gdb/doc/annotate.texinfo",
     "gdb/doc/refcard.tex",
 ]
-- 
2.51.0


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

* [PATCH 8/9] [gdb] Fix trailing whitespace in annotate.texinfo
  2026-06-18 13:38 [PATCH 0/9] [gdb] More whitespace fixes Tom de Vries
                   ` (6 preceding siblings ...)
  2026-06-18 13:38 ` [PATCH 7/9] [gdb] Ignore trailing whitespace in gdb/gdb-gdb.gdb.in Tom de Vries
@ 2026-06-18 13:38 ` Tom de Vries
  2026-06-18 13:38 ` [PATCH 9/9] [gdb] Fix trailing whitespace in refcard.tex Tom de Vries
  2026-06-18 14:03 ` [PATCH 0/9] [gdb] More whitespace fixes Eli Zaretskii
  9 siblings, 0 replies; 13+ messages in thread
From: Tom de Vries @ 2026-06-18 13:38 UTC (permalink / raw)
  To: gdb-patches

Fix:
...
gdb/doc/annotate.texinfo:127: trailing whitespace.
+(gdb)
gdb/doc/annotate.texinfo:132: trailing whitespace.
+$
gdb/doc/annotate.texinfo:732: trailing whitespace.
+@code{step} or @code{continue},
gdb/doc/annotate.texinfo:738: trailing whitespace.
+is output.  When the program stops,
...

Verified by checking annotate.html.
---
 gdb/contrib/check-whitespace-pre-commit.py | 1 -
 gdb/doc/annotate.texinfo                   | 8 ++++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/gdb/contrib/check-whitespace-pre-commit.py b/gdb/contrib/check-whitespace-pre-commit.py
index 7f1d5b47690..b7581a3dc70 100755
--- a/gdb/contrib/check-whitespace-pre-commit.py
+++ b/gdb/contrib/check-whitespace-pre-commit.py
@@ -23,7 +23,6 @@ re_ignore = re.compile("ChangeLog")
 
 # Files that are not clean, so they're only checked when changes.
 todo_list = [
-    "gdb/doc/annotate.texinfo",
     "gdb/doc/refcard.tex",
 ]
 
diff --git a/gdb/doc/annotate.texinfo b/gdb/doc/annotate.texinfo
index 3aed89d5044..27afb54a14a 100644
--- a/gdb/doc/annotate.texinfo
+++ b/gdb/doc/annotate.texinfo
@@ -124,12 +124,12 @@ for details.
 This GDB was configured as "sparc-sun-sunos4.1.3"
 
 ^Z^Zpre-prompt
-(gdb) 
+(gdb)@w{ }
 ^Z^Zprompt
 quit
 
 ^Z^Zpost-prompt
-$ 
+$@w{ }
 @end smallexample
 
 Here @samp{quit} is input to @value{GDBN}; the rest is output from
@@ -729,13 +729,13 @@ deleted a breakpoint.
 @findex starting
 @findex stopping
 When the program starts executing due to a @value{GDBN} command such as
-@code{step} or @code{continue}, 
+@code{step} or @code{continue},
 
 @smallexample
 ^Z^Zstarting
 @end smallexample
 
-is output.  When the program stops, 
+is output.  When the program stops,
 
 @smallexample
 ^Z^Zstopped
-- 
2.51.0


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

* [PATCH 9/9] [gdb] Fix trailing whitespace in refcard.tex
  2026-06-18 13:38 [PATCH 0/9] [gdb] More whitespace fixes Tom de Vries
                   ` (7 preceding siblings ...)
  2026-06-18 13:38 ` [PATCH 8/9] [gdb] Fix trailing whitespace in annotate.texinfo Tom de Vries
@ 2026-06-18 13:38 ` Tom de Vries
  2026-06-18 14:03 ` [PATCH 0/9] [gdb] More whitespace fixes Eli Zaretskii
  9 siblings, 0 replies; 13+ messages in thread
From: Tom de Vries @ 2026-06-18 13:38 UTC (permalink / raw)
  To: gdb-patches

Fix:
...
gdb/doc/refcard.tex:314: trailing whitespace.
+b \opt{\it file\tt:}{\it line}&set breakpoint at {\it line} number \opt{in \it file}\par
gdb/doc/refcard.tex:344: trailing whitespace.
+enable \opt{{\it n}}&enable breakpoints
gdb/doc/refcard.tex:347: trailing whitespace.
+enable once \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}};
gdb/doc/refcard.tex:350: trailing whitespace.
+enable del \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}};
gdb/doc/refcard.tex:494: trailing whitespace.
+\qquad {\it command-list}&create new GDB command {\it cmd};
gdb/doc/refcard.tex:498: trailing whitespace.
+\qquad {\it help-text}&create online documentation
gdb/doc/refcard.tex:595: trailing whitespace.
+list {\it lines}&display source surrounding {\it lines},
gdb/doc/refcard.tex:629: trailing whitespace.
+statement.\cr
...

Verified by checking refcard.pdf.
---
 gdb/contrib/check-whitespace-pre-commit.py |  4 +---
 gdb/doc/refcard.tex                        | 26 +++++++++++-----------
 2 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/gdb/contrib/check-whitespace-pre-commit.py b/gdb/contrib/check-whitespace-pre-commit.py
index b7581a3dc70..1d23bde19a7 100755
--- a/gdb/contrib/check-whitespace-pre-commit.py
+++ b/gdb/contrib/check-whitespace-pre-commit.py
@@ -22,9 +22,7 @@ import sys
 re_ignore = re.compile("ChangeLog")
 
 # Files that are not clean, so they're only checked when changes.
-todo_list = [
-    "gdb/doc/refcard.tex",
-]
+todo_list = []
 
 clean = []
 other = []
diff --git a/gdb/doc/refcard.tex b/gdb/doc/refcard.tex
index f334cce0fd0..7dfb74cfcfd 100644
--- a/gdb/doc/refcard.tex
+++ b/gdb/doc/refcard.tex
@@ -311,7 +311,7 @@ one or more arguments}
 \eject
 \sec Breakpoints and Watchpoints;
 break \opt{\it file\tt:}{\it line}\par
-b \opt{\it file\tt:}{\it line}&set breakpoint at {\it line} number \opt{in \it file}\par 
+b \opt{\it file\tt:}{\it line}&set breakpoint at {\it line} number \opt{in \it file}\par
 eg:\quad{\tt break main.c:37}\quad\cr
 break \opt{\it file\tt:}{\it func}&set breakpoint at {\it
 func} \opt{in \it file}\cr
@@ -341,14 +341,14 @@ delete \opt{{\it n}}&delete breakpoints
 disable \opt{{\it n}}&disable breakpoints
 \opt{or breakpoint {\it n}}
 \cr
-enable \opt{{\it n}}&enable breakpoints 
+enable \opt{{\it n}}&enable breakpoints
 \opt{or breakpoint {\it n}}
 \cr
-enable once \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}}; 
-disable again when reached
+enable once \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}};
+ disable again when reached
 \cr
-enable del \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}}; 
-delete when reached
+enable del \opt{{\it n}}&enable breakpoints \opt{or breakpoint {\it n}};
+ delete when reached
 \cr
 \cr
 ignore {\it n} {\it count}&ignore breakpoint {\it n}, {\it count}
@@ -491,12 +491,12 @@ source {\it script}&read, execute GDB commands from file {\it
 script}\cr
 \cr
 define {\it cmd}\par
-\qquad {\it command-list}&create new GDB command {\it cmd}; 
-execute script defined by {\it command-list}\cr
+\qquad {\it command-list}&create new GDB command {\it cmd};
+ execute script defined by {\it command-list}\cr
 end&end of {\it command-list}\cr
 document {\it cmd}\par
-\qquad {\it help-text}&create online documentation 
-for new GDB command {\it cmd}\cr
+\qquad {\it help-text}&create online documentation
+ for new GDB command {\it cmd}\cr
 end&end of {\it help-text}\cr
 \endsec
 
@@ -592,8 +592,8 @@ show dir&show current source path\cr
 \cr
 list&show next ten lines of source\cr
 list -&show previous ten lines\cr
-list {\it lines}&display source surrounding {\it lines}, 
-specified as:\cr
+list {\it lines}&display source surrounding {\it lines},
+ specified as:\cr
 \quad{\opt{\it file\tt:}\it num}&line number \opt{in named file}\cr
 \quad{\opt{\it file\tt:}\it function}&beginning of function \opt{in
 named file}\cr
@@ -626,7 +626,7 @@ M-d&down {\it arg} frames ({\tt down})\cr
 \sec GDB License;
 show copying&Display GNU General Public License\cr
 show warranty&There is NO WARRANTY for GDB.  Display full no-warranty
-statement.\cr 
+statement.\cr
 \endsec
 
 
-- 
2.51.0


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

* Re: [PATCH 0/9] [gdb] More whitespace fixes
  2026-06-18 13:38 [PATCH 0/9] [gdb] More whitespace fixes Tom de Vries
                   ` (8 preceding siblings ...)
  2026-06-18 13:38 ` [PATCH 9/9] [gdb] Fix trailing whitespace in refcard.tex Tom de Vries
@ 2026-06-18 14:03 ` Eli Zaretskii
  2026-06-18 15:25   ` Tom de Vries
  9 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2026-06-18 14:03 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches

> From: Tom de Vries <tdevries@suse.de>
> Date: Thu, 18 Jun 2026 15:38:09 +0200
> 
> I came across the trailing-whitespace hook here (
> https://github.com/pre-commit/pre-commit-hooks ) and tried it out:
> ...
>   # Out-of-the-box pre-commit hooks.
>   - repo: https://github.com/pre-commit/pre-commit-hooks
>     rev: v6.0.0
>     hooks:
>     - id: trailing-whitespace
>       files: '^(gdb|gdbserver|gdbsupport)/.*$'
>       exclude: 'ChangeLog'
>       args: [--chars," \t"]
> ...
> 
> The args field is necessary to stop it removing ^L.
> 
> The result is:
> ...
> $ pre-commit run trailing-whitespace --all-files
> trim trailing whitespace................................................Failed
> - hook id: trailing-whitespace
> - exit code: 1
> - files were modified by this hook
> 
> Fixing gdbsupport/Makefile.in
> Fixing gdb/config/djgpp/fnchange.lst
> Fixing gdb/doc/annotate.texinfo
> Fixing gdb/doc/stack_frame.txt
> Fixing gdb/exc_request.defs
> Fixing gdb/doc/refcard.tex
> Fixing gdb/gdb-gdb.gdb.in
> Fixing gdb/configure.tgt
> ...
> 
> This made me look again at our homegrown whitespace check, and I found that it
> recognizes a set of clean files that doesn't include the above files.
> 
> This patch series:
> - in check-whitespace-pre-commit.py, adds a todo list of files which are not
>   yet clean, enabling complete checking for all other files, and
> - reduces the todo list with each following patch.
> 
> Tom de Vries (9):
>   [gdb] Increase clean range in check-whitespace-pre-commit.py
>   [gdb] Fix leftover conflict marker in gdb/config/djgpp/README
>   [gdb] Fix new blank line at EOF in a few scripts
>   [gdb] Fix new blank line at EOF in a few xml files
>   [gdb] Ignore whitespace in imported file gdb/exc_request.defs
>   [gdb] Fix trailing whitespace in some files
>   [gdb] Ignore trailing whitespace in gdb/gdb-gdb.gdb.in
>   [gdb] Fix trailing whitespace in annotate.texinfo
>   [gdb] Fix trailing whitespace in refcard.tex
> 
>  .pre-commit-config.yaml                    |  1 +
>  gdb/.gitattributes                         |  6 +++++
>  gdb/config/djgpp/.gitattributes            |  3 +++
>  gdb/config/djgpp/djcheck.sh                |  1 -
>  gdb/config/djgpp/fnchange.lst              |  2 +-
>  gdb/configure.tgt                          |  6 ++---
>  gdb/contrib/ari/create-web-ari-in-src.sh   |  1 -
>  gdb/contrib/ari/gdb_ari.sh                 |  1 -
>  gdb/contrib/check-whitespace-pre-commit.py | 13 +++++++----
>  gdb/doc/annotate.texinfo                   |  8 +++----
>  gdb/doc/refcard.tex                        | 26 +++++++++++-----------
>  gdb/doc/stack_frame.txt                    |  2 +-
>  gdb/features/aarch64-pauth.xml             |  1 -
>  gdb/features/library-list-aix.dtd          |  1 -
>  gdb/features/s390-core64.xml               |  1 -
>  gdb/features/sparc/sparc32-cp0.xml         |  1 -
>  gdb/features/sparc/sparc32-fpu.xml         |  1 -
>  gdb/features/sparc/sparc64-cp0.xml         |  1 -
>  gdb/features/sparc/sparc64-fpu.xml         |  1 -
>  19 files changed, 41 insertions(+), 36 deletions(-)
>  create mode 100644 gdb/config/djgpp/.gitattributes

Seems to be obvious fixes to me, no?

Thanks.

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

* Re: [PATCH 0/9] [gdb] More whitespace fixes
  2026-06-18 14:03 ` [PATCH 0/9] [gdb] More whitespace fixes Eli Zaretskii
@ 2026-06-18 15:25   ` Tom de Vries
  2026-06-18 17:13     ` Tom Tromey
  0 siblings, 1 reply; 13+ messages in thread
From: Tom de Vries @ 2026-06-18 15:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

On 6/18/26 4:03 PM, Eli Zaretskii wrote:
> Seems to be obvious fixes to me, no?

Thanks Eli.

I'll wait until tomorrow then for further comments, and if not I'll commit.

- Tom



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

* Re: [PATCH 0/9] [gdb] More whitespace fixes
  2026-06-18 15:25   ` Tom de Vries
@ 2026-06-18 17:13     ` Tom Tromey
  0 siblings, 0 replies; 13+ messages in thread
From: Tom Tromey @ 2026-06-18 17:13 UTC (permalink / raw)
  To: Tom de Vries; +Cc: Eli Zaretskii, gdb-patches

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> On 6/18/26 4:03 PM, Eli Zaretskii wrote:
>> Seems to be obvious fixes to me, no?

Tom> I'll wait until tomorrow then for further comments, and if not I'll commit.

It all seems fine to me too.
Approved-By: Tom Tromey <tom@tromey.com>

Tom

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

end of thread, other threads:[~2026-06-18 17:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-18 13:38 [PATCH 0/9] [gdb] More whitespace fixes Tom de Vries
2026-06-18 13:38 ` [PATCH 1/9] [gdb] Increase clean range in check-whitespace-pre-commit.py Tom de Vries
2026-06-18 13:38 ` [PATCH 2/9] [gdb] Fix leftover conflict marker in gdb/config/djgpp/README Tom de Vries
2026-06-18 13:38 ` [PATCH 3/9] [gdb] Fix new blank line at EOF in a few scripts Tom de Vries
2026-06-18 13:38 ` [PATCH 4/9] [gdb] Fix new blank line at EOF in a few xml files Tom de Vries
2026-06-18 13:38 ` [PATCH 5/9] [gdb] Ignore whitespace in imported file gdb/exc_request.defs Tom de Vries
2026-06-18 13:38 ` [PATCH 6/9] [gdb] Fix trailing whitespace in some files Tom de Vries
2026-06-18 13:38 ` [PATCH 7/9] [gdb] Ignore trailing whitespace in gdb/gdb-gdb.gdb.in Tom de Vries
2026-06-18 13:38 ` [PATCH 8/9] [gdb] Fix trailing whitespace in annotate.texinfo Tom de Vries
2026-06-18 13:38 ` [PATCH 9/9] [gdb] Fix trailing whitespace in refcard.tex Tom de Vries
2026-06-18 14:03 ` [PATCH 0/9] [gdb] More whitespace fixes Eli Zaretskii
2026-06-18 15:25   ` Tom de Vries
2026-06-18 17:13     ` Tom Tromey

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