Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 3/3] Add "-5" flag to cc-with-tweaks
Date: Sun, 23 Mar 2025 13:20:02 -0600	[thread overview]
Message-ID: <20250323-dwz-dwarf-5-v2-v1-3-3c0775ca5514@tromey.com> (raw)
In-Reply-To: <20250323-dwz-dwarf-5-v2-v1-0-3c0775ca5514@tromey.com>

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          |  5 ++++-
 gdb/testsuite/boards/cc-with-dwz-5.exp | 28 ++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh
index 4214b9292955a8b5f4602d329a93ee0ab606a70a..5677f29493828a9e9fb6041fd03cb85452e04199 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 0000000000000000000000000000000000000000..b254f91e79557a5600a894f0bb0727fd2bcf02f1
--- /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 <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"

-- 
2.46.1


      parent reply	other threads:[~2025-03-23 19:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-23 19:19 [PATCH 0/3] Support DWARF 5 .debug_sup section Tom Tromey
2025-03-23 19:20 ` [PATCH 1/3] Remove 'read' call from dwz_file::read_string Tom Tromey
2025-03-24 14:25   ` Alexandra Petlanova Hajkova
2025-03-24 20:30   ` Simon Marchi
2025-03-24 20:52     ` Tom Tromey
2025-03-23 19:20 ` [PATCH 2/3] Handle DWARF 5 separate debug sections Tom Tromey
2025-03-24 15:45   ` Alexandra Petlanova Hajkova
2025-03-24 17:16     ` Tom Tromey
2025-04-03 14:39       ` Tom Tromey
2025-04-22 14:55         ` Tom Tromey
2025-04-22 15:10           ` Simon Marchi
2025-04-28 11:35             ` Tom de Vries
2025-03-24 20:52   ` Simon Marchi
2025-03-25 13:37     ` Tom Tromey
2025-03-23 19:20 ` Tom Tromey [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=20250323-dwz-dwarf-5-v2-v1-3-3c0775ca5514@tromey.com \
    --to=tom@tromey.com \
    --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