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]

[PATCH]: Fix macinfo output for dwarf2, update comments.


We never call the debug hooks for the primary input buffer (see
cb_file_change for why. This is also why we have all these tests for
(!initialized) in dwarf2out_debug_*, because we have no idea which is
going to start the primary source file first), so we of course, never
call debug_end_source_file, and thus, were not outputting a
DW_MACINFO_end_file for the end of the primary file.
I also updated the comments on the dwarf2out_debug_* functions to
better reflect reality.

2001-07-04  Daniel Berlin  <dan@cgsoftware.com>

	* dwarf2out.c (dwarf2out_define): Update comment.
	(dwarf2out_undef): Ditto.
	(dwarf2out_start_source_file): Ditto.
	(dwarf2out_end_source_file): Ditto.
	(dwarf2out_finish): Output DW_MACINFO_end_file for primary file,
	since we never call the start/end debug hook for the primary file.

Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/dwarf2out.c,v
retrieving revision 1.279
diff -c -3 -p -w -B -b -r1.279 dwarf2out.c
*** dwarf2out.c	2001/07/04 17:55:18	1.279
--- dwarf2out.c	2001/07/04 19:24:47
*************** dwarf2out_line (filename, line)
*** 11268,11275 ****
      }
  }
  
! /* Record the beginning of a new source file, for later output
!    of the .debug_macinfo section.*/
  
  void
  dwarf2out_start_source_file (lineno, filename)
--- 11268,11274 ----
      }
  }
  
! /* Record the beginning of a new source file. */
  
  void
  dwarf2out_start_source_file (lineno, filename)
*************** dwarf2out_start_source_file (lineno, fil
*** 11291,11298 ****
      }
  }
  
! /* Record the end of a source file, for later output
!    of the .debug_macinfo section.  At present, unimplemented.  */
  
  void
  dwarf2out_end_source_file ()
--- 11290,11296 ----
      }
  }
  
! /* Record the end of a source file.  */
  
  void
  dwarf2out_end_source_file ()
*************** dwarf2out_end_source_file ()
*** 11309,11315 ****
      }
  }
  
! /* Called from check_newline in c-parse.y.  The `buffer' parameter contains
     the tail part of the directive line, i.e. the part which is past the
     initial whitespace, #, whitespace, directive-name, whitespace part.  */
  
--- 11307,11313 ----
      }
  }
  
! /* Called from debug_define in toplev.c.  The `buffer' parameter contains
     the tail part of the directive line, i.e. the part which is past the
     initial whitespace, #, whitespace, directive-name, whitespace part.  */
  
*************** dwarf2out_define (lineno, buffer)
*** 11333,11339 ****
      }
  }
  
! /* Called from check_newline in c-parse.y.  The `buffer' parameter contains
     the tail part of the directive line, i.e. the part which is past the
     initial whitespace, #, whitespace, directive-name, whitespace part.  */
  
--- 11331,11337 ----
      }
  }
  
! /* Called from debug_undef in toplev.c.  The `buffer' parameter contains
     the tail part of the directive line, i.e. the part which is past the
     initial whitespace, #, whitespace, directive-name, whitespace part.  */
  
*************** dwarf2out_finish ()
*** 11564,11569 ****
--- 11562,11574 ----
        ASM_OUTPUT_SECTION (asm_out_file, DEBUG_LOC_SECTION);
        output_location_lists (die);
        have_location_lists = 0;
+     }
+ 
+   /* Have to end the primary source file. */
+   if (debug_info_level >= DINFO_LEVEL_VERBOSE)
+     { 
+       ASM_OUTPUT_SECTION (asm_out_file, DEBUG_MACINFO_SECTION);
+       dw2_asm_output_data (1, DW_MACINFO_end_file, "End file");
      }
    
  }


-- 
"So I figured I'd leave the area, because I had no ties there
anyway except for this girl I was seeing.  We had conflicting
attitudes:  I really wasn't into meditating and she wasn't
really into being alive.  I told her I knew when I was going to
die because my birth certificate has an expiration date.
"-Steven Wright


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