From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15073 invoked by alias); 14 Feb 2003 14:57:57 -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 15061 invoked from network); 14 Feb 2003 14:57:56 -0000 Received: from unknown (HELO kerberos.suse.cz) (195.47.106.10) by 172.16.49.205 with SMTP; 14 Feb 2003 14:57:56 -0000 Received: from chimera.suse.cz (chimera.suse.cz [10.20.0.2]) by kerberos.suse.cz (SuSE SMTP server) with ESMTP id 4B7B559D35C; Fri, 14 Feb 2003 15:57:55 +0100 (CET) Received: from suse.cz (naga.suse.cz [10.20.1.16]) by chimera.suse.cz (8.11.0/8.11.0/SuSE Linux 8.11.0-0.4) with ESMTP id h1EEvt408104; Fri, 14 Feb 2003 15:57:55 +0100 X-Authentication-Warning: chimera.suse.cz: Host naga.suse.cz [10.20.1.16] claimed to be suse.cz Message-ID: <3E4D03F3.40103@suse.cz> Date: Fri, 14 Feb 2003 14:57:00 -0000 From: Michal Ludvig Organization: SuSE CR User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: cs, cz, en MIME-Version: 1.0 To: Daniel Berlin Cc: gdb , gcc@sources.redhat.com Subject: Reference to .debug_loc Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-02/txt/msg00232.txt.bz2 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. This time I realy can't see a way to find out at what position in the resulting (ie. linked from several ones) .debug_loc should I start reading for a given compilation unit. Should there be something more in the CU header? Something similar to .long .Ldebug_abbrev0 # Offset Into Abbrev. Section For example .long .Ldebug_loc0 # Offset Into Loclist Section Or is there another way? Thanks in advance! Michal Ludvig -- * SuSE CR, s.r.o * mludvig@suse.cz * (+420) 296.545.373 * http://www.suse.cz