From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 456 invoked by alias); 15 Sep 2002 09:25:36 -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 439 invoked from network); 15 Sep 2002 09:25:33 -0000 Received: from unknown (HELO mailsrv.otenet.gr) (195.170.0.5) by sources.redhat.com with SMTP; 15 Sep 2002 09:25:33 -0000 Received: from neutrino.particles.org (athe535-b157.otenet.gr [62.103.190.157]) by mailsrv.otenet.gr (8.12.4/8.12.4) with ESMTP id g8F9PI5l004146; Sun, 15 Sep 2002 12:25:21 +0300 (EEST) Received: (from anteater@localhost) by neutrino.particles.org (8.11.6/8.11.6) id g8F9gwX01338; Sun, 15 Sep 2002 12:42:58 +0300 Date: Sun, 15 Sep 2002 02:25:00 -0000 From: Elias Athanasopoulos To: Richard Henderson Cc: Pierre Habraken , binutils@sources.redhat.com, gdb@sources.redhat.com, Richard.Earnshaw@arm.com Subject: Re: [PATCH] Re: Section .debug_info in object file Message-ID: <20020915124258.A1134@neutrino.particles.org> References: <3D806189.7A45FCBA@imag.fr> <20020912220303.A1134@neutrino.particles.org> <20020912205434.GA20375@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020912205434.GA20375@redhat.com>; from rth@redhat.com on Thu, Sep 12, 2002 at 01:54:34PM -0700 X-SW-Source: 2002-09/txt/msg00188.txt.bz2 Hi Richard, On Thu, Sep 12, 2002 at 01:54:34PM -0700, Richard Henderson wrote: > On Thu, Sep 12, 2002 at 10:03:03PM +0300, Elias Athanasopoulos wrote: > > * dwarf2dbg.c (out_debug_abbrev): Add support for the DW_AT_name field. > > (out_debug_info): Likewise. > > I suppose we could do something like this. > > But it seems to me that this is a gdb bug. The complete file+line > mapping is available in .debug_line. What purpose does the AT_name > field of the compilation unit serve? After some short investigation I concluded that gdb stores in the symtable along with the file name (which is taken from DW_AT_name) the lowpc field (DW_AT_low_pc). This happens inside dwarf2_build_psymtabs_hard(): /* Allocate a new partial symbol table structure */ pst = start_psymtab_common (objfile, objfile->section_offsets, comp_unit_die.name ? comp_unit_die.name : "", comp_unit_die.lowpc, objfile->global_psymbols.next, objfile->static_psymbols.next); I guess this information can be taken also from .debug_line. Do we want to build the symtable using .debug_line instead of .debug_info? Also, about my previous patch, gcc includes the DW_AT_name field in .debug_abbrev, but gas does not. So, readelf expects to find a DW_AT_name field in .debug_info section, which is created by gas. I believe that gas should export the DW_AT_name in the .debug_info section, otherwise utilities such as readelf will have problems parsing the debug information correctly. Elias -- http://gnewtellium.sourceforge.net MP3 is not a crime.