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
On Sun, 2002-03-17 at 13:44, Neil Booth wrote:
> Daniel Berlin wrote:-
>
> > Weird.
> > I'll have to just explicitly add another end file to dwarf2out i guess.
>
> You shouldn't have to change anything - line-map.c checks everything for
> consistency, and complains if we enter something without leaving it.
> So, that means the issue is elsewhere [I should have remembered this and
> mentioned it right at the start].
>
> Is the hook in c-lex.c (cb_file_change) not doing the right thing for
> the rename case? I'm afraid I don't fully understand the problem.
>
> >From my glance at it, it does a debug_hooks->start_source_file for
> every file entered *apart* from the main file, a
> debug_hooks->end_source_file for every file left, and nothing for a
> rename.
I can prove you are incorrect, or that the call through to the hooks
isn't happening.
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
[root@localhost root]#
No end file hook is called.
If you add an include file, the include file is ended.
#include "tst.h"
#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!
Starting source file!
Ending source file!
Execution times (seconds)
symout : 0.00 ( 0%) usr 0.01 (50%) sys 0.01 (24%)
wall
TOTAL : 0.02 0.02 0.04
[root@localhost root]#
But still, the first two starts have no ends.
Is the problem that nothing is being done for the start of the
> main file?
>
> You'll have to guide me here about what exactly the required semantics
> are; I'm not a debug wizard. And the kludgy file stack handling in
> toplev.c doesn't help; hopefully one day it will die.
>
> Neil.