<div>Hi Paul,</div><div><br></div>Now this is interesting, I've filed PR13942 and sent a straightforward fix for that<div>to review just today (re-attaching it to this mail in case you're not subscribed for</div><div>
cfe-commits). I found it confusing that some functions (like artificial ones)</div><div>lack any debug info entries - it makes it harder for debugger (or other tools)</div><div>to understand which compile unit a given function corresponds to. So, thanks for</div>
<div>pointing at r158009 :)</div><div><br></div><div>I don't know what the right solution to this situation is. Probably,</div><div>we can provide debug info for method declarations and drop it</div><div>for method bodies if methods are artificial or have "nodebug" attribute?</div>
<div><div><div><div><div><br><div class="gmail_quote">On Tue, Oct 16, 2012 at 10:51 PM, Robinson, Paul <span dir="ltr"><<a href="mailto:Paul.Robinson@am.sony.com" target="_blank">Paul.Robinson@am.sony.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Patch #1: Suppress debug info associated with the body of an<br>
artificial method. We already suppress debug info for its declaration<br>
inside the class description.<br>
Fixes PR14097.<br>
<br>
Patch #2: Suppress debug info for the declaration of a class method<br>
marked __attribute__((nodebug)). We already suppress debug info for<br>
the body of the method.<br>
<br>
Here's the story:<br>
r158009 suppressed debug-info entries for artificial (compiler<br>
generated) methods, typically constructors and destructors, from the<br>
debug info for a class. The idea is that these aren't interesting or<br>
useful. Which is pretty much true.<br>
<br>
Unfortunately, the method _definitions_ still get debug info, and if<br>
there's no declaration in the class for it to refer to, Clang<br>
spontaneously generates debug info for a declaration.  If a ctor has<br>
multiple definitions, which they sometimes do (e.g. when there's a<br>
virtual base class), each instance produces its own separate<br>
declaration.  And so the total debug info size _increases_. Patch #1<br>
suppresses debug-info on the definitions as well.<br>
<br>
While finding the fix, I noticed that the 'nodebug' attribute will<br>
suppress debug info for a method definition, but we don't suppress<br>
debug info for the corresponding declaration inside a class.<br>
(Non-class functions don't have this problem because Clang doesn't<br>
emit debug info for a function declaration anyway.)  Patch #2<br>
addresses that oversight.<br>
<br>
I renamed the Sema and CodeGen tests for the 'nodebug' attribute from<br>
.c to .cpp and added test points for methods, rather than add whole<br>
new test files. Hope that's okay.<br>
<br>
--paulr<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div><br>
</div></div></div></div></div>