From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20031 invoked by alias); 9 Apr 2011 15:23:12 -0000 Received: (qmail 20023 invoked by uid 22791); 9 Apr 2011 15:23:11 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BJ,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; Sat, 09 Apr 2011 15:23:04 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p39FN3Cu016394 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 9 Apr 2011 11:23:03 -0400 Received: from host1.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p39FN1I2011676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 9 Apr 2011 11:23:03 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p39FN1Pl013208 for ; Sat, 9 Apr 2011 17:23:01 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p39FN0h4013207 for gdb-patches@sourceware.org; Sat, 9 Apr 2011 17:23:00 +0200 Date: Sat, 09 Apr 2011 15:23:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [commit] Fix crash of gdb save-index on a STABS file Message-ID: <20110409152300.GA13143@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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: 2011-04/txt/msg00138.txt.bz2 Hi, checked in, index saving functions crashed on NULL psymtabs_addrmap. Running gdb/testsuite/gdb.stabs/gdb11479.exp ... -gdb compile failed, gdb/cc-with-index.sh: line 107: 3487 Segmentation fault (core dumped) $GDB --batch-silent -nx -ex "file $output_file" -ex "save gdb-index $output_dir" -UNTESTED: gdb.stabs/gdb11479.exp: gdb11479.exp -gdb compile failed, cc-with-index.sh: Index file gdb/testsuite.unix.-m32/gdb.stabs/gdb11479.gdb-index exists, won't clobber. -UNTESTED: gdb.stabs/gdb11479.exp: gdb11479.exp +PASS: gdb.stabs/gdb11479.exp: Set breakpoints forced_stabs [...] +PASS: gdb.stabs/gdb11479.exp: sizeof (e) in test natural_debug_format No regressions on {x86_64,x86_64-m32,i686}-fedora15-linux-gnu. There are some concerns what is a file uses both DWARF and STABS, it may possibly currently have a regression with .gdb_index. But that is unrelated to this patch. Thanks, Jan http://sourceware.org/ml/gdb-cvs/2011-04/msg00061.html --- src/gdb/ChangeLog 2011/04/09 11:15:28 1.12915 +++ src/gdb/ChangeLog 2011/04/09 15:20:37 1.12916 @@ -1,5 +1,11 @@ 2011-04-09 Jan Kratochvil + Fix crash of gdb save-index on a STABS file. + * dwarf2read.c (write_psymtabs_to_index): Return also on no + PSYMTABS_ADDRMAP. + +2011-04-09 Jan Kratochvil + Fix DW_AT_accessibility compatibility with gcc-4.6+. * dwarf2read.c: Include ctype.h. (producer_is_gxx_lt_4_6, dwarf2_default_access_attribute): New --- src/gdb/dwarf2read.c 2011/04/09 11:15:29 1.522 +++ src/gdb/dwarf2read.c 2011/04/09 15:20:38 1.523 @@ -15843,8 +15843,9 @@ htab_t cu_index_htab; struct psymtab_cu_index_map *psymtab_cu_index_map; - if (!objfile->psymtabs) + if (!objfile->psymtabs || !objfile->psymtabs_addrmap) return; + if (dwarf2_per_objfile->using_index) error (_("Cannot use an index to create the index"));