On Tue, 2005-08-09 at 12:28 +0100, Daniel Towner wrote:
> Hi all,
> 
> I am encountering a problem with DWARF location lists. Consider the 
> following assembly:
> 
> _Ltext:
> main:
> _LVL0:
>         ;# basic block 0
> _LVL1:
> 
> This generates a DWARF location list entry whose begin and end addresses 
> are identical, due to the empty basic block. Not a great problem on the 
> face of it, but I'm using gcc in an embedded system in which the `main' 
> function is placed at address 0. 
> Thus, the location list entry gets an 
> address range of [0, 0) which denotes the supposed end of the location 
> list. This corrupts the location list, making it impossible to debug 
> optimised code.

> Would it be difficult to detect empty location list so that they are 
> never emitted? 

It depends. We already try to elide obviously empty ones when possible.
NOTES get in the way sometimes, and we don't try to handle that (see
dwarf2out.c:add_var_loc_to_decl)

However, even if you did handle that, you couldn't remove all of the
empty location lists because the code between them may disappear in
machine reorg, linker relaxation, etc.



Reply via email to