dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]#line directives in treecc and gcov/gdb


From: James Michael DuPont
Subject: Re: [DotGNU]#line directives in treecc and gcov/gdb
Date: Sun, 26 Jan 2003 03:35:56 -0800 (PST)

--- Rhys Weatherley <address@hidden> wrote:
> On Sunday 26 January 2003 08:23 am, Rhys Weatherley wrote:
> 
> > I've never had any problems with gdb and #line.  I regularly do
> things like
> > "break cg_arith.tc:294" and it works just fine.
> 
> OK, I spoke a little too soon.  Looks like gcc 3.2 has some problems.
>  gcc 
> 2.95 never gave me any trouble.  I have precisely the same problem
> with 3.2 
> when I try to set a breakpoint in cs_grammar.y - it tells me that the
> file 
> doesn't exist.  Looks like a bug in gcc, or perhaps recent gdb's.
> 
> It does not appear to be in pnet.  You can work around it by turning
> off #line 
> and then, but that isn't a permanent solution, and won't be checked
> into CVS 
> because it will interfere with debugging on 2.95 systems.  If someone
> knows 
> of a better work-around please step up and tell me.
> 

Ok. Here it is : the no_line directive :
if you dont want lines, turn them off!
mike

Index: info.h
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/info.h,v
retrieving revision 1.8
diff -u -r1.8 info.h
--- info.h      10 Jan 2003 22:13:37 -0000      1.8
+++ info.h      26 Jan 2003 11:32:39 -0000
@@ -224,6 +224,9 @@
        int                             abstract_factory : 1;/* Declare factory 
methods abstract */
        int                             kind_in_vtable : 1;     /* Put kind 
value in vtable only */
        int                             strip_filenames : 1; /* Strip names in 
#line directives */
+
+       int                             print_lines : 1; /* Dont emit #line 
directives */
+
        int                             internal_access : 1; /* Use "internal" 
classes in C# */
 
        /* String to use to replace "yy" in output files */
Index: options.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/options.c,v
retrieving revision 1.6
diff -u -r1.6 options.c
--- options.c   10 Jan 2003 22:13:37 -0000      1.6
+++ options.c   26 Jan 2003 11:32:39 -0000
@@ -297,6 +297,25 @@
        }
 }
 
+
+
+/*
+ * "no_lines": print out line number directives?
+ * 
+ */
+static int PrintLineNumberOption(TreeCCContext *context, char *value,
int flag)
+{
+       if(value)
+       {
+               return TREECC_OPT_NO_VALUE;
+       }
+       else
+       {
+               context->print_lines = flag;
+               return TREECC_OPT_OK;
+       }
+}
+
 /*
  * "strip_filenames": strip filenames in #line directives down
  * to their base name, with no directory information.
@@ -363,6 +382,7 @@
        {"lang",                                LangOption,                     
        0},
        {"block_size",                  BlockSizeOption,                0},
        {"strip_filenames",             StripFilenamesOption,   1},
+       {"no_lines",            PrintLineNumberOption,  0},
        {"no_strip_filenames",  StripFilenamesOption,   0},
        {"internal_access",             InternalAccessOption,   1},
        {"public_access",               InternalAccessOption,   0},
Index: stream.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/stream.c,v
retrieving revision 1.4
diff -u -r1.4 stream.c
--- stream.c    9 Jan 2003 09:18:47 -0000       1.4
+++ stream.c    26 Jan 2003 11:32:40 -0000
@@ -670,7 +670,15 @@
                }
                filename += len;
        }
-       TreeCCStreamPrint(stream, "#line %ld \"%s\"\n", linenum, filename);
+
+       /*
+         todo : 
+         fix the handling of line number here
+       */
+       if(stream->context->print_lines)
+         {
+           TreeCCStreamPrint(stream, "#line %ld \"%s\"\n", linenum,
filename);
+         }
 }
 
 #ifdef __cplusplus


=====
James Michael DuPont
http://introspector.sourceforge.net/

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]