From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8044 invoked by alias); 18 Apr 2011 17:31:42 -0000 Received: (qmail 8033 invoked by uid 22791); 18 Apr 2011 17:31:41 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BJ,TW_FN,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; Mon, 18 Apr 2011 17:31:23 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3IHVMIa030638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 18 Apr 2011 13:31:22 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p3IHVMKk010426; Mon, 18 Apr 2011 13:31:22 -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 p3IHVLLC015840; Mon, 18 Apr 2011 13:31:21 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 6040F37930B; Mon, 18 Apr 2011 11:31:21 -0600 (MDT) From: Tom Tromey To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [patch+7.3] gdbindex regression: stabs forgotten [Fix crash of gdb save-index on a STABS file] References: <20110409152300.GA13143@host1.jankratochvil.net> <20110417163126.GA23189@host1.jankratochvil.net> Date: Mon, 18 Apr 2011 17:31:00 -0000 In-Reply-To: <20110417163126.GA23189@host1.jankratochvil.net> (Jan Kratochvil's message of "Sun, 17 Apr 2011 18:31:26 +0200") 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: 2011-04/txt/msg00284.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: Tom> On the reader side, the code in elfread.c is written to read STABS Tom> first -- and skip using the index if any are found. This handles the Tom> problem that an objfile can only have one set of quick functions. Jan> I do not see it implemented. This is a regression. I must have dropped something somewhere along the line, oops. Or maybe I just botched the logic when I added lazy psymtabs. Jan> if (dwarf2_has_info (objfile)) Jan> { Jan> - if (dwarf2_initialize_objfile (objfile)) Jan> + /* elf_sym_fns_gdb_index cannot handle simultaneous non-DWARF debug Jan> + information present in OBJFILE. If there is such debug info present Jan> + never use .gdb_index. */ Jan> + Jan> + if (!objfile_has_partial_symbols (objfile) Jan> + && dwarf2_initialize_objfile (objfile)) This makes the case of "stabs, plus gnu index, plus -readnow" a little worse. It is hard to imagine anybody caring about this kind of thing though. I just thought it was funny. Jan> /* If we have not read psymbols, but we have a function capable of Jan> reading them, then that is an indication that they are in fact Jan> available. */ Jan> - if ((objfile->flags & OBJF_PSYMTABS_READ) == 0) Jan> - return objfile->sf->sym_read_psymbols != NULL; Jan> + if ((objfile->flags & OBJF_PSYMTABS_READ) == 0 Jan> + && objfile->sf->sym_read_psymbols != NULL) Jan> + return 1; I think this change requires an update to the comment and also maybe to the corresponding comment in symfile.h. Tom