From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17281 invoked by alias); 21 Nov 2010 20:27:17 -0000 Received: (qmail 17272 invoked by uid 22791); 21 Nov 2010 20:27:16 -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; Sun, 21 Nov 2010 20:27:10 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oALKR9Wg022453 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 21 Nov 2010 15:27:09 -0500 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oALKR7aZ019311; Sun, 21 Nov 2010 15:27:08 -0500 Received: from host0.dyn.jankratochvil.net (localhost.localdomain [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id oALKR5v0019926; Sun, 21 Nov 2010 21:27:05 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id oALKR2sj019915; Sun, 21 Nov 2010 21:27:02 +0100 Date: Sun, 21 Nov 2010 20:27:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [patch] .gdb_index: Ignore higher versions Message-ID: <20101121202702.GA18217@host0.dyn.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: 2010-11/txt/msg00298.txt.bz2 Hi, currently introducing new .gdb_index version (latest is v3, so >=4) breaks all existing GDBs as they try too interpret the index format the old way. I have a reproducer here with some other patchset but I find it obvious. Sending for a comment as we could also introduce some versioning features for compatible/incompatible extensions. I do not think it is worth it. Thanks, Jan gdb/ 2010-11-21 Jan Kratochvil * dwarf2read.c (dwarf2_read_index): Ignore higher .gdb_index versions. --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1941,6 +1941,10 @@ dwarf2_read_index (struct objfile *objfile) it seems better to just ignore such indices. */ if (version < 3) return 0; + /* Indexes with higher version than the one supported by GDB may be no + longer backward compatible. */ + if (version > 3) + return 0; map = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct mapped_index); map->total_size = dwarf2_per_objfile->gdb_index.size;