From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 303 invoked by alias); 30 Jul 2003 21:45:07 -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 32764 invoked from network); 30 Jul 2003 21:45:07 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 30 Jul 2003 21:45:07 -0000 Received: from drow by nevyn.them.org with local (Exim 4.20 #1 (Debian)) id 19hykp-00040D-GI; Wed, 30 Jul 2003 17:45:03 -0400 Date: Wed, 30 Jul 2003 21:45:00 -0000 From: Daniel Jacobowitz To: "H. J. Lu" Cc: GDB Subject: Re: DW_FORM_ref_addr dosn't work Message-ID: <20030730214503.GA15350@nevyn.them.org> Mail-Followup-To: "H. J. Lu" , GDB References: <20030730214252.GA26082@lucon.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030730214252.GA26082@lucon.org> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-07/txt/msg00349.txt.bz2 On Wed, Jul 30, 2003 at 02:42:52PM -0700, H. J. Lu wrote: > DW_FORM_ref_addr can reference an entry in a different compilation > unit, even from a different shared object. But die_ref_table only > contains DIEs in one single compilation unit. Why do we do that? What > is the best way to fix it? > > BTW, I am enclosing my quick dirty hack for reference. Please read any of the thirty-some discussions of this in the list archives. I'm working on it in my spare time, of which I have not had enough to make much progress. The DWARF reader needs to be essentially rewritten. > > > H.J. > ---- > --- dwarf2read.c.ref 2003-07-30 09:43:51.000000000 -0700 > +++ dwarf2read.c 2003-07-30 14:41:24.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); > @@ -3654,9 +3657,11 @@ read_comp_unit (char *info_ptr, bfd *abf > char *cur_ptr; > int nesting_level; > > +#if 0 > /* Reset die reference table; we are > building new ones now. */ > dwarf2_empty_hash_tables (); > +#endif > > cur_ptr = info_ptr; > nesting_level = 0; > -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer