Section .debug_info in object file
Keith.Walker
Keith.Walker@arm.com
Mon Sep 16 08:11:00 GMT 2002
More information about the Binutils mailing list
Mon Sep 16 08:11:00 GMT 2002
- Previous message (by thread): Section .debug_info in object file
- Next message (by thread): Section .debug_info in object file
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message (by thread): Section .debug_info in object file
- Next message (by thread): Section .debug_info in object file
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list