From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 872 invoked by alias); 31 Jul 2003 16:16:23 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 865 invoked from network); 31 Jul 2003 16:16:22 -0000 Received: from unknown (HELO sccrmhc12.comcast.net) (204.127.202.56) by sources.redhat.com with SMTP; 31 Jul 2003 16:16:22 -0000 Received: from lucon.org ([12.234.88.5]) by comcast.net (sccrmhc12) with ESMTP id <2003073116161901200lnbnue>; Thu, 31 Jul 2003 16:16:19 +0000 Received: by lucon.org (Postfix, from userid 1000) id 18D2C2C4EB; Thu, 31 Jul 2003 16:16:19 +0000 (UTC) Date: Thu, 31 Jul 2003 16:16:00 -0000 From: "H. J. Lu" To: GDB Subject: A hack for DW_FORM_ref_addr Message-ID: <20030731161619.GA12251@lucon.org> References: <20030730214252.GA26082@lucon.org> <20030730214503.GA15350@nevyn.them.org> <20030730215227.GA26318@lucon.org> <20030730215509.GA15640@nevyn.them.org> <20030731051653.GB1170@lucon.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030731051653.GB1170@lucon.org> User-Agent: Mutt/1.4.1i X-SW-Source: 2003-07/txt/msg00370.txt.bz2 On Wed, Jul 30, 2003 at 10:16:53PM -0700, H. J. Lu wrote: > > > > > > While waiting for your new DWARF reader, I will see how my hack > > > goes :-(. > > > > Since the die table is hashed by offset (isn't it?), presumably very > > badly. > > It is OK for different compilation units within the same .debug_info > section. > > FYI, this is the hack I am going to try. H.J. ---- 2003-07-31 H.J. Lu * dwarf2read.c (dwarf2_build_psymtabs_hard): Read in all compilation units. (read_comp_unit): Don't reset die reference table if abfd is not changed. --- gdb/dwarf2read.c.ref 2003-07-30 09:43:51.000000000 -0700 +++ gdb/dwarf2read.c 2003-07-31 08:11:23.000000000 -0700 @@ -1195,6 +1195,7 @@ dwarf2_build_psymtabs_hard (struct objfi struct partial_symtab *pst; struct cleanup *back_to; CORE_ADDR lowpc, highpc; + struct die_info *dies; info_ptr = dwarf_info_buffer; abbrev_ptr = dwarf_abbrev_buffer; @@ -1280,6 +1281,8 @@ dwarf2_build_psymtabs_hard (struct objfi dwarf2_read_abbrevs (abfd, &cu_header); make_cleanup (dwarf2_empty_abbrev_table, cu_header.dwarf2_abbrevs); + dies = read_comp_unit (info_ptr, abfd, &cu_header); + /* Read the compilation unit die */ info_ptr = read_partial_die (&comp_unit_die, abfd, info_ptr, &cu_header); @@ -3653,10 +3656,17 @@ read_comp_unit (char *info_ptr, bfd *abf struct die_info *first_die, *last_die, *die; char *cur_ptr; int nesting_level; + static bfd *bfd_die_ref_table; + + if (!bfd_die_ref_table) + bfd_die_ref_table = abfd; - /* Reset die reference table; we are - building new ones now. */ - dwarf2_empty_hash_tables (); + if (bfd_die_ref_table != abfd) + { + bfd_die_ref_table = abfd; + /* Reset die reference table; we are building new ones now. */ + dwarf2_empty_hash_tables (); + } cur_ptr = info_ptr; nesting_level = 0;