]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add "-5" flag to cc-with-tweaks
authorTom Tromey <tom@tromey.com>
Sun, 23 Mar 2025 16:21:25 +0000 (10:21 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 22 Apr 2025 22:06:59 +0000 (16:06 -0600)
This adds a "-5" flag to cc-with-tweaks, mirroring dwz's "-5" flag,
and also adds a new cc-with-dwz-5 target board.

The "-5" flag tells dwz to use the DWARF 5 .debug_sup section in
multi-file mode.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32808

gdb/contrib/cc-with-tweaks.sh
gdb/testsuite/boards/cc-with-dwz-5.exp [new file with mode: 0644]

index de56018f31b153cd9110b0ca3d9556b62961e837..930ba5c8081d67c5a8a8b4caebca8131ffce8b28 100755 (executable)
@@ -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/testsuite/boards/cc-with-dwz-5.exp b/gdb/testsuite/boards/cc-with-dwz-5.exp
new file mode 100644 (file)
index 0000000..b254f91
--- /dev/null
@@ -0,0 +1,28 @@
+# Copyright 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/>.
+
+# This file is a dejagnu "board file" and is used to run the testsuite
+# with contrib/cc-with-tweaks.sh -5.
+#
+# NOTE: We assume dwz is in $PATH.
+#
+# Example usage:
+# bash$ cd $objdir
+# bash$ make check-gdb \
+#   RUNTESTFLAGS='--target_board=cc-with-dwz-5'
+#
+
+set CC_WITH_TWEAKS_FLAGS "-5"
+load_board_description "cc-with-tweaks"