From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9694 invoked by alias); 14 Feb 2003 19:51:35 -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 9682 invoked from network); 14 Feb 2003 19:51:34 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 172.16.49.205 with SMTP; 14 Feb 2003 19:51:34 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18jnkx-0000oI-00; Fri, 14 Feb 2003 15:52:28 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18jlro-0002zj-00; Fri, 14 Feb 2003 14:51:24 -0500 Date: Fri, 14 Feb 2003 19:51:00 -0000 From: Daniel Jacobowitz To: Daniel Berlin Cc: Michal Ludvig , gdb , gcc@gcc.gnu.org Subject: Re: Reference to .debug_loc Message-ID: <20030214195124.GA11479@nevyn.them.org> Mail-Followup-To: Daniel Berlin , Michal Ludvig , gdb , gcc@gcc.gnu.org References: <20030214152619.GD30416@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i X-SW-Source: 2003-02/txt/msg00244.txt.bz2 On Fri, Feb 14, 2003 at 02:24:43PM -0500, Daniel Berlin wrote: > > On Friday, February 14, 2003, at 10:26 AM, Daniel Jacobowitz wrote: > > >On Fri, Feb 14, 2003 at 03:57:55PM +0100, Michal Ludvig wrote: > >>Hi again, > >>when location lists are in use, .debug_info looks like this: > >> > >> .section .debug_info > >> .long 0x187 # Length of Compilation Unit Info > >> .value 0x2 # DWARF version number > >> .long .Ldebug_abbrev0 # Offset Into Abbrev. Section > >> .byte 0x8 # Pointer Size (in bytes) > >> .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit) > >> .long .Ldebug_line0 # DW_AT_stmt_list > >> .quad .Letext0 # DW_AT_high_pc > >> .quad .Ltext0 # DW_AT_low_pc > >> .byte 0x1 # DW_AT_language > >> [...] > >> .uleb128 0x3 # (DIE (0x50) DW_TAG_formal_parameter) > >> .long .LASF2 # DW_AT_name: "value" > >> .byte 0x1 # DW_AT_decl_file > >> .byte 0x2 # DW_AT_decl_line > >> .long 0x8f # DW_AT_type > >> .long .LLST0-.Ldebug_loc0 # DW_AT_location > >> > >>So, the reference to .debug_loc on the last line of the example > >>(DW_AT_location) is an offset within that section, ie. it's 0 (NULL) > >>for > >>the first entry with a location list. However when I link several .o > >>files together, each of them have DW_AT_location entries based at the > >>same NULL. > >> > > Err, why? > If they are in different files, it should be adjusting the offsets when > it merges the sections together, no? Look at that operand. It's the difference of two local labels - it gets resolved at assembly time. > >>Or is there another way? > > > >At a guess it should be like DW_AT_ranges: > > .long .Ldebug_ranges0+0x0 # DW_AT_ranges > > > >I.E. dw2_asm_output_offset, rather than dw2_asm_output_delta, in GCC. > > > > It's supposed to be the offset from the beginning of the debug_loc > section. > Will this do that? I think so. The result will be something like .Ldebug_ranges0 + (.LLST0-.Ldebug_loc0). If the assembler won't take that then we'll have to track addresses for loclists the same as we do for rangelists. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer