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]

Re: [RFA] Debug hooks


On Mon, 9 Jul 2001, Neil Booth wrote:

> > Will you be using this mechanism to get rid of the need for non-C front
> > ends to define flag_traditional for dwarfout.c/dwarf2out.c?  (I suggest an
> > enumeration for those languages known by at least one debug format, with a
> > catch-all "unknown" entry for front ends for other languages, then having
> > each debug format's code translate to e.g. DWARF2's list of source
> > languages.)
> 
> Hmm, I'm sure we can work something out :-) I've not looked at what
> you're referring to so far, though.

DWARF2 records the source language of each source file, and distinguishes
between K&R C, C89, and (in DWARF 2.1) C99.  dwarf2out.c uses
flag_traditional to tell what language to record, which means that e.g.  
the Java front end needs to define flag_traditional, but doesn't use it.  
Rather than using string comparisons on language_string then kludges like
this, the front ends should pass the language directly as an enumeration.

 From dwarf2out.c:

  if (strcmp (language_string, "GNU C++") == 0)
    language = DW_LANG_C_plus_plus;
  else if (strcmp (language_string, "GNU Ada") == 0)
    language = DW_LANG_Ada83;
  else if (strcmp (language_string, "GNU F77") == 0)
    language = DW_LANG_Fortran77;
  else if (strcmp (language_string, "GNU Pascal") == 0)
    language = DW_LANG_Pascal83;
  else if (strcmp (language_string, "GNU Java") == 0)
    language = DW_LANG_Java;
  else if (flag_traditional)
    language = DW_LANG_C;
  else
    language = DW_LANG_C89;

(readings.html doesn't seem to have a direct link to DWARF 2.1 work.  OK 
to commit the following patch?

Index: readings.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/readings.html,v
retrieving revision 1.55
diff -u -r1.55 readings.html
--- readings.html	2001/06/22 14:08:26	1.55
+++ readings.html	2001/07/09 21:34:52
@@ -421,6 +421,9 @@
 
   <li><a href="http://www.arm.com/armwww.ns4/img/12-Technical+Specs-ARM+ELF+Specification+PDF/$File/ARMELFA08.pdf";>ARM ELF ABI</a>
 
+  <li><a href="http://www.eagercon.com/dwarf/dwarf2std.htm";>DWARF 2.1
+  drafts</a></li>
+
   <li><a href="ftp://sgigate.sgi.com/pub/dwarf/";>DWARF v2 spec and sample implementation</a>
 
   <li><a href="http://reality.sgi.com/davea/objectinfo.html";>Debugging/object info</a> by David B.Anderson (including links to some DWARF tools)

)

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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