From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22579 invoked by alias); 12 Sep 2008 15:56:49 -0000 Received: (qmail 22569 invoked by uid 22791); 12 Sep 2008 15:56:49 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 12 Sep 2008 15:56:10 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 2F6AC1049C; Fri, 12 Sep 2008 15:56:08 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 18DF6101C3; Fri, 12 Sep 2008 15:56:08 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KeB0B-0003yL-G3; Fri, 12 Sep 2008 11:56:07 -0400 Date: Fri, 12 Sep 2008 15:56:00 -0000 From: Daniel Jacobowitz To: Doug Evans Cc: gdb@sourceware.org Subject: Re: dwarf2read.c: passing objfile as parameter? Message-ID: <20080912155607.GA15222@caradoc.them.org> Mail-Followup-To: Doug Evans , gdb@sourceware.org References: <20080912060152.F10F01C789F@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080912060152.F10F01C789F@localhost> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-09/txt/msg00073.txt.bz2 On Thu, Sep 11, 2008 at 11:01:52PM -0700, Doug Evans wrote: > While passing parameters in globals Is Bad (tm), is there any reason > to keep passing objfile around instead of storing it in > dwarf2_per_objfile? > > E.g. dwarf2_find_containing_comp_unit takes objfile as a parameter: > > static struct dwarf2_per_cu_data * > dwarf2_find_containing_comp_unit (unsigned long offset, > struct objfile *objfile) > > but it also references dwarf2_per_objfile: > > high = dwarf2_per_objfile->n_comp_units - 1; > > Is there a reason why objfile isn't recorded in dwarf2_per_objfile? The only one I can think of is that in some cases cross-objfile DWARF references are possible; but GDB doesn't support that, GCC doesn't either, and it doesn't seem very likely. -- Daniel Jacobowitz CodeSourcery