This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Possible dwarfout.c patch.



I'm nervous about this one, but...

In the DWARF I standard, it says that the .debug_aranges info for each
compilation unit should start with three fields:

	4 bytes : Length of information, not including this field
	1 byte  : Version (1)
        4 bytes : Offset of compilation unit's info in .debug

But gcc only seems to generate the last of these.  Am I missing
something?  The patch below gives the output I was expecting.

Richard

2001-02-23   Richard Sandiford   <rsandifo@redhat.com>

	* dwarfout.c (DEBUG_ARANGES_BEGIN_LABEL): New label.
	(DEBUG_ARANGES_END_LABEL): Ditto.
	(dwarfout_init): Generate length and version fields at the start
	of the .debug_aranges info.  Insert DEBUG_ARANGES_BEGIN_LABEL
	after the length field.
	(dwarfout_finish): Insert DEBUG_ARANGED_END_LABEL at the end of
	the .debug_aranges info.

Index: ./gcc/dwarfout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarfout.c,v
retrieving revision 1.80
diff -c -p -d -r1.80 dwarfout.c
*** ./gcc/dwarfout.c	2001/02/21 14:42:18	1.80
--- ./gcc/dwarfout.c	2001/02/23 15:31:28
*************** static void retry_incomplete_types	PARAM
*** 551,556 ****
--- 551,563 ----
  #define MACINFO_BEGIN_LABEL	"*.L_macinfo_b"
  #endif

+ #ifndef DEBUG_ARANGES_BEGIN_LABEL
+ #define DEBUG_ARANGES_BEGIN_LABEL "*.L_debug_aranges_begin"
+ #endif
+ #ifndef DEBUG_ARANGES_END_LABEL
+ #define DEBUG_ARANGES_END_LABEL "*.L_debug_aranges_end"
+ #endif
+
  #ifndef DIE_BEGIN_LABEL_FMT
  #define DIE_BEGIN_LABEL_FMT	"*.L_D%u"
  #endif
*************** dwarfout_init (asm_out_file, main_input_
*** 5778,5783 ****
--- 5785,5795 ----

        fputc ('\n', asm_out_file);
        ASM_OUTPUT_PUSH_SECTION (asm_out_file, ARANGES_SECTION);
+       ASM_OUTPUT_DWARF_DELTA4 (asm_out_file,
+ 			       DEBUG_ARANGES_END_LABEL,
+ 			       DEBUG_ARANGES_BEGIN_LABEL);
+       ASM_OUTPUT_LABEL (asm_out_file, DEBUG_ARANGES_BEGIN_LABEL);
+       ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 1);
        ASM_OUTPUT_DWARF_ADDR (asm_out_file, DEBUG_BEGIN_LABEL);
        ASM_OUTPUT_POP_SECTION (asm_out_file);
      }
*************** dwarfout_finish ()
*** 5983,5988 ****
--- 5995,6001 ----
        ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0);
        ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0);

+       ASM_OUTPUT_LABEL (asm_out_file, DEBUG_ARANGES_END_LABEL);
        ASM_OUTPUT_POP_SECTION (asm_out_file);
      }





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]