From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29432 invoked by alias); 5 Aug 2010 19:55:40 -0000 Received: (qmail 29416 invoked by uid 22791); 5 Aug 2010 19:55:38 -0000 X-SWARE-Spam-Status: No, hits=-6.0 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 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Aug 2010 19:55:28 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o75JtO0f020266 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 5 Aug 2010 15:55:24 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o75JtNpm006017; Thu, 5 Aug 2010 15:55:24 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o75JtNiD011584; Thu, 5 Aug 2010 15:55:23 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id EB17E3782ED; Thu, 5 Aug 2010 13:55:22 -0600 (MDT) From: Tom Tromey To: Doug Evans Cc: gdb-patches@sourceware.org Subject: Re: [0/4] RFC: add DWARF index support References: Date: Thu, 05 Aug 2010 19:55:00 -0000 In-Reply-To: (Doug Evans's message of "Thu, 5 Aug 2010 09:31:58 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00050.txt.bz2 >> I don't think this can happen. Doug> ... assuming there are no bugs. Ok. What do you think of this? Tom 2010-08-05 Tom Tromey * gdb-add-index.sh: Add error checking. Index: gdb-add-index.sh =================================================================== RCS file: /cvs/src/src/gdb/gdb-add-index.sh,v retrieving revision 1.1 diff -u -r1.1 gdb-add-index.sh --- gdb-add-index.sh 30 Jul 2010 20:46:34 -0000 1.1 +++ gdb-add-index.sh 5 Aug 2010 19:46:00 -0000 @@ -19,11 +19,19 @@ file="$1" dir="${file%/*}" -gdb --batch-silent -ex "file $file" -ex "save gdb-index $dir" +gdb --batch-silent -ex "file $file" -ex "save gdb-index $dir" || { + # Just in case. + rm -f "${file}.gdb-index" + exit 1 +} +# In some situation gdb can exit without creating an index. This is +# not an error. +status=0 if test -f "${file}.gdb-index"; then objcopy --add-section .gdb_index="${file}.gdb-index" --set-section-flags .gdb_index=readonly "$file" "$file" + status=$? rm -f "${file}.gdb-index" fi -exit 0 +exit $status