From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32520 invoked by alias); 21 Jan 2011 13:20:29 -0000 Received: (qmail 32501 invoked by uid 22791); 21 Jan 2011 13:20:28 -0000 X-SWARE-Spam-Status: No, hits=-6.2 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; Fri, 21 Jan 2011 13:20:03 +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 p0LDK0Vs000403 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 21 Jan 2011 08:20:01 -0500 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0LDJwow026721 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 21 Jan 2011 08:20:00 -0500 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p0LDJw0M019897; Fri, 21 Jan 2011 14:19:58 +0100 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id p0LDJvnf019886; Fri, 21 Jan 2011 14:19:57 +0100 Date: Fri, 21 Jan 2011 13:31:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org, Doug Evans Subject: .gdb_index version 4? [Re: [commit] fix symtab/12302] Message-ID: <20110121131956.GA1999@host1.dyn.jankratochvil.net> References: <20101208191549.1E09C2461AD@ruffy.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101208191549.1E09C2461AD@ruffy.mtv.corp.google.com> 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-01/txt/msg00438.txt.bz2 On Wed, 08 Dec 2010 20:15:49 +0100, Doug Evans wrote: > fyi, I've committed this fix to symtab/12302. > It changes address table generation to be a simple dump of the current > addrmap. This means there exist .gdb_indexes out there (such as whole Fedora 14) which break GDB behavior (I could not list glibc sources today before -readnow). Do you agree with upgrading the index version, Tom? Also thanks for the fix, Doug. Thanks, Jan gdb/ 2011-01-21 Jan Kratochvil * dwarf2read.c (dwarf2_read_index, write_psymtabs_to_index) (save_gdb_index_command): Switch to .gdb_index version 4. --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2024,13 +2024,14 @@ dwarf2_read_index (struct objfile *objfile) /* Version check. */ version = MAYBE_SWAP (*(offset_type *) addr); /* Versions earlier than 3 emitted every copy of a psymbol. This - causes the index to behave very poorly for certain requests. So, - it seems better to just ignore such indices. */ - if (version < 3) + causes the index to behave very poorly for certain requests. Version 4 + contained incomplete addrmap. So, it seems better to just ignore such + indices. */ + if (version < 4) return 0; /* Indexes with higher version than the one supported by GDB may be no longer backward compatible. */ - if (version > 3) + if (version > 4) return 0; map = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct mapped_index); @@ -15688,7 +15689,7 @@ write_psymtabs_to_index (struct objfile *objfile, const char *dir) total_len = size_of_contents; /* The version number. */ - val = MAYBE_SWAP (3); + val = MAYBE_SWAP (4); obstack_grow (&contents, &val, sizeof (val)); /* The offset of the CU list from the start of the file. */ @@ -15746,7 +15747,7 @@ write_psymtabs_to_index (struct objfile *objfile, const char *dir) 1. The file header. This is a sequence of values, of offset_type unless otherwise noted: - [0] The version number, currently 3. Versions 1 and 2 are + [0] The version number, currently 4. Versions 1, 2 and 3 are obsolete. [1] The offset, from the start of the file, of the CU list. [2] The offset, from the start of the file, of the types CU list.