This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
How can I get the line number and file name from GCC tree.
- From: Matthieu Moy <Matthieu dot Moy at imag dot fr>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 22 Dec 2003 10:48:21 +0100
- Subject: 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