From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21088 invoked by alias); 4 Dec 2009 18:02:46 -0000 Received: (qmail 21029 invoked by uid 22791); 4 Dec 2009 18:02:45 -0000 X-SWARE-Spam-Status: No, hits=0.3 required=5.0 tests=AWL,BAYES_00,KAM_STOCKTIP,SPF_HELO_PASS,SPF_PASS 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, 04 Dec 2009 18:02:39 +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 nB4I1ut1018807 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 4 Dec 2009 13:01:56 -0500 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 nB4I1uTT031251; Fri, 4 Dec 2009 13:01:56 -0500 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 nB4I1tmR020743; Fri, 4 Dec 2009 13:01:55 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id C8ADF378183; Fri, 4 Dec 2009 11:01:54 -0700 (MST) From: Tom Tromey To: Tristan Gingold Cc: gdb-patches@sourceware.org Subject: Re: [RFA] Make sym_read routines handle separate debug files References: <20091204124838.GA5764@ulanbator.act-europe.fr> Reply-To: tromey@redhat.com Date: Fri, 04 Dec 2009 18:02:00 -0000 In-Reply-To: <20091204124838.GA5764@ulanbator.act-europe.fr> (Tristan Gingold's message of "Fri, 4 Dec 2009 13:48:38 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (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: 2009-12/txt/msg00060.txt.bz2 >>>>> "Tristan" == Tristan Gingold writes: Tristan> Each object file reader is now responsible to read separate Tristan> debug files as they are object file dependant. Of course, in Tristan> the case of gnu .debuglink a common subprogram is used. You updated coffread and elfread, but the existing code in gdb does not depend on the format. So it seems to me that any other code defining sym_fns will regress. That is, dbxread, mipsread, somread, and xcoffread (I omitted machoread since I presume your later patch fixes that up). Could we not just keep the existing logic as a format-independent fallback? Or am I mistaken about something? Maybe it is impossible for those formats to have separate debug files? I know nothing of the details, I'm afraid. Tristan> + debugfile = find_separate_debug_file_by_buildid (objfile); If this is only meaningful for ELF, as it seems to be, then it seems we might as well put it in elfread.c. Tristan> +/* Add BFD as a separate debug file for OBJFILE. */ Tristan> + Tristan> +void Tristan> +symbol_file_add_separate (bfd *bfd, int symfile_flags, struct objfile *objfile) Tristan> +{ Tristan> + objfile->separate_debug_objfile = I'm wondering if this should have a sanity check and call internal_error if the separate debug objfile is already set. Tristan> @@ -2320,204 +2314,217 @@ reread_symbols (void) [...] Tristan> + /* The "mainline" parameter is a hideous hack; I think leaving it Tristan> + zero is OK since dbxread.c also does what it needs to do if Tristan> + objfile->global_psymbols.size is 0. */ Normally I wouldn't ask for changes in a simple reindentation (and there are other stale comments here that I didn't single out), but this particular comment seems relevant to the overall change. I suggest just removing it, but rewording would be ok too. Tom