This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

Re: Speaking of DWARF-2 macro info


On Mon, 25 Mar 2002, Neil Booth wrote:

> Daniel Berlin wrote:-
> 
> > > Directly:  ./cc1 -quiet -gdwarf-2 -g2 /tmp/foo.c
> > 
> > Okay.
> > Let me double check it again, and then i'll answer the rest of what you 
> > asked.
> > I just wanted to make sure i wasn't doing something differently from you.
> 
> Found anything odd happening?  b.t.w., if you can get the debug-specific
> code to accept a final end_source_file call, instead of relying on
> the finish hook to do it, that would be cool too.

We need the finish hook because we output global decls after the final 
end source file call, I think.

Anyway, i can still reproduce the problem.

We still emit one too many start file calls (First source file twice), and 
one too few end file calls (no final end source file)
[root@danberlin gcc]# ./cc1 test.c -gdwarf-2 -g3 |grep Start|wc

Execution times (seconds)
 preprocessing         :   0.04 (40%) usr   0.01 (50%) sys   0.05 (43%) 
wall
 lexical analysis      :   0.00 ( 0%) usr   0.01 (50%) sys   0.01 ( 8%) 
wall
 parser                :   0.02 (20%) usr   0.00 ( 0%) sys   0.02 (16%) 
wall
 symout                :   0.01 (10%) usr   0.00 ( 0%) sys   0.01 ( 8%) 
wall
 TOTAL                 :   0.10             0.02             0.12
     24      72     528
[root@danberlin gcc]# ./cc1 test.c -gdwarf-2 -g3 |grep End|wc

Execution times (seconds)
 preprocessing         :   0.02 (18%) usr   0.00 ( 0%) sys   0.02 (18%) 
wall
 parser                :   0.04 (36%) usr   0.00 ( 0%) sys   0.04 (38%) 
wall
 symout                :   0.02 (18%) usr   0.00 ( 0%) sys   0.02 (18%) 
wall
 TOTAL                 :   0.11             0.00             0.11
     22      66     440
[root@danberlin gcc]#

[root@danberlin gcc]# cat test.c
#include "foo.h"
[root@danberlin gcc]# cat foo.h
#include <stdio.h>

[root@danberlin gcc]#


Oh, wait i know where it's from.

Why the heck do we do that.
/* Called from debug_define in toplev.c.  The `buffer' parameter contains
11921      the tail part of the directive line, i.e. the part which is 
past the
11922      initial whitespace, #, whitespace, directive-name, whitespace 
part.  */
11923
11924   static void
11925   dwarf2out_define (lineno, buffer)
11926        unsigned lineno ATTRIBUTE_UNUSED;
(gdb) l
11927        const char *buffer ATTRIBUTE_UNUSED;
11928   {
11929     static int initialized = 0;
11930     if (!initialized)
11931       {
11932         dwarf2out_start_source_file (0, primary_filename);
11933         initialized = 1;
11934       }
11935

This is where the second call comes from.



> 
> Neil.
> 


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