From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3311 invoked by alias); 4 May 2006 18:26:57 -0000 Received: (qmail 3303 invoked by uid 22791); 4 May 2006 18:26:57 -0000 X-Spam-Check-By: sourceware.org Received: from hq.tensilica.com (HELO mailapp.tensilica.com) (65.205.227.29) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 04 May 2006 18:26:50 +0000 Received: from localhost ([127.0.0.1] ident=amavis) by mailapp.tensilica.com with esmtp (Exim 4.34) id 1FbiXG-0002l1-DR; Thu, 04 May 2006 11:26:46 -0700 Received: from mailapp.tensilica.com ([127.0.0.1]) by localhost (mailapp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 09171-03; Thu, 4 May 2006 11:26:46 -0700 (PDT) Received: from nose.hq.tensilica.com ([192.168.10.147]) by mailapp.tensilica.com with esmtp (Exim 4.34) id 1FbiXG-0002kv-0b; Thu, 04 May 2006 11:26:46 -0700 Message-ID: <445A4765.8010707@tensilica.com> Date: Thu, 04 May 2006 18:26:00 -0000 From: Ross Morley User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040805 Netscape/7.2 MIME-Version: 1.0 To: Daniel Jacobowitz CC: GDB List Subject: Re: Source info in discontiguous hand asm files References: <44595771.1070907@tensilica.com> <20060504015948.GA19834@nevyn.them.org> <4459C400.6040709@tensilica.com> <20060504124531.GA29440@nevyn.them.org> In-Reply-To: <20060504124531.GA29440@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00032.txt.bz2 Daniel Jacobowitz wrote: >On Thu, May 04, 2006 at 02:06:08AM -0700, Ross Morley wrote: > > >>Yes, it is correct, though not as extensive as it could be. >>In the case where there are multiple ranges of text in a compilation >>unit, DA_AT_{low,high}_pc is omitted from the CU per DWARF spec. >>Where there is only one range of text, those are present and correct. >>The assembler doesn't add function-specific info. >>There is info in the aranges table to associate the ranges with the >>compilation unit, so a scan of that table could provide it. >> >> > >The section .debug_info contains: > > Compilation Unit @ offset 0x0: > Length: 52 > Version: 2 > Abbrev Offset: 0 > Pointer Size: 8 > <0>: Abbrev Number: 1 (DW_TAG_compile_unit) > DW_AT_stmt_list : 0 > DW_AT_name : text.S > DW_AT_comp_dir : /home/drow/text > DW_AT_producer : GNU AS 2.16.91 > DW_AT_language : 32769 (MIPS assembler) > >>>From the DWARF standard: > >Compilation unit entries may have the following attributes: > >1. Either a DW_AT_low_pc and DW_AT_high_pc pair of attributes or a > DW_AT_ranges attribute whose values encode the contiguous or > non-contiguous address ranges, respectively, of the machine > instructions generated for the compilation unit (see Section 2.16). > > A DW_AT_low_pc attribute may also be specified in combination with > DW_AT_ranges to specify the default base address for use in location > lists (see Section 2.5.4) and range lists (see Section 2.16.3). > > Ah, DW_AT_ranges is in DWARF3, not DWARF2, so it's relatively new. >Now, there's a "may" there, so the compilation unit clearly isn't >required to have either. But GDB definitely expects a compilation unit >to have one or the other. It does not implement .debug_aranges >support. > > That I knew. And now it seems there's a better way. >So, your options are to use .debug_aranges to look up textlow/texthigh >for compilation units that don't have a PC range, or to modify gas to >emit DW_AT_ranges. The latter is likely to be easier. > > > Agreed. Thanks for your help. Ross