From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28031 invoked by alias); 8 Jul 2010 20:36:47 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 28013 invoked by uid 22791); 8 Jul 2010 20:36:43 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BJ,TW_JC,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org From: Tom Tromey To: Roland McGrath Cc: Panu Matilainen , Project Archer Subject: Re: find-debuginfo.sh change for gdb index References: <20100629232147.C019548255@magilla.sf.frob.com> <20100630181436.518364C33C@magilla.sf.frob.com> <20100630204424.3DCE34C33C@magilla.sf.frob.com> <20100630221406.254AC4C33E@magilla.sf.frob.com> <20100706191407.535874824F@magilla.sf.frob.com> Date: Thu, 08 Jul 2010 20:36:00 -0000 In-Reply-To: (Tom Tromey's message of "Thu, 08 Jul 2010 09:56:30 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2010-q3/txt/msg00018.txt.bz2 Tom> Here is a patch to just do the work directly in find-debuginfo.sh. This Tom> seemed simpler to me, but if you and Panu want a new script, I will do Tom> that. An upstream maintainer wanted the command's name changed. It is now "save gdb-index" instead of "maint save-gdb-index". Here's the updated find-debuginfo.sh patch. Tom --- find-debuginfo.sh.orig 2010-06-29 16:19:42.000000000 -0600 +++ find-debuginfo.sh 2010-07-08 14:10:06.000000000 -0600 @@ -96,6 +96,15 @@ chmod 444 "$1" || exit } +# Create a .gdb-index file for $1. +make_gdb_index() +{ + local f="$1" + local d="${f%/*}" + # We don't care if gdb gives an error. + gdb --batch-silent -ex "file $f" -ex "save gdb-index $d" > /dev/null 2>&1 +} + # Make a relative symlink to $1 called $3$2 shopt -s extglob link_relative() @@ -207,6 +216,12 @@ $strict && exit 2 fi + make_gdb_index "$f" + if [ -f "${f}.gdb-index" ]; then + objcopy --add-section .gdb_index="${f}.gdb-index" --set-section-flags .gdb_index=readonly "$f" "$f" + rm -f "${f}.gdb-index" + fi + # A binary already copied into /usr/lib/debug doesn't get stripped, # just has its file names collected and adjusted. case "$dn" in