public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom de Vries <vries@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] [gdb/testsuite] Add cc-with-debug-names.exp
Date: Sat, 04 May 2019 08:12:00 -0000	[thread overview]
Message-ID: <20190504081203.130304.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9d6d4be89d12747a92629ed1bde1d423e2831de1

commit 9d6d4be89d12747a92629ed1bde1d423e2831de1
Author: Tom de Vries <tdevries@suse.de>
Date:   Sat May 4 10:11:53 2019 +0200

    [gdb/testsuite] Add cc-with-debug-names.exp
    
    Add a target board that makes it easy to run the test suite with a
    .debug_names section added to executables.
    
    gdb/ChangeLog:
    
    2019-05-04  Tom de Vries  <tdevries@suse.de>
    
    	* contrib/cc-with-tweaks.sh: Support -n arg.
    
    gdb/testsuite/ChangeLog:
    
    2019-05-04  Tom de Vries  <tdevries@suse.de>
    
    	* boards/cc-with-debug-names.exp: New file.

Diff:
---
 gdb/ChangeLog                                |  4 ++++
 gdb/contrib/cc-with-tweaks.sh                |  8 ++++++--
 gdb/testsuite/ChangeLog                      |  4 ++++
 gdb/testsuite/boards/cc-with-debug-names.exp | 26 ++++++++++++++++++++++++++
 4 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0b8d562..09a4a0a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2019-05-04  Tom de Vries  <tdevries@suse.de>
+
+	* contrib/cc-with-tweaks.sh: Support -n arg.
+
 2019-05-04  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
 
 	* corelow.c (core_target::detach): Ensure frame cache and
diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh
index 33c6322..47379cc 100755
--- a/gdb/contrib/cc-with-tweaks.sh
+++ b/gdb/contrib/cc-with-tweaks.sh
@@ -42,7 +42,8 @@
 # -Z invoke objcopy --compress-debug-sections
 # -z compress using dwz
 # -m compress using dwz -m
-# -i make an index
+# -i make an index (.gdb_index)
+# -n make a dwarf5 index (.debug_names)
 # -p create .dwp files (Fission), you need to also use gcc option -gsplit-dwarf
 # If nothing is given, no changes are made
 
@@ -77,6 +78,7 @@ next_is_output_file=no
 output_file=a.out
 
 want_index=false
+index_options=""
 want_dwz=false
 want_multi=false
 want_dwp=false
@@ -87,6 +89,7 @@ while [ $# -gt 0 ]; do
 	-Z) want_objcopy_compress=true ;;
 	-z) want_dwz=true ;;
 	-i) want_index=true ;;
+	-n) want_index=true; index_options=-dwarf-5;;
 	-m) want_multi=true ;;
 	-p) want_dwp=true ;;
 	*) break ;;
@@ -170,7 +173,8 @@ if [ "$want_index" = true ]; then
     # Filter out these messages which would stop dejagnu testcase run:
     # echo "$myname: No index was created for $file" 1>&2
     # echo "$myname: [Was there no debuginfo? Was there already an index?]" 1>&2
-    GDB=$GDB $GDB_ADD_INDEX "$output_file" 2>&1|grep -v "^${GDB_ADD_INDEX##*/}: " >&2
+    GDB=$GDB $GDB_ADD_INDEX $index_options "$output_file" 2>&1 \
+	| grep -v "^${GDB_ADD_INDEX##*/}: " >&2
     rc=${PIPESTATUS[0]}
     [ $rc != 0 ] && exit $rc
 fi
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 72fc0d8..729cc52 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2019-05-04  Tom de Vries  <tdevries@suse.de>
+
+	* boards/cc-with-debug-names.exp: New file.
+
 2019-05-03  Tom Tromey  <tromey@adacore.com>
 
 	* gdb.ada/char_enum/pck.ads (Global_Enum_Type): New type.
diff --git a/gdb/testsuite/boards/cc-with-debug-names.exp b/gdb/testsuite/boards/cc-with-debug-names.exp
new file mode 100644
index 0000000..0acf46c
--- /dev/null
+++ b/gdb/testsuite/boards/cc-with-debug-names.exp
@@ -0,0 +1,26 @@
+# Copyright 2019 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 -n.
+#
+# Example usage:
+# bash$ cd $objdir
+# bash$ make check-gdb \
+#   RUNTESTFLAGS='--target_board=cc-with-debug-names'
+#
+
+set CC_WITH_TWEAKS_FLAGS "-n"
+load_board_description "cc-with-tweaks"


                 reply	other threads:[~2019-05-04  8:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190504081203.130304.qmail@sourceware.org \
    --to=vries@sourceware.org \
    --cc=gdb-cvs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).