From patchwork Sat May 4 08:20:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 32540 Received: (qmail 10358 invoked by alias); 4 May 2019 08:20:19 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 10350 invoked by uid 89); 4 May 2019 08:20:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 04 May 2019 08:20:18 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C5DF6AE41; Sat, 4 May 2019 08:20:15 +0000 (UTC) Subject: [committed][gdb/testsuite] Add cc-with-debug-names.exp To: Simon Marchi , gdb-patches@sourceware.org References: <20190503104352.GA7789@delia> From: Tom de Vries Message-ID: <0a6f1f73-13c2-60d2-47cd-1070c2e7f710@suse.de> Date: Sat, 4 May 2019 10:20:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: X-IsSubscribed: yes [ was: Re: [PATCH][gdb/testsuite] Fix index-cache.exp with CC_WITH_TWEAKS_FLAGS=-i ] On 03-05-19 23:17, Simon Marchi wrote: > I would slightly prefer that instead of doing this, we would notice that that file > already has an index (in the form of .gdb_index or .debug_names), and adjust our > expectations in the test. > Added cc-with-debug-names target board for .debug_names. Filed PR24522 - "Asserts with cc-with-debug-names". Thanks, - Tom [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 * contrib/cc-with-tweaks.sh: Support -n arg. gdb/testsuite/ChangeLog: 2019-05-04 Tom de Vries * boards/cc-with-debug-names.exp: New file. --- gdb/contrib/cc-with-tweaks.sh | 8 ++++++-- gdb/testsuite/boards/cc-with-debug-names.exp | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh index 33c6322138..47379cc158 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/boards/cc-with-debug-names.exp b/gdb/testsuite/boards/cc-with-debug-names.exp new file mode 100644 index 0000000000..0acf46ca95 --- /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 . + +# 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"