<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Well, it seems wrong mainly because the description of DW_AT_signature says it applies to incomplete types.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">A definition of a class member (static data member, or method) would normally have a DW_AT_specification referring to the declaration. But in this case the
declaration is buried inside a type unit, and the only thing you can refer to from outside the type unit is the type as a whole, via DW_AT_signature.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I’m astonished that GCC hasn’t run into this already. Or is that where the idea for the DW_AT_declaration hack came from? Whining about this to Cary might
help you feel better. </span><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">J</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Who gets to file the issue with the DWARF committee?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">--paulr<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> David Blaikie [mailto:dblaikie@gmail.com]
<br>
<b>Sent:</b> Friday, January 31, 2014 2:17 PM<br>
<b>To:</b> Robinson, Paul<br>
<b>Cc:</b> llvm-commits@cs.uiuc.edu<br>
<b>Subject:</b> Re: [llvm] r200569 - DebugInfo: Flag type unit references as declarations<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Fri, Jan 31, 2014 at 2:08 PM, Robinson, Paul <<a href="mailto:Paul_Robinson@playstation.sony.com" target="_blank">Paul_Robinson@playstation.sony.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">This just seems wrong. <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">How so? (yeah, I'd sort of like it if the debugger assumed that a DW_TAG_class/structure with a DW_AT_signature was assumed to be a declaration (of sorts)) I can think of a few ways it seems wrong, but curious what you've got in mind.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal"> What prompted it?<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Several failures in gdb.cp/m-static.exp in the GDB 7.5 test suite. (there's still one more failure I'm investigating most likely due to missing DW_AT_stmt_list on type units)<br>
<br>
The story goes something like this:<br>
<br>
* Type goes in a type unit.<br>
* 'skeletal' type (DW_TAG_class with a DW_AT_signature) goes in the compile unit.<br>
* but now you want to reference one of the members of the type from within the compile unit (in m-static's case, it's because you have an out-of-line definition of a static member variable), so insert a declaration of that particular member into the 'skeletal'
type.<br>
<br>
This freaks out GDB because it assumes the type with members (even though it has DW_AT_signature) is a definition, it seems.<br>
<br>
I can roll back the patch locally to show/demonstrate more specifically what the failure mode is.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">--paulr<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
> -----Original Message-----<br>
> From: <a href="mailto:llvm-commits-bounces@cs.uiuc.edu">llvm-commits-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:llvm-commits-">llvm-commits-</a><br>
> <a href="mailto:bounces@cs.uiuc.edu">bounces@cs.uiuc.edu</a>] On Behalf Of David Blaikie<br>
> Sent: Friday, January 31, 2014 11:52 AM<br>
> To: <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> Subject: [llvm] r200569 - DebugInfo: Flag type unit references as<br>
> declarations<br>
><br>
> Author: dblaikie<br>
> Date: Fri Jan 31 13:52:26 2014<br>
> New Revision: 200569<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=200569&view=rev" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=200569&view=rev</a><br>
> Log:<br>
> DebugInfo: Flag type unit references as declarations<br>
><br>
> This ensures DWARF consumers don't confuse these references for<br>
> definitions. I'd argue it might be nice to improve debuggers so we don't<br>
> need this, but it's just one field in an abbreviation anyway - so it<br>
> doesn't seem worth the fight.<br>
><br>
> Modified:<br>
> llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
> llvm/trunk/test/DebugInfo/X86/generate-odr-hash.ll<br>
><br>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=200569&r1=2<br>
> 00568&r2=200569&view=diff<br>
> ========================================================================<br>
> ======<br>
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)<br>
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Jan 31 13:52:26<br>
> 2014<br>
> @@ -3016,6 +3016,11 @@ void DwarfDebug::emitDebugStrDWO() {<br>
> void DwarfDebug::addDwarfTypeUnitType(DICompileUnit CUNode,<br>
> StringRef Identifier, DIE<br>
> *RefDie,<br>
> DICompositeType CTy) {<br>
> + // Flag the type unit reference as a declaration so that if it<br>
> contains<br>
> + // members (implicit special members, static data member definitions,<br>
> member<br>
> + // declarations for definitions in this CU, etc) consumers don't get<br>
> confused<br>
> + // and think this is a full definition.<br>
> + CUMap.begin()->second->addFlag(RefDie, dwarf::DW_AT_declaration);<br>
><br>
> const DwarfTypeUnit *&TU = DwarfTypeUnits[CTy];<br>
> if (TU) {<br>
><br>
> Modified: llvm/trunk/test/DebugInfo/X86/generate-odr-hash.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-" target="_blank">http://llvm.org/viewvc/llvm-</a><br>
> project/llvm/trunk/test/DebugInfo/X86/generate-odr-<br>
> hash.ll?rev=200569&r1=200568&r2=200569&view=diff<br>
> ========================================================================<br>
> ======<br>
> --- llvm/trunk/test/DebugInfo/X86/generate-odr-hash.ll (original)<br>
> +++ llvm/trunk/test/DebugInfo/X86/generate-odr-hash.ll Fri Jan 31<br>
> 13:52:26 2014<br>
> @@ -51,8 +51,10 @@<br>
> ; CHECK: Compile Unit: length = [[CU_SIZE:[0-9a-f]+]]<br>
><br>
> ; CHECK: DW_TAG_structure_type<br>
> +; CHECK-NEXT: DW_AT_declaration<br>
> ; CHECK-NEXT: DW_AT_signature<br>
> ; CHECK: DW_TAG_class_type<br>
> +; CHECK-NEXT: DW_AT_declaration<br>
> ; CHECK-NEXT: DW_AT_signature<br>
><br>
> ; Ensure the CU-local type 'walrus' is not placed in a type unit.<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br>
<o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>