From: Tom Tromey Date: Sun, 23 Mar 2025 16:21:25 +0000 (-0600) Subject: Add "-5" flag to cc-with-tweaks X-Git-Tag: binutils-2_45~841 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d43070861f5e6e890b6d1dcbe4c4d0354fa20b75;p=thirdparty%2Fbinutils-gdb.git Add "-5" flag to cc-with-tweaks 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 --- diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh index de56018f31b..930ba5c8081 100755 --- a/gdb/contrib/cc-with-tweaks.sh +++ b/gdb/contrib/cc-with-tweaks.sh @@ -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 index 00000000000..b254f91e795 --- /dev/null +++ b/gdb/testsuite/boards/cc-with-dwz-5.exp @@ -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 . + +# 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"