------- Additional Comments From dberlin at gcc dot gnu dot org  2005-03-02 
16:23 -------
(In reply to comment #5)
> Subject: Re:  g++ generates incomplete debug information for given testcase
with optimization
> 
> 
> Keeping in mind my previous email that I'm not familiar with how gcc records
> and tracks the source information, why can it maintain the correct file and
> line number info on a per instruction basis but not the scoping info?

Because the line number info generation is completely seperate (worlds away in
fact) from the generation of the scoping info.
The line info is told to the debug reader completely by the backend.
It happens in the notice_source_line call in final.c
On the other hand, the inlined subroutine entries stuff is generated by the
front and middle ends.
The highpc and lowpc are just labels that the frontend and backend agree on.
The backend is what is outputting the labels for a given function/block's
instructions/start/end/etc.

> 
> Is gcc currently capable of tracking discontiguous scopes that would
> get produced by code motion from optimization, where instructions from
> different scopes get interleaved in the instruction stream?  

It knows how to output DW_AT_ranges, but it doesn't generate it in the cases you
want, I believe.
RTH originally implemented the DW_AT_ranges stuff, so he should know.

> Or is it
> just the case that it currently isn't make full use of the DWARF
> DW_AT_ranges attribute to provide more fine grained matching of
> individual instructions with the scope that generated them?

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20268

Reply via email to