From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10256 invoked by alias); 12 Sep 2002 11:46:33 -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 10127 invoked from network); 12 Sep 2002 11:46:31 -0000 Received: from unknown (HELO fw-maid.maidenhead.arm.com) (194.201.77.34) by sources.redhat.com with SMTP; 12 Sep 2002 11:46:31 -0000 Received: by fw-maid.maidenhead.arm.com; id MAA03374; Thu, 12 Sep 2002 12:39:41 +0100 Received: from mhsun1.maidenhead.arm.com(192.168.2.10) by fw-maid.maidenhead.arm.com via smap (V5.0) id xma003367; Thu, 12 Sep 02 12:39:31 +0100 Received: from mhpc6 (mhpc6 [192.168.2.53]) by mhsun1.maidenhead.arm.com (8.9.3/8.9.3) with SMTP id MAA28371; Thu, 12 Sep 2002 12:45:56 +0100 (BST) Message-Id: <4.1.20020912105556.01e79f10@mhsun1.maidenhead.arm.com> X-Sender: kwalker@mhsun1.maidenhead.arm.com Date: Thu, 12 Sep 2002 04:46:00 -0000 To: binutils@sources.redhat.com, gdb@sources.redhat.com From: "Keith.Walker" Subject: Re: Section .debug_info in object file Cc: Pierre Habraken In-Reply-To: <3D806189.7A45FCBA@imag.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2002-09/txt/msg00109.txt.bz2 >Knowing that rises several questions: > >- what is the structure of a '.debug_info' section ? > Is this structure documented somewhere ? Yes ..... The web site http://www.eagercon.com/dwarf/dwarf3std.htm contains both the original DWARF2 specification and the (almost) current DWARF3 draft. [A later draft can be found at http://reality.sgiweb.org/davea/dwarf3-draft8-011125.pdf ] >- which tool can be used to examine the contents of a '.debug_info' > section ? I tried to use arm-elf-objdump but the result which it > displays is not formatted and checking it is not easy... Try arm-elf-readelf >- is there a way to force gas to include a field 'DW_AT_name' in the > object files it produces ? > (an option on the command line ? a directive inside the source file ?) I haven't looked but I suspect there isn't a command line option; more likely this will require a source change in binutils. >- why would gdb be not able to retrieve an assembly language source file > (together with its name) as long as no breakpoint is set by the user > within this file, where it is able to retrieve this same source file > as soon as a first breakpoint is set (though the name of the source > file is not present in the object file) ?... The following is only what I suspect is happening (I haven't actually looked at the code). On initial load the debugger uses the DW_AT_name attribute specified in the DW_TAG_compile_unit tags in order to determine the names of the initial source files. As there is no DW_AT_name for assembler files they aren't added to the initial list of source files. However when a breakpoint is set it reads the line number table for the area/region in which the addess is located; the line number contains the names of all the files associated with that table. Therefore at this point it now knows about the assembler file. Keith Keith Walker keith.walker@arm.com Tel:+44 (1628) 427732 ARM Ltd http://www.arm.com