From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21853 invoked by alias); 16 Sep 2002 10:10:22 -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 21840 invoked from network); 16 Sep 2002 10:10:20 -0000 Received: from unknown (HELO fw-maid.maidenhead.arm.com) (194.201.77.34) by sources.redhat.com with SMTP; 16 Sep 2002 10:10:20 -0000 Received: by fw-maid.maidenhead.arm.com; id LAA22151; Mon, 16 Sep 2002 11:03:54 +0100 Received: from mhsun1.maidenhead.arm.com(192.168.2.10) by fw-maid.maidenhead.arm.com via smap (V5.0) id xma022044; Mon, 16 Sep 02 11:03:22 +0100 Received: from mhpc6 (mhpc6 [192.168.2.53]) by mhsun1.maidenhead.arm.com (8.9.3/8.9.3) with SMTP id LAA12331; Mon, 16 Sep 2002 11:09:47 +0100 (BST) Message-Id: <4.1.20020916105507.02b9c080@mhsun1.maidenhead.arm.com> X-Sender: kwalker@mhsun1.maidenhead.arm.com Date: Mon, 16 Sep 2002 03:10:00 -0000 To: Pierre Habraken , binutils@sources.redhat.com, gdb@sources.redhat.com From: "Keith.Walker" Subject: Re: Section .debug_info in object file In-Reply-To: <3D832247.D1F4ECBC@imag.fr> References: <4.1.20020912105556.01e79f10@mhsun1.maidenhead.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2002-09/txt/msg00196.txt.bz2 At 01:49 PM 14-09-02 +0200, Pierre Habraken wrote: >In any case, I wonder what is the exact purpose of the option --gdwarf2 >of gas ? : >On one hand, if it is supposed to make the .debug_info section be >generated, the latter should include all relevant debugging information. >On the other hand, if it not supposed to make the .debug_info section be >created, what is its use ? When the assembler is invoked by the compiler to assemble the code generated for compiled sources the assembler should NOT be invoked with the -gdwarf2. The compiler supplies the DWARF2 debugging information for the sources being compiled by the compiler. It is therefore the responsibility of the compiler to supply the DWARF2 information to describe the source file being compiled. When the assembler is being invoked to assembler user supplied assembler files then the -gdwarf2 flag can be used to make the assembler generate the DWARF2 debugging information which describes the assembler file. [This is primarily the line to address table.] In this case it is the responsibility of the assembler to supply the DWARF2 information to describe the file being assembled. >I also noticed that option -g passed to the C compiler is sufficient for >getting a .debug_info section. So my question is : why would I use the >option -gdwarf-2 instead of -g ?... gcc can be build for different targets (e.g. arm-elf-gcc, arm-linux-gcc). When you use -g the compiler will generate the debugging information in the default format for the appropriate target. For arm-elf-gcc this is usually DWARF2 and for arm-linux-gcc this is usually STABS. The -gdwarf2 flag therefore overides the default format and explicitly specifies that DWARF2 debuggging information is required. Keith Keith Walker keith.walker@arm.com Tel:+44 (1628) 427732 ARM Ltd http://www.arm.com