aboutsummaryrefslogtreecommitdiff
path: root/gdb/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/contrib')
-rw-r--r--gdb/contrib/ari/create-web-ari-in-src.sh2
-rwxr-xr-xgdb/contrib/ari/gdb_ari.sh2
-rw-r--r--gdb/contrib/ari/gdb_find.sh2
-rw-r--r--gdb/contrib/ari/update-web-ari.sh2
-rwxr-xr-xgdb/contrib/cc-with-tweaks.sh7
-rwxr-xr-xgdb/contrib/codespell-log.sh95
-rw-r--r--gdb/contrib/expect-read1.c2
-rwxr-xr-xgdb/contrib/expect-read1.sh2
-rwxr-xr-xgdb/contrib/gdb-add-index.sh2
-rw-r--r--gdb/contrib/setup.cfg12
-rw-r--r--gdb/contrib/test_pubnames_and_indexes.py2
-rwxr-xr-xgdb/contrib/words.sh2
12 files changed, 121 insertions, 11 deletions
diff --git a/gdb/contrib/ari/create-web-ari-in-src.sh b/gdb/contrib/ari/create-web-ari-in-src.sh
index 64d3c73..4ea0398 100644
--- a/gdb/contrib/ari/create-web-ari-in-src.sh
+++ b/gdb/contrib/ari/create-web-ari-in-src.sh
@@ -2,7 +2,7 @@
# GDB script to create web ARI page directly from within gdb/ari directory.
#
-# Copyright (C) 2012-2024 Free Software Foundation, Inc.
+# Copyright (C) 2012-2025 Free Software Foundation, Inc.
#
# This file is part of GDB.
#
diff --git a/gdb/contrib/ari/gdb_ari.sh b/gdb/contrib/ari/gdb_ari.sh
index 5ed7d61..f539ed1 100755
--- a/gdb/contrib/ari/gdb_ari.sh
+++ b/gdb/contrib/ari/gdb_ari.sh
@@ -2,7 +2,7 @@
# GDB script to list of problems using awk.
#
-# Copyright (C) 2002-2024 Free Software Foundation, Inc.
+# Copyright (C) 2002-2025 Free Software Foundation, Inc.
#
# This file is part of GDB.
#
diff --git a/gdb/contrib/ari/gdb_find.sh b/gdb/contrib/ari/gdb_find.sh
index f0aa6d1..b6bd3f9 100644
--- a/gdb/contrib/ari/gdb_find.sh
+++ b/gdb/contrib/ari/gdb_find.sh
@@ -2,7 +2,7 @@
# GDB script to create list of files to check using gdb_ari.sh.
#
-# Copyright (C) 2003-2024 Free Software Foundation, Inc.
+# Copyright (C) 2003-2025 Free Software Foundation, Inc.
#
# This file is part of GDB.
#
diff --git a/gdb/contrib/ari/update-web-ari.sh b/gdb/contrib/ari/update-web-ari.sh
index 75ab029..6e7b5ff 100644
--- a/gdb/contrib/ari/update-web-ari.sh
+++ b/gdb/contrib/ari/update-web-ari.sh
@@ -2,7 +2,7 @@
# GDB script to create GDB ARI web page.
#
-# Copyright (C) 2001-2024 Free Software Foundation, Inc.
+# Copyright (C) 2001-2025 Free Software Foundation, Inc.
#
# This file is part of GDB.
#
diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh
index 4214b92..930ba5c 100755
--- a/gdb/contrib/cc-with-tweaks.sh
+++ b/gdb/contrib/cc-with-tweaks.sh
@@ -2,7 +2,7 @@
# Wrapper around gcc to tweak the output in various ways when running
# the testsuite.
-# Copyright (C) 2010-2024 Free Software Foundation, Inc.
+# Copyright (C) 2010-2025 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
@@ -42,6 +42,7 @@
# -Z invoke objcopy --compress-debug-sections
# -z compress using dwz
# -m compress using dwz -m
+# -5 compress using dwz -m -5
# -i make an index (.gdb_index)
# -c make an index (currently .gdb_index) in a cache dir
# -n make a dwarf5 index (.debug_names)
@@ -88,6 +89,7 @@ want_index=false
index_options=""
want_index_cache=false
want_dwz=false
+dwz_5flag=
want_multi=false
want_dwp=false
want_objcopy_compress=false
@@ -101,6 +103,7 @@ while [ $# -gt 0 ]; do
-n) want_index=true; index_options=-dwarf-5;;
-c) want_index_cache=true ;;
-m) want_multi=true ;;
+ -5) want_multi=true; dwz_5flag=-5 ;;
-p) want_dwp=true ;;
-l) want_gnu_debuglink=true ;;
*) break ;;
@@ -269,7 +272,7 @@ elif [ "$want_multi" = true ]; then
rm -f "$dwz_file"
cp "$output_file" "${output_file}.alt"
- $DWZ -m "$dwz_file" "$output_file" "${output_file}.alt" > /dev/null
+ $DWZ $dwz_5flag -m "$dwz_file" "$output_file" "${output_file}.alt" > /dev/null
rm -f "${output_file}.alt"
# Validate dwz's work by checking if the expected output file exists.
diff --git a/gdb/contrib/codespell-log.sh b/gdb/contrib/codespell-log.sh
new file mode 100755
index 0000000..10780f8
--- /dev/null
+++ b/gdb/contrib/codespell-log.sh
@@ -0,0 +1,95 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2025 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/>.
+
+# Script to be used as pre-commit commit-msg hook to spell-check the commit
+# log using codespell.
+#
+# Using codespell directly as a pre-commit commit-msg hook has the drawback
+# that:
+# - if codespell fails, the commit fails
+# - if the commit log mentions a typo correction, it'll require a
+# codespell:ignore annotation.
+#
+# This script works around these problems by treating codespell output as a
+# hint, and ignoring codespell exit status.
+#
+# Implementation note: rather than using codespell directly, this script uses
+# pre-commit to call codespell, because it allows us to control the codespell
+# version that is used.
+
+# Exit on error.
+set -e
+
+# Initialize temporary file names.
+cfg=""
+output=""
+
+cleanup()
+{
+ for f in "$cfg" "$output"; do
+ if [ "$f" != "" ]; then
+ rm -f "$f"
+ fi
+ done
+}
+
+# Schedule cleanup.
+trap cleanup EXIT
+
+# Create temporary files.
+cfg=$(mktemp)
+output=$(mktemp)
+
+gen_cfg ()
+{
+ cat > "$1" <<EOF
+repos:
+- repo: https://github.com/codespell-project/codespell
+ rev: v2.4.1
+ hooks:
+ - id: codespell
+ name: codespell-log-internal
+ stages: [manual]
+ args: [--config, gdb/contrib/setup.cfg]
+EOF
+}
+
+# Generate pre-commit configuration file.
+gen_cfg "$cfg"
+
+# Setup pre-commit command to run.
+cmd=(pre-commit \
+ run \
+ -c "$cfg" \
+ codespell \
+ --hook-stage manual \
+ --files "$@")
+
+# Run pre-commit command.
+if "${cmd[@]}" \
+ > "$output" \
+ 2>&1; then
+ # Command succeeded quietly, we're done.
+ exit 0
+fi
+
+# Command failed quietly, now show the output.
+#
+# Simply doing "cat $output" doesn't produce colored output, so we just
+# run the command again, that should be fast enough.
+#
+# Ignore codespell exit status.
+"${cmd[@]}" || true
diff --git a/gdb/contrib/expect-read1.c b/gdb/contrib/expect-read1.c
index 454ecda..bb7317b 100644
--- a/gdb/contrib/expect-read1.c
+++ b/gdb/contrib/expect-read1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013-2024 Free Software Foundation, Inc.
+/* Copyright (C) 2013-2025 Free Software Foundation, Inc.
This file is part of GDB.
diff --git a/gdb/contrib/expect-read1.sh b/gdb/contrib/expect-read1.sh
index 82c638c..e8589a2 100755
--- a/gdb/contrib/expect-read1.sh
+++ b/gdb/contrib/expect-read1.sh
@@ -1,7 +1,7 @@
#! /bin/sh
# runtest wrapper to reliably reproduce racy incomplete reads in the testsuite.
-# Copyright (C) 2013-2024 Free Software Foundation, Inc.
+# Copyright (C) 2013-2025 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
diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh
index b299f83..d2c523f 100755
--- a/gdb/contrib/gdb-add-index.sh
+++ b/gdb/contrib/gdb-add-index.sh
@@ -2,7 +2,7 @@
# Add a .gdb_index section to a file.
-# Copyright (C) 2010-2024 Free Software Foundation, Inc.
+# Copyright (C) 2010-2025 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
diff --git a/gdb/contrib/setup.cfg b/gdb/contrib/setup.cfg
index dbff165..d6be386 100644
--- a/gdb/contrib/setup.cfg
+++ b/gdb/contrib/setup.cfg
@@ -4,3 +4,15 @@
skip = */ChangeLog*,*/configure,gdbsupport/Makefile.in,*.dat,*.eps,gdb/features/*.c,gdb/ada-casefold.h,gdb/copying.c,gdb/gdbarch-gen.h,gdb/gdbarch-gen.c,gdb/target-delegates-gen.c
ignore-words = gdb/contrib/codespell-ignore-words.txt
+
+# Ignore all URLs.
+uri-ignore-words-list = *
+
+# This codespell issue (
+# https://github.com/codespell-project/codespell/issues/3381 ) reports the
+# need to have support for ignoring blocks of code.
+# A suggestion there is to use ignore-multiline-regex, which does work, but
+# has a bug: using -w drops all newlines in the updated files (
+# https://github.com/codespell-project/codespell/issues/3642 ).
+# Consequently, disabled. To be enabled when the bug is fixed.
+#ignore-multiline-regex = codespell:ignore-begin.*codespell:ignore-end
diff --git a/gdb/contrib/test_pubnames_and_indexes.py b/gdb/contrib/test_pubnames_and_indexes.py
index a3f5c92..7a3dec6 100644
--- a/gdb/contrib/test_pubnames_and_indexes.py
+++ b/gdb/contrib/test_pubnames_and_indexes.py
@@ -1,6 +1,6 @@
#! /usr/bin/env python3
-# Copyright (C) 2011-2024 Free Software Foundation, Inc.
+# Copyright (C) 2011-2025 Free Software Foundation, Inc.
#
# This file is part of GDB.
#
diff --git a/gdb/contrib/words.sh b/gdb/contrib/words.sh
index 90b1bd9..a4bb2c7 100755
--- a/gdb/contrib/words.sh
+++ b/gdb/contrib/words.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (C) 2019-2024 Free Software Foundation, Inc.
+# Copyright (C) 2019-2025 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