[llvm] r362951 - [DebugInfo] Terminate all location-lists at end of block

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 21 04:58:46 PDT 2019


> Is it worth turning these cases into a `llvm-dwarfdump -verify` error?
> (Or some kind of warning?). They look relatively straightforwards to
> identify, aren't contributing to the debug experience, but are costing
> space. I'm all for eliminating these quirks, it bothers users for
> nothing.
> 
> (I'm not familiar with `llvm-dwarfdump -verfy`, perhaps this is more a
> case of "debuginfo isn't helpful" as opposed to "the DWARF is wrong").

The DWARF spec (AFAICT) never specifically constrains the addresses in
a location list to be within the range of the object it's attached to.
I do think this is kind of assumed in at least one place though, and 
arguably it wouldn't mean anything. (I'm assuming things like landing 
pads for exception handling to destroy objects will DTRT WRT the object 
range.)

`-verify` currently looks at the ranges on an object, and validates the
location expressions, but does not validate the ranges in the location
list against the ranges on the object.  That seems like a reasonable
thing to check.
												|
It could also conceivably look for contiguous ranges with the same 
expression. Even if you take the position that it's not "illegal DWARF" 
(which it really isn't, it's just taking up more bytes than necessary)
it's certainly not the kind of thing we want to be emitting and would
be evidence of a bug/missing-feature in buildLocationList.

--paulr


More information about the llvm-commits mailing list