This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Speaking of DWARF-2 macro info
- From: Daniel Berlin <dan at dberlin dot org>
- To: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Cc: Zack Weinberg <zack at codesourcery dot com>, <gcc-bugs at gcc dot gnu dot org>
- Date: Thu, 21 Mar 2002 16:00:59 -0500 (EST)
- Subject: Re: Speaking of DWARF-2 macro info
On Thu, 21 Mar 2002, Neil Booth wrote:
> Daniel Berlin wrote:-
>
> > Watch what happens when i have it printf "Starting source file" at the
> > beginning of dwarf2out_start_source_file, and "Ending source file" at
> > the beginning of dwarf2out_end_source_file:
> >
> > Example file tst.c:
> > #define bob(A,b) A-b
> >
> > Output:
> > [root@localhost root]# /gccbuild/egcs/buil/gcc/cc1 -gdwarf-2 -g3 tst.c
> > Starting source file!
> > Starting source file!
> >
> > Execution times (seconds)
> > parser : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.01 (11%)
> > wall
> > TOTAL : 0.03 0.00 0.09
>
> OK, let's get this fixed.
>
> I'm confused. In your initial post, you claimed that there was one
> entry call too many. Now you're claiming there are two. Which is it?
In reality?
One.
This is because the main file is always assumed to be left unterminated,
and we explicitly end it in the dwarf2 output.
I view this as broken, but in light of it, it does mean there is only one
entry too many right now.
>
> If I put an fprintf in dwarf2out_{start,end}_source_file like you did,
> then I get, on a file foo.c that #inclues a single header foo.h:
>
> Initial // c_common_parse_file's call of the debug hook
> --Entered /tmp/foo.c
> Entered with callback // cb_file_change for foo.h
> --Entered /tmp/foo.h
> Left // cb_file_change for leaving foo.h
> --Left
>
> Here those beginning with "--" are in dwarf2out.c's callbacks. The
> other fprintf's are in c-lex.c. So I can't reproduce your two excess
> "Starting source file"'s.
Weird.
Are you calling cc1 directly, or through the driver?