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]

dwarf2out tweak


This patch removes one dependency on DW_AT_MIPS_linkage_name, which I'd
like to see go away eventually.  Of course, the code in question isn't
currently hit, so this is only cosmetic.  Applied.

Thu Sep 23 13:40:02 1999  Jason Merrill  <jason@yorick.cygnus.com>

	* dwarf2out.c (output_aranges): Use DW_AT_location to find the
	symbol for a variable.

Index: dwarf2out.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/dwarf2out.c,v
retrieving revision 1.114
diff -c -p -r1.114 dwarf2out.c
*** dwarf2out.c	1999/09/09 21:36:19	1.114
--- dwarf2out.c	1999/09/23 20:48:10
*************** output_aranges ()
*** 5687,5715 ****
    fputc ('\n', asm_out_file);
    for (i = 0; i < arange_table_in_use; ++i)
      {
!       dw_die_ref a = arange_table[i];
  
!       if (a->die_tag == DW_TAG_subprogram)
! 	ASM_OUTPUT_DWARF_ADDR (asm_out_file, get_AT_low_pc (a));
        else
  	{
! 	  char *name = get_AT_string (a, DW_AT_MIPS_linkage_name);
! 	  if (! name)
! 	    name = get_AT_string (a, DW_AT_name);
  
! 	  ASM_OUTPUT_DWARF_ADDR (asm_out_file, name);
  	}
  
        if (flag_debug_asm)
  	fprintf (asm_out_file, "\t%s Address", ASM_COMMENT_START);
  
        fputc ('\n', asm_out_file);
!       if (a->die_tag == DW_TAG_subprogram)
! 	ASM_OUTPUT_DWARF_ADDR_DELTA (asm_out_file, get_AT_hi_pc (a),
! 				     get_AT_low_pc (a));
        else
  	ASM_OUTPUT_DWARF_ADDR_DATA (asm_out_file,
! 				    get_AT_unsigned (a, DW_AT_byte_size));
  
        if (flag_debug_asm)
  	fprintf (asm_out_file, "%s Length", ASM_COMMENT_START);
--- 5687,5724 ----
    fputc ('\n', asm_out_file);
    for (i = 0; i < arange_table_in_use; ++i)
      {
!       dw_die_ref die = arange_table[i];
  
!       if (die->die_tag == DW_TAG_subprogram)
! 	ASM_OUTPUT_DWARF_ADDR (asm_out_file, get_AT_low_pc (die));
        else
  	{
! 	  /* A static variable; extract the symbol from DW_AT_location.
! 	     Note that this code isn't currently hit, as we only emit
! 	     aranges for functions (jason 9/23/99).  */
! 
! 	  dw_attr_ref a = get_AT (die, DW_AT_location);
! 	  dw_loc_descr_ref loc;
! 	  if (! a || a->dw_attr_val.val_class != dw_val_class_loc)
! 	    abort ();
! 
! 	  loc = a->dw_attr_val.v.val_loc;
! 	  if (loc->dw_loc_opc != DW_OP_addr)
! 	    abort ();
  
! 	  ASM_OUTPUT_DWARF_ADDR (asm_out_file, loc->dw_loc_oprnd1.v.val_addr);
  	}
  
        if (flag_debug_asm)
  	fprintf (asm_out_file, "\t%s Address", ASM_COMMENT_START);
  
        fputc ('\n', asm_out_file);
!       if (die->die_tag == DW_TAG_subprogram)
! 	ASM_OUTPUT_DWARF_ADDR_DELTA (asm_out_file, get_AT_hi_pc (die),
! 				     get_AT_low_pc (die));
        else
  	ASM_OUTPUT_DWARF_ADDR_DATA (asm_out_file,
! 				    get_AT_unsigned (die, DW_AT_byte_size));
  
        if (flag_debug_asm)
  	fprintf (asm_out_file, "%s Length", ASM_COMMENT_START);
*************** add_name_and_src_coords_attributes (die,
*** 7682,7687 ****
--- 7691,7697 ----
      {
        add_name_attribute (die, dwarf2_name (decl, 0));
        add_src_coords_attributes (die, decl);
+ 
        if ((TREE_CODE (decl) == FUNCTION_DECL || TREE_CODE (decl) == VAR_DECL)
  	  && DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl))
  	add_AT_string (die, DW_AT_MIPS_linkage_name,
*************** gen_variable_die (decl, context_die)
*** 8653,8659 ****
    else if (old_die && TREE_STATIC (decl)
   	   && get_AT_flag (old_die, DW_AT_declaration) == 1)
      {
!       /* ??? This is an instantiation of a C++ class level static.  */
        add_AT_die_ref (var_die, DW_AT_specification, old_die);
        if (DECL_NAME (decl))
  	{
--- 8663,8669 ----
    else if (old_die && TREE_STATIC (decl)
   	   && get_AT_flag (old_die, DW_AT_declaration) == 1)
      {
!       /* This is a definition of a C++ class level static.  */
        add_AT_die_ref (var_die, DW_AT_specification, old_die);
        if (DECL_NAME (decl))
  	{
*************** dwarf2out_finish ()
*** 10164,10169 ****
--- 10174,10181 ----
        output_pubnames ();
      }
  
+   /* We only put functions in the arange table, so don't write it out if
+      we don't have any.  */
    if (fde_table_in_use)
      {
        /* Output the address range information.  */


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