From patchwork Sat Jun 30 19:36:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 28175 Received: (qmail 101223 invoked by alias); 30 Jun 2018 19:36:57 -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 101203 invoked by uid 89); 30 Jun 2018 19:36:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_NUMSUBJECT, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=creates, checkin, trap X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 30 Jun 2018 19:36:55 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 080D4401EF03 for ; Sat, 30 Jun 2018 19:36:54 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-120-10.rdu2.redhat.com [10.10.120.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 90890111DD0E for ; Sat, 30 Jun 2018 19:36:53 +0000 (UTC) Date: Sat, 30 Jun 2018 21:36:51 +0200 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch] contrib/gdb-add-index.sh -dwarf-5 Message-ID: <20180630193651.GA3127041@host1.jankratochvil.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.0 (2018-05-17) Hi, ------------------------------------------------------------------------------ (gdb) help save gdb-index Save a gdb-index file. Usage: save gdb-index [-dwarf-5] DIRECTORY No options create one file with .gdb-index extension for pre-DWARF-5 compatible .gdb_index section. With -dwarf-5 creates two files with extension .debug_names and .debug_str for DWARF-5 .debug_names section. ------------------------------------------------------------------------------ But gdb-add-index command provides no way how to pass the -dwarf-5 option. OK for check-in? Jan 2018-06-30 Jan Kratochvil * contrib/gdb-add-index.sh ($dwarf5): New, use it. diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh index 71146966ab..0aab234f7c 100755 --- a/gdb/contrib/gdb-add-index.sh +++ b/gdb/contrib/gdb-add-index.sh @@ -23,6 +23,12 @@ OBJCOPY=${OBJCOPY:=objcopy} myname="${0##*/}" +dwarf5="" +if [ "$1" = "-dwarf-5" ]; then + dwarf5="$1" + shift +fi + if test $# != 1; then echo "usage: $myname FILE" 1>&2 exit 1 @@ -48,7 +54,7 @@ rm -f $index4 $index5 $debugstr $debugstrmerge $debugstrerr trap "rm -f $index4 $index5 $debugstr $debugstrmerge $debugstrerr" 0 $GDB --batch -nx -iex 'set auto-load no' \ - -ex "file $file" -ex "save gdb-index $dir" || { + -ex "file $file" -ex "save gdb-index $dwarf5 $dir" || { # Just in case. status=$? echo "$myname: gdb error generating index for $file" 1>&2