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]

Re: Identifying source file locations.


kalmquist2@hotmail.com (Kenneth Almquist) writes:

> For statements, the tree should contain the following location
> information:
> 
>     start_loc - 48 bits.  As defined above.
> 
>     end_line_offset - 15 bits?  Adding this to the "line" field of
>         start_loc gives the line number of the last line of the
>         statement.
> 
>     first_on_line - 1 bit.  This is set if the statement is the
>         first statement on the line.  This means that when producing
>         DWARF debugging information the column field can be set to
>         zero.  (See my preceding message to the gcc list.)
> 
> For expression nodes, the tree should contain a location.  For a
> conditional expression (expr? expr : expr) it seems to make the most
> sense to have the location of the node be the location of the question
> mark.

You still haven't covered the case of how does this help us when we go
to generate the actual line numbers? 

Remember, the actual line numbers are done off the NOTE_LINE_NUMBER in
the RTL.  *NOT* in the trees.

Nor could we.
There is no one to one correspondence between trees and RTL when we
are done.

Think of exception handling, code that was expanded, unrolled loops, etc.

We don't produce the dwarf2 line tables from trees.
We never will.
We can't, as long as we aren't generating code from the trees.
Otherwise, it'll never match up.
So all this work is pretty much useless except for error messages,
until we cover the case of doing something in the RTL.
No offense or anything.
It's just a large undertaking to go and implement, and it won't buy us
anything without going all the way and doing something about
NOTE_LINE_NUMBER.

> 				Kenneth Almquist

-- 
"My neighbor has a circular driveway...  He can't get out.
"-Steven Wright


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