This is the mail archive of the gcc@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]

How can I get the line number and file name from GCC tree.


Hi !

There is a feature I'm looking for mainly for debugging :

I have a GCC tree that I can print from GDB with debug_tree(t). What I
would like is  to be able to get  back-to-source information, ie which
file and at which line number is the source code which has been parsed
to produce this tree. 

I first tried someting like

void tree_linenb(tree t) {
   printf("Line %d\n", STMT_LINENO(t));
}

But it takes several seconds to answer. Strange ... 

And most important : I can't find the equivalent for the filename.

Thanks for your answers.

-- 
Matthieu


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