From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24092 invoked by alias); 12 Sep 2008 06:02:38 -0000 Received: (qmail 24080 invoked by uid 22791); 12 Sep 2008 06:02:37 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out3.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 12 Sep 2008 06:02:02 +0000 Received: from zps19.corp.google.com (zps19.corp.google.com [172.25.146.19]) by smtp-out3.google.com with ESMTP id m8C61s0u022767 for ; Fri, 12 Sep 2008 07:01:55 +0100 Received: from localhost (ruffy.corp.google.com [172.18.118.116]) by zps19.corp.google.com with ESMTP id m8C61r9E019612 for ; Thu, 11 Sep 2008 23:01:53 -0700 Received: by localhost (Postfix, from userid 67641) id F10F01C789F; Thu, 11 Sep 2008 23:01:52 -0700 (PDT) To: gdb@sourceware.org Subject: dwarf2read.c: passing objfile as parameter? Message-Id: <20080912060152.F10F01C789F@localhost> Date: Fri, 12 Sep 2008 06:02:00 -0000 From: dje@google.com (Doug Evans) 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/msg00069.txt.bz2 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?