From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1260 invoked by alias); 29 Jun 2010 22:32:50 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 1248 invoked by uid 22791); 29 Jun 2010 22:32:49 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org From: Tom Tromey To: Project Archer Subject: find-debuginfo.sh change for gdb index CC: pmatilai@redhat.com Reply-To: Tom Tromey Date: Tue, 29 Jun 2010 22:32:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2010-q2/txt/msg00060.txt.bz2 Hi Panu. Roland suggested I contact you as the Fedora RPM maintainer. This patch adds gdb index creation to find-debuginfo.sh, in support of a feature I'm proposing for Fedora 14: https://fedoraproject.org/wiki/Features/GdbIndex I've tested this just by building some RPMs locally. If you'd prefer, I can open a bug in bugzilla for this. I don't know what other changes may be needed to ensure that the proper gdb is in the buildroots when this script is run. Also, the proper gdb is not actually available yet; cleaning up that patch series is my next task. I think this should probably be local to Fedora, but if you think it should go into upstream RPM, I am happy to try that. Tom --- find-debuginfo.sh.orig 2010-06-29 16:19:42.000000000 -0600 +++ find-debuginfo.sh 2010-06-29 15:52:08.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 "maintenance save-gnu-index $d" > /dev/null 2>&1 +} + # Make a relative symlink to $1 called $3$2 shopt -s extglob link_relative() @@ -224,9 +233,15 @@ chmod u-w "$f" fi + make_gdb_index "$debugfn" + if [ -n "$id" ]; then make_id_link "$id" "$dn/$(basename $f)" make_id_link "$id" "/usr/lib/debug$dn/$bn" .debug + + if [ -f "${debugfn}.index" ]; then + make_id_link "$id" "/usr/lib/debug$dn/$bn" .debug + fi fi done || exit