From patchwork Fri Jan 6 18:37:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 18813 Received: (qmail 39515 invoked by alias); 6 Jan 2017 18:37:26 -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 39497 invoked by uid 89); 6 Jan 2017 18:37:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:jan.kra, jankratochvilredhatcom, sk:jankra, U*jan.kratochvil X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Jan 2017 18:37:15 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8244C3B717 for ; Fri, 6 Jan 2017 18:37:15 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-204-24.brq.redhat.com [10.40.204.24]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v06IbCo2013258 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 6 Jan 2017 13:37:14 -0500 Date: Fri, 6 Jan 2017 19:37:10 +0100 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch] contrib/gdb-add-index.sh: chmod u+w Message-ID: <20170106183710.GA2457@host1.jankratochvil.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes Hi, in Fedora 24 it still worked, in Fedora 25 it does not - *-debuginfo.rpm no longer have the .gdb_index accelerating section now. It happens because: objcopy: unable to copy file 'foo.debug'; reason: Permission denied *.debug files in Fedora were always 444 but the time gdb-add-index is run is still before the *.debug split and in Fedora 24 the files were -rwxr-xr-x that time while in Fedora 25 they are apparently no longer w. OK for check-in? Jan gdb/ChangeLog 2017-01-06 Jan Kratochvil * contrib/gdb-add-index.sh: Use chmod u+w for $file. diff --git a/gdb/contrib/gdb-add-index.sh b/gdb/contrib/gdb-add-index.sh index 0cd4ce3..5a190a0 100755 --- a/gdb/contrib/gdb-add-index.sh +++ b/gdb/contrib/gdb-add-index.sh @@ -38,10 +38,11 @@ fi dir="${file%/*}" test "$dir" = "$file" && dir="." index="${file}.gdb-index" +mode="${file}.mode" -rm -f $index +rm -f $index $mode # Ensure intermediate index file is removed when we exit. -trap "rm -f $index" 0 +trap "rm -f $index $mode" 0 $GDB --batch -nx -iex 'set auto-load no' \ -ex "file $file" -ex "save gdb-index $dir" || { @@ -58,8 +59,13 @@ $GDB --batch -nx -iex 'set auto-load no' \ status=0 if test -f "$index"; then + touch "$mode" + chmod --reference="$file" "$mode" + # objcopy: unable to copy file 'foo.debug'; reason: Permission denied + chmod u+w "$file" $OBJCOPY --add-section .gdb_index="$index" \ --set-section-flags .gdb_index=readonly "$file" "$file" + chmod --reference="$mode" "$file" status=$? else echo "$myname: No index was created for $file" 1>&2