<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 21, 2019 at 4:58 AM <<a href="mailto:paul.robinson@sony.com">paul.robinson@sony.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> Is it worth turning these cases into a `llvm-dwarfdump -verify` error?<br>
> (Or some kind of warning?). They look relatively straightforwards to<br>
> identify, aren't contributing to the debug experience, but are costing<br>
> space. I'm all for eliminating these quirks, it bothers users for<br>
> nothing.<br>
> <br>
> (I'm not familiar with `llvm-dwarfdump -verfy`, perhaps this is more a<br>
> case of "debuginfo isn't helpful" as opposed to "the DWARF is wrong").<br>
<br>
The DWARF spec (AFAICT) never specifically constrains the addresses in<br>
a location list to be within the range of the object it's attached to.<br>
I do think this is kind of assumed in at least one place though, and <br>
arguably it wouldn't mean anything. (I'm assuming things like landing <br>
pads for exception handling to destroy objects will DTRT WRT the object <br>
range.)<br>
<br>
`-verify` currently looks at the ranges on an object, and validates the<br>
location expressions, but does not validate the ranges in the location<br>
list against the ranges on the object.  That seems like a reasonable<br>
thing to check.<br></blockquote><div><br></div><div>In some ways I'd sort of like to allow this ^ when it doesn't hurt (when it's not a case of "oh, you should've just used a single location description" or "this range covers two discontiguous chunks of the enclosing scope's ranges - so it's more compact this way") for the potential size benefit. Though admittedly, it wouldn't hurt to have data on how often this happens/how much the savings are once the related bugs are fixed.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                                                                                                |<br>
It could also conceivably look for contiguous ranges with the same <br>
expression. Even if you take the position that it's not "illegal DWARF" <br>
(which it really isn't, it's just taking up more bytes than necessary)<br>
it's certainly not the kind of thing we want to be emitting and would<br>
be evidence of a bug/missing-feature in buildLocationList.<br></blockquote><div><br></div><div>*nod* That's the one that's pretty clearly without benefit/pure inefficient representation.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
--paulr<br>
</blockquote></div></div>